# Banco Central do Brasil open data · Sgs series

Get market and financial data with Banco Central do Brasil open data · Sgs series from Alexandria through one Spiral API key. Get the numbers for a known SGS code. Find codes with `datasets_search` (CKAN `codigo_sgs`). 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` / `bcb-gov-br/economic-data/sgs_series`
- Page: https://spiral.ai/tools/alexandria/bcb-gov-br/economic-data/sgs_series

## 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 |
| --- | --- | --- | --- | --- |
| `codigo` (required) | number | 1 to … | — | SGS series code (e.g. 432), or a pasted https://api.bcb.gov.br/dados/serie/bcdata.sgs.<code>/... URL; the URL's own `/ultimos/N` or `dataInicial`/`dataFinal` apply unless `ultimos`/`data_inicial`/`data_final` are given. |
| `ultimos` | number | 1 to 20 | — | Return only the last N observations (server maximum 20). Mutually exclusive with the date window. |
| `data_final` | text |  | — | Last observation date (inclusive), YYYY-MM-DD. Defaults to today on the server. At most 10 years after `data_inicial`. Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
| `data_inicial` | text |  | — | First observation date (inclusive), YYYY-MM-DD. Required by the server for daily series. Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{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": "bcb-gov-br/economic-data/sgs_series",
    "input": {
      "codigo": 1
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=alexandria&model=bcb-gov-br%2Feconomic-data%2Fsgs_series

## Common questions

### Banco Central do Brasil open data · Sgs series

**How much does Banco Central do Brasil open data · Sgs series 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 Banco Central do Brasil open data · Sgs series through an API?**

Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "bcb-gov-br/economic-data/sgs_series"` 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 Banco Central do Brasil open data · Sgs series?**

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

**Can my AI agent use Banco Central do Brasil open data · Sgs series?**

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

