BYTETOOLS

Banco Central do Brasil SGS API

Free Banco Central do Brasil SGS API with no key: Selic rate, IPCA inflation, CDI and thousands of other Brazilian economic time series by series code. Tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Banco Central do Brasil SGS API?

The Banco Central do Brasil's SGS system exposes thousands of Brazilian economic time series through a free JSON API with no key. Each series has a numeric code — 432 is the Selic target, 433 is IPCA — and returns dated values.

SGS is the backbone of Brazilian economic data: the Selic policy rate, the CDI, IPCA and IGP-M inflation, credit aggregates, the trade balance and several thousand more series all live behind one URL pattern where only the numeric code changes. Once you have a code, the integration is a single GET, and codes are stable over decades.

Two things about the response are specific to this API and matter. Values arrive as strings with a dot decimal separator, while dates arrive as `DD/MM/YYYY` — Brazilian order, so `12/09/2026` is September, not December. And the Selic target series is published forward: because the target holds until the next Copom meeting, `ultimos/5` can legitimately return dates in the future. Do not treat that as corrupt data, and do not let a chart draw them as history.

Quick facts

Base URL
https://api.bcb.gov.br/dados/serie
Authentication
No key or registration required.
Rate limit
No documented limit, but very large date ranges can time out. Request in chunks of a few years.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Banco Central do Brasil SGS API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Last five values of the Selic target rate (series 432)

GET https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados/ultimos/5?formato=json

curl
curl 'https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados/ultimos/5?formato=json'
JavaScript (fetch)
const res = await fetch("https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados/ultimos/5?formato=json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados/ultimos/5?formato=json", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
[
  {
    "data": "12/09/2026",
    "valor": "14.00"
  },
  {
    "data": "13/09/2026",
    "valor": "14.00"
  },
  {
    "data": "14/09/2026",
    "valor": "14.00"
  },
  {
    "data": "15/09/2026",
    "valor": "14.00"
  },
  {
    "data": "16/09/2026",
    "valor": "14.00"
  }
]

Parameters

ParameterTypeRequiredDescription
bcdata.sgs.{code}path segmentRequiredNumeric SGS series code. 432 is the Selic target, 433 IPCA, 12 CDI, 1 the USD/BRL rate. bcdata.sgs.432
ultimos/{n}path segmentOptionalReturn only the last N observations. ultimos/5
dataInicial / dataFinalqueryOptionalDate window in `DD/MM/YYYY`. Note the Brazilian component order. 01/01/2026
formatoqueryOptional`json` or `csv`. Defaults to a browser-oriented HTML view. json

Response fields

datastring
Observation date as `DD/MM/YYYY` — day first, so `12/09/2026` is 12 September.
valorstring
The observation, returned as a string with a dot decimal separator. Parse before arithmetic.
datafimstring
Present on some period-based series to mark the end of the reference period.

What you can build with the Banco Central do Brasil SGS API

  • Display the current Selic policy rate on a Brazilian finance page
  • Chart IPCA inflation over any historical window
  • Feed CDI values into an interest calculation for Brazilian instruments
  • Pull the official USD/BRL series alongside PTAX for comparison

Common errors and how to fix them

HTML instead of JSON

`formato=json` was omitted.

Fix: The default response is an HTML page for browser users. Always send `formato=json`.

404 or empty array

Unknown series code, or a window with no observations.

Fix: Look the code up in the SGS catalogue. Codes are numeric and stable; names are not searchable through this endpoint.

Timeout on a long range

A multi-decade window on a daily series is too large.

Fix: Split the request into chunks of a few years and concatenate, or use `ultimos/{n}` when you only need recent values.

Dates in the future

Not an error for policy-rate series.

Fix: The Selic target is published forward to the next Copom meeting. Filter to today if your chart should stop there.

Banco Central do Brasil SGS API — frequently asked questions

Is the BCB SGS API free and key-free?

Yes. It needs no key, no account and no headers, and serves thousands of Brazilian economic series as JSON or CSV.

What is series 432?

Series 432 is the Selic target rate set by the Copom, expressed as an annual percentage. Series 11 carries the realised daily Selic and series 12 the CDI, which are related but not identical.

Why do dates look wrong in my chart?

The `data` field is `DD/MM/YYYY`, so `12/09/2026` means 12 September. A parser assuming US ordering will silently produce December and reorder your series.

Why does the Selic series contain future dates?

The target rate holds until the next Copom meeting, so the BCB publishes it forward as a daily series to that date. Those rows are the current decision projected ahead, not a forecast of a future decision.

Tools that pair with this API

Banco Central do Brasil SGS is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.