> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Agregados

> Find the agregado id (and then, with agregado_metadados, the variable and classification ids) before calling agregado_dados. Pass a query or at least one filter: the unfiltered catalog has ~8,000 tables. Rows carry only id and name (no period), and a query like `domicilios` with nivel N6 matches hundreds of Census tables ordered by id, so for the headline municipal population / household counts skip the search and call agregado_dados directly with 4709 (Census 2022 population), 4712 (Census 2022 occupied households and residents) or 6579 (yearly population estimates).

## Request contract

* **Method and path:** POST /apis/v1/servicodados-ibge-gov-br/official-statistics/agregados
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregados`

[Complete OpenAPI definition](https://aisa.one/docs/openapi/servicodados-ibge-gov-br.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "servicodados-ibge-gov-br.official-statistics.agregados",
  "method": "POST",
  "path": "/apis/v1/servicodados-ibge-gov-br/official-statistics/agregados",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "examples": {
          "provider": {
            "summary": "Official provider example; checked against AIsa request constraints",
            "value": {
              "assunto": 148,
              "limit": 5,
              "query": "tarifa minima"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "assunto": {
              "description": "Subject id (e.g. 148). See the agregados docs for the list.\n\nProvider reference: minimum 1.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "min": 1
              }
            },
            "classificacao": {
              "description": "Classification id the table must carry.\n\nProvider reference: minimum 1.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "min": 1
              }
            },
            "limit": {
              "default": 50,
              "description": "Rows per page (default 50).\n\nProvider reference: minimum 1; maximum 500; default 50.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "max": 500,
                "min": 1
              }
            },
            "nivel": {
              "description": "Territorial level the table must offer: N1 Brazil, N2 macro-region, N3 UF, N6 municipality... Pattern: ^N[0-9]{1,3}$.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "offset": {
              "description": "next_offset from the previous page.\n\nProvider reference: minimum 0.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "min": 0
              }
            },
            "periodicidade": {
              "description": "Periodicity code: P1 annual, P5 monthly, P8 quarterly, P13 census... Pattern: ^P[0-9]{1,2}$.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "periodo": {
              "description": "Period the table must cover (e.g. 2024 or 202401). Pattern: ^[0-9]{4,6}$.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "query": {
              "description": "Substring matched (case- and accent-insensitive) against the table name or the survey name, e.g. `ipca`, `populacao residente estimada`.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            }
          },
          "type": "object"
        }
      }
    },
    "required": false
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## Cost and request rules

Usage-based pricing. Default request estimate: \$0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.


## OpenAPI

````yaml openapi/servicodados-ibge-gov-br.json POST /apis/v1/servicodados-ibge-gov-br/official-statistics/agregados
openapi: 3.1.0
info:
  description: ''
  title: IBGE service data API
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    servicodados-ibge-gov-br:
      description: ''
      title: IBGE service data API
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 518fc4ef947cdae694909b6b92a592a19c91435c3047395d9357e9329503c138
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-metadados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/agregados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/calendario
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/cnae
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/localidade
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/localidades
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/malha
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/nomes
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/nomes-ranking
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/noticias
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/paises
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:384fbccd466b93a5e759ab66f0bb4bd9d7246110b99aeaf8b08945bfa155d106
    facts_hash: 518fc4ef947cdae694909b6b92a592a19c91435c3047395d9357e9329503c138
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: servicodados-ibge-gov-br
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/servicodados-ibge-gov-br/official-statistics/agregados:
    post:
      tags:
        - IBGE service data API
      summary: Agregados
      description: >-
        Find the agregado id (and then, with agregado_metadados, the variable
        and classification ids) before calling agregado_dados. Pass a query or
        at least one filter: the unfiltered catalog has ~8,000 tables. Rows
        carry only id and name (no period), and a query like `domicilios` with
        nivel N6 matches hundreds of Census tables ordered by id, so for the
        headline municipal population / household counts skip the search and
        call agregado_dados directly with 4709 (Census 2022 population), 4712
        (Census 2022 occupied households and residents) or 6579 (yearly
        population estimates).
      operationId: servicodados-ibge-gov-br.official-statistics.agregados
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  assunto: 148
                  limit: 5
                  query: tarifa minima
            schema:
              additionalProperties: true
              properties:
                assunto:
                  description: |-
                    Subject id (e.g. 148). See the agregados docs for the list.

                    Provider reference: minimum 1.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    min: 1
                classificacao:
                  description: |-
                    Classification id the table must carry.

                    Provider reference: minimum 1.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    min: 1
                limit:
                  default: 50
                  description: |-
                    Rows per page (default 50).

                    Provider reference: minimum 1; maximum 500; default 50.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    max: 500
                    min: 1
                nivel:
                  description: >-
                    Territorial level the table must offer: N1 Brazil, N2
                    macro-region, N3 UF, N6 municipality... Pattern:
                    ^N[0-9]{1,3}$.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                offset:
                  description: |-
                    next_offset from the previous page.

                    Provider reference: minimum 0.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    min: 0
                periodicidade:
                  description: >-
                    Periodicity code: P1 annual, P5 monthly, P8 quarterly, P13
                    census... Pattern: ^P[0-9]{1,2}$.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                periodo:
                  description: >-
                    Period the table must cover (e.g. 2024 or 202401). Pattern:
                    ^[0-9]{4,6}$.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                query:
                  description: >-
                    Substring matched (case- and accent-insensitive) against the
                    table name or the survey name, e.g. `ipca`, `populacao
                    residente estimada`.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-09-22.
                  summary: Official provider example
                  value:
                    count: 3
                    items:
                      - id: '1367'
                        nome: >-
                          Número de municípios, total e os que estabelecem
                          tarifa mínima para consumo de água, por faixa de
                          volume de consumo
                        pesquisa_id: SB
                        pesquisa_nome: Pesquisa Nacional de Saneamento Básico
                        url: https://sidra.ibge.gov.br/tabela/1367
                      - id: '1788'
                        nome: >-
                          Número de distritos cujas entidades prestadoras de
                          serviço de abastecimento de água estabelecem tarifa
                          mínima para consumo, por faixa de volume de consumo
                        pesquisa_id: SB
                        pesquisa_nome: Pesquisa Nacional de Saneamento Básico
                        url: https://sidra.ibge.gov.br/tabela/1788
                      - id: '7474'
                        nome: >-
                          Municípios com serviço de abastecimento de água por
                          rede geral de distribuição em funcionamento, com
                          cobrança de tarifa mínima mensal para a categoria
                          residencial e valor médio da tarifa mínima mensal da
                          água para categoria residencial, por volume do consumo
                          mensal referente à tarifa mínima
                        pesquisa_id: SB
                        pesquisa_nome: Pesquisa Nacional de Saneamento Básico
                        url: https://sidra.ibge.gov.br/tabela/7474
                    next_offset: null
                    observed_at_ms: 1790046995075
                    source_url: >-
                      https://servicodados.ibge.gov.br/api/v3/agregados?assunto=148
                    total: 3
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            Discover SIDRA tables (agregados) from the /api/v3/agregados
            catalog: filter server-side by assunto, periodicidade (P1 P5 P8
            ...), nivel (N1 N3 N6 ...), periodo and classificacao, and
            client-side by a case/accent-insensitive text query over the table
            name and survey name. Returns flat rows {id, nome, pesquisa_id,
            pesquisa_nome} sliced with limit / offset.


            The response contains the tool result directly.


            The provider identifies `items` as the primary payload key.


            | Documented field | Provider type | Description |

            | --- | --- | --- |

            | `id` | string | Agregado (SIDRA table) id. |

            | `nome` | string |  |

            | `pesquisa_id` | string | Survey code, e.g. IP for IPCA. |

            | `pesquisa_nome` | string |  |

            | `url` | string | sidra.ibge.gov.br table page. |



            These are the provider's documented fields. Field requiredness,
            nullability and nested object structures are specified only where
            the descriptions explicitly say so.
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

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