> ## Documentation Index
> Fetch the complete documentation index at: https://octo-98895abd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Prices

> What did it trade at? Daily history (split-adjusted by default), latest quote, sessions, indices, B3 FORWARD prints, and the risk split of a share.

Example: `/v2/prices?id=PETR4`

Kinds:

- `history`: api.quote_history: one ticker, oldest first, 1 year to the latest session by default, paged with the function's p_after cursor. With no id: the research universe (the tickers held).
- `latest`: api.quote_latest: the ticker's newest session (raw, adjusted false). With no id: the research universe.
- `session`: One session's quotes from one price view (raw, adjusted false). Paged with order + limit + offset; the default session is pinned in the cursor.
- `index`: api.index_history: one B3 index code (IBOV, IFIX, ...), levels as published (total-return indices, not adjusted). With no id the SQL refusal names the codes held.
- `forward`: api.trade_consolidated_history: one FORWARD-segment ticker; last_price is the close, ref_price is never a trade.
- `risk`: api.risk_decompose: one row for one share or unit. market_share, sector_share and residual_share of the daily return variance add to 1; betas, gamma (the sector index's beta to IBOV), hedge ratios per R$ 1 long, annualized volatilities, and the same split without shock sessions (ex_shock_*). OLS cascade on daily simple returns from the joined total-return levels. The window is from..to (default 12 months); at most 1000 sessions. Realized and historical only, not advice.

With no `from`, a dated kind reads the last 12 months to `to`.

`GET /v2/prices?help` describes the main parameters, `?help=all` adds the hidden ones.



## OpenAPI

````yaml /api-docs/v2/openapi.json get /prices
openapi: 3.1.0
info:
  title: SILO API v2
  version: v2
  description: >-
    The v2 gateway over SILO's schema `api`: 14 resources, five shared
    parameters, one envelope and one error object. Generated from
    supabase/functions/silo-api/registry.ts by scripts/gen_openapi_v2.py; do not
    edit by hand. The original v1 API stays available until it is retired.
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/functions/v1/silo-api/v2
    description: The silo-api Edge Function.
security:
  - {}
  - bearerAuth: []
tags:
  - name: Discovery
  - name: Markets and macro
  - name: Companies and funds
  - name: Research
paths:
  /prices:
    get:
      tags:
        - Markets and macro
      summary: Prices
      description: >-
        What did it trade at? Daily history (split-adjusted by default), latest
        quote, sessions, indices, B3 FORWARD prints, and the risk split of a
        share.


        Example: `/v2/prices?id=PETR4`


        Kinds:


        - `history`: api.quote_history: one ticker, oldest first, 1 year to the
        latest session by default, paged with the function's p_after cursor.
        With no id: the research universe (the tickers held).

        - `latest`: api.quote_latest: the ticker's newest session (raw, adjusted
        false). With no id: the research universe.

        - `session`: One session's quotes from one price view (raw, adjusted
        false). Paged with order + limit + offset; the default session is pinned
        in the cursor.

        - `index`: api.index_history: one B3 index code (IBOV, IFIX, ...),
        levels as published (total-return indices, not adjusted). With no id the
        SQL refusal names the codes held.

        - `forward`: api.trade_consolidated_history: one FORWARD-segment ticker;
        last_price is the close, ref_price is never a trade.

        - `risk`: api.risk_decompose: one row for one share or unit.
        market_share, sector_share and residual_share of the daily return
        variance add to 1; betas, gamma (the sector index's beta to IBOV), hedge
        ratios per R$ 1 long, annualized volatilities, and the same split
        without shock sessions (ex_shock_*). OLS cascade on daily simple returns
        from the joined total-return levels. The window is from..to (default 12
        months); at most 1000 sessions. Realized and historical only, not
        advice.


        With no `from`, a dated kind reads the last 12 months to `to`.


        `GET /v2/prices?help` describes the main parameters, `?help=all` adds
        the hidden ones.
      operationId: v2_prices
      parameters:
        - name: kind
          in: query
          required: false
          description: >-
            history: one ticker's daily series. latest: its newest session.
            session: every quote of one session (the seven price views in one).
            index: a B3 index's daily levels. forward: B3 FORWARD-segment prints
            (fixed-income ETFs COTAHIST does not carry). risk: one share's daily
            return variance split into IBOV, a sector index and the residual,
            one row (realized, not advice). Default: history.
          schema:
            type: string
            enum:
              - history
              - latest
              - session
              - index
              - forward
              - risk
            default: history
        - name: freq
          in: query
          required: false
          description: >-
            kind history, index, forward. month: the last session of each month,
            selected from the daily rows (no interpolation; a month with no
            session has no row). Default: day.
          schema:
            type: string
            enum:
              - day
              - month
            default: day
        - name: adjust
          in: query
          required: false
          description: >-
            kind history. split: close_adj (splits, groupings, bonus shares; no
            dividends). none: the raw close as traded. Every row carries
            adjusted (true or false); the other kinds are never adjusted.
            Default: split.
          schema:
            type: string
            enum:
              - split
              - none
            default: split
        - name: id
          in: query
          required: false
          description: >-
            By kind: history, latest take a B3 ticker (PETR4); session takes a
            B3 ticker (none: every ticker of the session); index takes a B3
            index code (IBOV, IFIX, ...); forward takes a B3 FORWARD-segment
            ticker; risk takes a B3 share or unit ticker (ITUB4). Required for
            kind risk. With no id, kinds history, latest read
            api.research_universe (what SILO holds). Default: none.
          schema:
            type: string
          example: PETR4
        - name: from
          in: query
          required: false
          description: >-
            First date of the window, YYYY-MM-DD. Default: the resource's
            default window, counted back from to.
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: false
          description: >-
            Last date of the window, YYYY-MM-DD. Default: the latest complete
            period, from coverage.
          schema:
            type: string
            format: date
        - name: limit
          in: query
          required: false
          description: >-
            The page size. More rows than one page come through next_page_url,
            never cut silently; a call stops at the tier's rows-per-call cap
            with meta.tier_cap_reached. Default: the tier's page maximum (10
            anonymous, 100 signed in); a larger value is coerced to it.
          schema:
            type: integer
            minimum: 1
        - name: cursor
          in: query
          required: false
          description: >-
            The opaque cursor from a previous next_page_url. It carries every
            other parameter: send it alone (another parameter with a different
            value is bad_request). Default: none: the first page.
          schema:
            type: string
        - name: board
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind history, latest,
            session. A BDI board code (02 is the standard lot). Default: all
            boards: the series follows the ISIN across boards.
          schema:
            type: string
        - name: asset_class
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind session. all:
            api.quotes (standard lot, tpmerc 010). Each class reads its own view
            (equities, bdrs, units, fund_quotas, cash_securities: standard, odd
            and block lots, with lot on the row; auctions: tpmerc 017), with
            every column it publishes. Default: all.
          schema:
            type: string
            enum:
              - all
              - equity
              - bdr
              - unit
              - fund_quota
              - cash_security
              - auction
            default: all
        - name: fields
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). core: a short set (history:
            ticker, trade_date, close_adj or close, isin). all: every column the
            endpoint publishes. index and forward publish few columns, so core
            is all of them. Default: core.
          schema:
            type: string
            enum:
              - core
              - all
            default: core
        - name: date
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind session. The session
            date, YYYY-MM-DD. Default: the latest session in the 14 days to
            today that matches the other filters.
          schema:
            type: string
            format: date
        - name: sector
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind risk. none (market and
            residual only), or a B3 index code other than IBOV: IFNC, IMAT,
            IEEX, UTIL, IMOB, ICON, IBXX, IBXL, SMLL, IDIV. Default: SILO's map
            from the company's CVM setor to a B3 sector index; a setor with no
            index gets no sector leg.
          schema:
            type: string
      responses:
        '200':
          description: The v2 envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
        default:
          description: >-
            The v2 error object. A SILO refusal (over_limit) keeps its message,
            hint and details verbatim.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Envelope:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items: {}
          description: Always a list. Rows as the endpoint returned them; null stays null.
        meta:
          type: object
          required:
            - resource
            - kind
            - request
            - id_known
          properties:
            resource:
              type: string
            kind:
              type:
                - string
                - 'null'
            request:
              type: object
              description: Every parameter the resource takes, with the default applied.
            id_known:
              type:
                - boolean
                - 'null'
              description: Whether SILO holds the id; null when the call names none.
            endpoint:
              type: string
              description: The data endpoint that answered.
            source:
              type: string
              description: >-
                The canonical request to cite: /v2/<resource>? with every
                applied parameter, defaults included, so it replays the same
                rows. POST says so; its lists are in meta.body.
            data_through:
              type:
                - string
                - 'null'
              format: date
              description: >-
                The newest elapsed period SILO holds for the dataset this
                endpoint reads (the coverage resource's data_through for
                coverage_dataset). Null when no coverage row applies or the
                coverage read failed; never a guess.
            coverage_dataset:
              type:
                - string
                - 'null'
              description: >-
                The coverage dataset data_through comes from; null when none
                applies.
            data_through_error:
              type: string
              description: >-
                Present only when the coverage read failed: why data_through is
                null. The rows are unaffected.
            tier:
              type: string
              enum:
                - anonymous
                - signed_in
                - pro
            tier_cap_reached:
              type: boolean
              description: True when the result is partial because of the tier cap.
          additionalProperties: true
        next_page_url:
          type: string
          description: Present only when more rows remain. It carries one opaque cursor.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - reason
            - message
            - target
            - innererror
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unknown_parameter
                - unknown_id
                - unauthorized
                - payment_required
                - forbidden_for_tier
                - over_limit
                - rate_limited
                - timeout
                - unavailable
                - internal
            reason:
              type:
                - string
                - 'null'
              enum:
                - row_cap
                - tier_cap
                - null
              description: >-
                over_limit only: row_cap (over one 1,000-row page: narrow or
                page) or tier_cap (over the tier ceiling: narrow or sign in).
                Null otherwise.
            message:
              type: string
            target:
              type:
                - string
                - 'null'
            innererror:
              type: object
              properties:
                sqlstate:
                  type:
                    - string
                    - 'null'
                hint:
                  type:
                    - string
                    - 'null'
                details:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: SILO user access token for authenticated data requests.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.