> ## 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.

# v2 prices

> <Warning>Preview, not deployed. The v2 gateway is built but not deployed yet; this call works once the owner deploys `silo-api`.</Warning>

What did it trade at? Daily history (split-adjusted by default), latest quote, sessions, indices, B3 FORWARD prints.

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.

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 (preview, not deployed)
  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. Preview, not deployed. The v2 gateway is built but not
    deployed yet; this call works once the owner deploys `silo-api`.
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/functions/v1/silo-api/v2
    description: The silo-api Edge Function (preview, not deployed).
security:
  - apikey: []
  - apikey: []
    bearerAuth: []
paths:
  /prices:
    get:
      summary: v2 prices
      description: >-
        <Warning>Preview, not deployed. The v2 gateway is built but not deployed
        yet; this call works once the owner deploys `silo-api`.</Warning>


        What did it trade at? Daily history (split-adjusted by default), latest
        quote, sessions, indices, B3 FORWARD prints.


        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.


        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). Default: history.
          schema:
            type: string
            enum:
              - history
              - latest
              - session
              - index
              - forward
            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. 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
      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 api.* endpoint that answered.
          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
            - message
            - target
            - innererror
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unknown_parameter
                - unknown_id
                - unauthorized
                - forbidden_for_tier
                - over_limit
                - rate_limited
                - timeout
                - unavailable
                - internal
            message:
              type: string
            target:
              type:
                - string
                - 'null'
            innererror:
              type: object
              properties:
                sqlstate:
                  type:
                    - string
                    - 'null'
                hint:
                  type:
                    - string
                    - 'null'
                details:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        The public publishable key. It identifies the project, not you, and is
        the anonymous tier.
      x-default: sb_publishable__yfFQsykAglrvc9GS6_PYw_B24ex437
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Optional. A user JWT from Supabase Auth, for the signed-in tier. Never a
        secret key.

````

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