# IBGE service data API · Agregados

Get market and financial data with IBGE service data API · Agregados from Alexandria through one Spiral API key. 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. It runs in the background and returns structured JSON. Pay as you go, with no subscription.

- Provider: Alexandria
- Category: Finance
- Runs: In the background
- Returns: json
- Tool id: `alexandria` / `servicodados-ibge-gov-br/official-statistics/agregados`
- Page: https://spiral.ai/tools/alexandria/servicodados-ibge-gov-br/official-statistics/agregados

## Pricing

$0.00873 per call.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 5 minutes
- Longest run, end to end: 225 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `limit` | number | 1 to 500 | 50 | Rows per page (default 50). |
| `nivel` | text |  | — | Territorial level the table must offer: N1 Brazil, N2 macro-region, N3 UF, N6 municipality... Pattern: ^N[0-9]{1,3}$. |
| `query` | text |  | — | Substring matched (case- and accent-insensitive) against the table name or the survey name, e.g. `ipca`, `populacao residente estimada`. |
| `offset` | number | 0 to … | — | next_offset from the previous page. |
| `assunto` | number | 1 to … | — | Subject id (e.g. 148). See the agregados docs for the list. |
| `periodo` | text |  | — | Period the table must cover (e.g. 2024 or 202401). Pattern: ^[0-9]{4,6}$. |
| `classificacao` | number | 1 to … | — | Classification id the table must carry. |
| `periodicidade` | text |  | — | Periodicity code: P1 annual, P5 monthly, P8 quarterly, P13 census... Pattern: ^P[0-9]{1,2}$. |

## Example

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "servicodados-ibge-gov-br/official-statistics/agregados",
    "input": {
      "limit": 50
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=alexandria&model=servicodados-ibge-gov-br%2Fofficial-statistics%2Fagregados

## Common questions

### IBGE service data API · Agregados

**How much does IBGE service data API · Agregados cost?**

$0.00873 per call. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use IBGE service data API · Agregados through an API?**

Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "servicodados-ibge-gov-br/official-statistics/agregados"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with Alexandria to use IBGE service data API · Agregados?**

No. Spiral runs it on its own Alexandria account and charges your Spiral balance.

**Can my AI agent use IBGE service data API · Agregados?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

