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

# Macro

> Macro series, inflation and its item tree, PTAX, Focus expectations.

Example: `/v2/macro?kind=inflation`

Kinds:

- `series`: api.macro_series: one SGS series by label or code, oldest first. Refuses above 1000 rows: narrow from/to.
- `inflation`: api.inflation: the IPCA set by month with acc_12m, 3 years by default. Refuses above 1000 rows: pin id or family, or narrow from.
- `inflation_items`: api.inflation_items: IBGE's IPCA tree (weight, monthly change, contribution, year-to-date and 12-month change), 3 years by default. With no id, the groups (level 1); with an id, that item at its own level.
- `fx`: api.ptax: one currency's PTAX, BRL per one unit, as published. currency=all reads the api.ptax_daily view, every currency at once.
- `expectations`: api.focus_expectations: one survey and horizon across survey dates (the weekly revision path), median, mean and standard deviation. Refuses above 1000 rows.

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

id per kind: series takes a label or SGS code (SELIC_META, CDI, IGPM, 432); inflation one series label (IPCA, IPCA_CORE_EX0, ...; none: every series); inflation_items an IBGE structure number or SIDRA item code (none: the groups); expectations a Focus indicator (IPCA, Selic, ...; none: every indicator).

BACEN's IPCA group codes 1640-1643 are Comunicação, Saúde, Despesas pessoais, Educação, as measured against SIDRA. Focus rows are baseCalculo=0 (the trailing 30-day sample); the 12-month inflation survey is unsmoothed. Nothing is filled.

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



## OpenAPI

````yaml /api-docs/v2/openapi.json get /macro
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:
  /macro:
    get:
      tags:
        - Markets and macro
      summary: Macro
      description: >-
        Macro series, inflation and its item tree, PTAX, Focus expectations.


        Example: `/v2/macro?kind=inflation`


        Kinds:


        - `series`: api.macro_series: one SGS series by label or code, oldest
        first. Refuses above 1000 rows: narrow from/to.

        - `inflation`: api.inflation: the IPCA set by month with acc_12m, 3
        years by default. Refuses above 1000 rows: pin id or family, or narrow
        from.

        - `inflation_items`: api.inflation_items: IBGE's IPCA tree (weight,
        monthly change, contribution, year-to-date and 12-month change), 3 years
        by default. With no id, the groups (level 1); with an id, that item at
        its own level.

        - `fx`: api.ptax: one currency's PTAX, BRL per one unit, as published.
        currency=all reads the api.ptax_daily view, every currency at once.

        - `expectations`: api.focus_expectations: one survey and horizon across
        survey dates (the weekly revision path), median, mean and standard
        deviation. Refuses above 1000 rows.


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


        id per kind: series takes a label or SGS code (SELIC_META, CDI, IGPM,
        432); inflation one series label (IPCA, IPCA_CORE_EX0, ...; none: every
        series); inflation_items an IBGE structure number or SIDRA item code
        (none: the groups); expectations a Focus indicator (IPCA, Selic, ...;
        none: every indicator).


        BACEN's IPCA group codes 1640-1643 are Comunicação, Saúde, Despesas
        pessoais, Educação, as measured against SIDRA. Focus rows are
        baseCalculo=0 (the trailing 30-day sample); the 12-month inflation
        survey is unsmoothed. Nothing is filled.


        `GET /v2/macro?help` describes the main parameters, `?help=all` adds the
        hidden ones.
      operationId: v2_macro
      parameters:
        - name: kind
          in: query
          required: false
          description: >-
            series: one BACEN SGS series. inflation: the IPCA set (headline,
            cores, groups, diffusion) with 12-month accumulation.
            inflation_items: IBGE's IPCA item tree with weights. fx: BACEN PTAX
            buy and sell rates. expectations: the BCB Focus survey path.
            Default: series.
          schema:
            type: string
            enum:
              - series
              - inflation
              - inflation_items
              - fx
              - expectations
            default: series
          example: inflation
        - name: id
          in: query
          required: false
          description: >-
            By kind: series takes an SGS series label or code (SELIC_META, CDI,
            IGPM, 432); inflation takes one series label (IPCA, IPCA_CORE_EX0,
            ...; none: every series); inflation_items takes an IBGE structure
            number or SIDRA item code (none: the groups); expectations takes a
            Focus indicator (IPCA, Selic, ...; none: every indicator). Required
            for kind series. Kind fx takes no id. Default: none.
          schema:
            type: string
        - 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: family
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind inflation: headline,
            core, classification, diffusion or group (all: every family). kind
            expectations: the Focus survey, annual (the default), monthly, selic
            (COPOM meetings) or inflation_12m. Default: all.
          schema:
            type: string
            enum:
              - all
              - headline
              - core
              - classification
              - diffusion
              - group
              - annual
              - monthly
              - selic
              - inflation_12m
            default: all
        - name: currency
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind fx: an ISO code held
            (USD, EUR, GBP, JPY, ARS). all: every currency, from the
            api.ptax_daily view (paged with order + limit + offset). Default:
            USD.
          schema:
            type: string
            default: USD
        - name: horizon
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind expectations: one
            target horizon per call. Use a single YYYY for annual, MM/YYYY for
            monthly, or a meeting code such as R6/2028 for selic. from and to
            filter survey dates, not target dates. Default: family annual: the
            current year (UTC-3); every other survey needs one.
          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.