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

# coverage

> Freshness AND honesty per dataset. as_of = the newest period that has landed and has actually ELAPSED (bounded by today); complete_through = the newest COMPLETE period, which is what default windows serve; newest_period = the newest period KEY present, which can sit in the future when a family files forward-dated (FIP is keyed 31-December); landed_at = when ingest last SUCCEEDED for that source, from cvm_ingest_log (status ok with a finish time, so a later failed run never advances it); landed_git_sha = the git commit of THAT run — which code produced this data — NULL when the run recorded none (before migration 44, or run outside GitHub Actions), never borrowed from an older run. funds_<family> rows report each filing cadence separately. notes carries a caveat the dates cannot: the quotes row states where the cash tape starts (quote_history refuses a window before an instrument's first session); the funds_fidc row states the 2020-11 delinquency regime break (null for a fund with no tab VI row before, filed on every row after — never read that null as zero); funds_fip states why its newest_period runs ahead; fund_nav points at catalog().applicability and api.metric_coverage(); the fidc_tranches and fidc_aging rows state that those informe tabs come from CVM's yearly HIST archive through 2024-12 and the monthly informe from 2025-01; the fnet_documents row (the FNET register behind fund_documents and fund_restatements) is keyed on the DELIVERY day, with complete_through the day before as_of, and states that its history begins at first capture / backfill and that fund links come from a fortnightly sweep, so recent documents may have no cnpj yet; the company_events row (IPE filings, keyed on the delivery date, complete_through NULL as on financials) states that history starts in 2015 and that filings CVM published without a protocol number are not held; the macro_series and ptax rows carry their units and cadences (SELIC_META is published ahead, so its newest_period can sit in the future); the di_futures and reference_curves rows (B3 Price Report DI1 contracts from 2018, B3 reference curves from 2008) state where each history starts and that the long curve vertices are B3's extrapolation, not prices; and the five B3 lending / flow rows (short_interest, short_interest_by_sector, lending_trades, lending_participants, investor_flow) state the RATCHET — B3 keeps ~21 business days and publishes no archive, so their span starts at first capture and no backfill exists — along with the float_basis, brokerage-not-owner and first-difference traps that make those series easy to read wrongly. Their landed_at is split by ingest doc_type, so a COTAHIST run never reports as the lending group's freshness.



## OpenAPI

````yaml /openapi.json post /rpc/coverage
openapi: 3.1.0
info:
  title: SILO Data API
  version: '75'
  summary: >-
    Read-only Brazilian public financial data: CVM filings, BACEN series, B3
    quotes and the B3 BDI group.
  description: >
    Schema `api` over PostgREST. Views are `GET /<view>`; functions are

    `POST /rpc/<function>` with a JSON body.


    **This document is generated** from the live Postgres catalog by

    `scripts/gen_openapi.py` — `pg_get_function_arguments` for the RPC
    signatures,

    `information_schema.columns` for the view columns, and the granted-to-`anon`

    privilege set for which objects exist at all. It is not hand-maintained, and

    `tests/test_openapi_spec.py` fails the build when it drifts from the SQL.


    ### Two different ceilings


    Reading one for the other is the most expensive mistake on this API.


    * **The row cap refuses.** Fifty-nine set-returning functions raise SQLSTATE
      `22023` when the window they were handed would produce more than 1000 rows.
      Nothing is trimmed, and the error says why and how to fix it (the message,
      plus PostgREST's `details` and `hint`). Five of them (`panel`,
      `quote_history`, `fund_nav`, `index_history`, `trade_consolidated_history`)
      take a `p_after` cursor so you can walk the series; the other fifty-four ask you to narrow the window. `fund_nav` paging
      additionally REQUIRES `p_entity_type` — its cursor is a bare period, which
      is unique only within one family, and CNPJs that file under both `fi` and
      `fidc` in the same month would otherwise be ambiguous.
    * **The tier ceiling clamps.** Three other functions (`search_funds`,
      `option_chain`, `option_exercises`) silently lower `p_limit` to a per-tier maximum. No error is raised, so the
      only way to know the result was cut is to know the ceiling. Signing in
      raises it.

    Separately from both, PostgREST's server-wide `db-max-rows = 1000` cuts
    every

    response, on every endpoint, for every tier. On the GET views
    `Content-Range`

    is the signal (`0-999/*`); `Prefer: count=exact` turns the `*` into a total.


    ### Retention


    Most of this warehouse is append-only history. The **B3 BDI group** —

    `short_interest`, `short_interest_by_sector`, `investor_flow`,

    `lending_trades`, `lending_participants` — is not: B3 keeps roughly 21
    business

    days and publishes no archive. A missed session cannot be bought back. See

    Market Coverage.
  license:
    name: See repository
    url: https://github.com/PedroDnT/SILO-BZ
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1
    description: Supabase PostgREST, schema `api`
security:
  - apikey: []
tags:
  - name: ANBIMA
  - name: Company events
  - name: Coverage & catalog
  - name: Derivatives
  - name: FIDC
  - name: FNET documents
  - name: Financials
  - name: Funds
  - name: Holdings
  - name: Inflation
  - name: Lookup
  - name: Macro
  - name: Macro expectations
  - name: Other
  - name: Panel
  - name: Portfolio
  - name: Quotes
  - name: Rates
  - name: Research
  - name: Screens
  - name: Securities lending
  - name: Short interest & flows
paths:
  /rpc/coverage:
    post:
      tags:
        - Coverage & catalog
      summary: coverage
      description: >-
        Freshness AND honesty per dataset. as_of = the newest period that has
        landed and has actually ELAPSED (bounded by today); complete_through =
        the newest COMPLETE period, which is what default windows serve;
        newest_period = the newest period KEY present, which can sit in the
        future when a family files forward-dated (FIP is keyed 31-December);
        landed_at = when ingest last SUCCEEDED for that source, from
        cvm_ingest_log (status ok with a finish time, so a later failed run
        never advances it); landed_git_sha = the git commit of THAT run — which
        code produced this data — NULL when the run recorded none (before
        migration 44, or run outside GitHub Actions), never borrowed from an
        older run. funds_<family> rows report each filing cadence separately.
        notes carries a caveat the dates cannot: the quotes row states where the
        cash tape starts (quote_history refuses a window before an instrument's
        first session); the funds_fidc row states the 2020-11 delinquency regime
        break (null for a fund with no tab VI row before, filed on every row
        after — never read that null as zero); funds_fip states why its
        newest_period runs ahead; fund_nav points at catalog().applicability and
        api.metric_coverage(); the fidc_tranches and fidc_aging rows state that
        those informe tabs come from CVM's yearly HIST archive through 2024-12
        and the monthly informe from 2025-01; the fnet_documents row (the FNET
        register behind fund_documents and fund_restatements) is keyed on the
        DELIVERY day, with complete_through the day before as_of, and states
        that its history begins at first capture / backfill and that fund links
        come from a fortnightly sweep, so recent documents may have no cnpj yet;
        the company_events row (IPE filings, keyed on the delivery date,
        complete_through NULL as on financials) states that history starts in
        2015 and that filings CVM published without a protocol number are not
        held; the macro_series and ptax rows carry their units and cadences
        (SELIC_META is published ahead, so its newest_period can sit in the
        future); the di_futures and reference_curves rows (B3 Price Report DI1
        contracts from 2018, B3 reference curves from 2008) state where each
        history starts and that the long curve vertices are B3's extrapolation,
        not prices; and the five B3 lending / flow rows (short_interest,
        short_interest_by_sector, lending_trades, lending_participants,
        investor_flow) state the RATCHET — B3 keeps ~21 business days and
        publishes no archive, so their span starts at first capture and no
        backfill exists — along with the float_basis, brokerage-not-owner and
        first-difference traps that make those series easy to read wrongly.
        Their landed_at is split by ingest doc_type, so a COTAHIST run never
        reports as the lending group's freshness.
      operationId: rpc_coverage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
              description: This function takes no arguments; send `{}`.
      responses:
        '200':
          description: >-
            The result set, oldest first. An unknown id is an empty array, not a
            404 and never a guessed value.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    dataset:
                      type:
                        - string
                        - 'null'
                    as_of:
                      type:
                        - string
                        - 'null'
                      format: date
                    complete_through:
                      type:
                        - string
                        - 'null'
                      format: date
                    source:
                      type:
                        - string
                        - 'null'
                    notes:
                      type:
                        - string
                        - 'null'
                    newest_period:
                      type:
                        - string
                        - 'null'
                      format: date
                    landed_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                    landed_git_sha:
                      type:
                        - string
                        - 'null'
        '400':
          description: >-
            Bad request. Contract violations raise SQLSTATE `22023` with a
            message naming the limit or the argument at fault.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            No usable `apikey`, or a request for a schema outside `api`.
            `Accept-Profile: public` and any `cvm_*` / `b3_cotahist` / `cia_*`
            path answer 401 for every caller, by grant — schema `api` is the
            entire public surface.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such endpoint in schema `api`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      description: >-
        PostgREST error body. `code` carries the SQLSTATE — `22023` is a
        contract refusal.
      properties:
        code:
          type:
            - string
            - 'null'
          examples:
            - '22023'
        message:
          type:
            - string
            - 'null'
        details:
          type:
            - string
            - 'null'
        hint:
          type:
            - string
            - 'null'
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        The publishable key (`sb_publishable_…`), on every request. It is NOT a
        JWT — sending it as `Authorization: Bearer` is rejected as an invalid
        JWT. It identifies the project, not you, and maps to the Postgres `anon`
        role.

````

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