TL;DR
The Brazilian Central Bank (BACEN) provides a free API for economic time series data through its SGS (Sistema Gerenciador de Séries) system. Access thousands of economic indicators including the SELIC interest rate, IPCA inflation, exchange rates, GDP data, and industrial production. Each series has a unique ID number — for example, series 20716 is the IGP-M inflation index. Data is available in JSON and XML formats, dating back decades. No API key is required.
Quick start: https://api.bcb.gov.br/dados/serie/bcdata.sgs.20716/dados/ultimos/10?formato=json
No API key needed — just make a request!
How to Use This API
1. Latest 10 Values of IGP-M Inflation Index
https://api.bcb.gov.br/dados/serie/bcdata.sgs.20716/dados/ultimos/10?formato=json
2. SELIC Interest Rate (Series 11)
https://api.bcb.gov.br/dados/serie/bcdata.sgs.11/dados/ultimos/30?formato=json
3. USD Exchange Rate (Series 1)
https://api.bcb.gov.br/dados/serie/bcdata.sgs.1/dados/ultimos/5?formato=json
4. JavaScript — Plot SELIC History
fetch('https://api.bcb.gov.br/dados/serie/bcdata.sgs.11/dados/ultimos/60?formato=json')
.then(r => r.json())
.then(data => {
data.forEach(d => {
console.log(`${d.data}: ${d.valor}%`);
});
});
5. Python — Date Range Query
import requests
from datetime import datetime, timedelta
end = datetime.now()
start = end - timedelta(days=365)
params = {
'dataInicial': start.strftime('%d/%m/%Y'),
'dataFinal': end.strftime('%d/%m/%Y'),
'formato': 'json'
}
data = requests.get(
'https://api.bcb.gov.br/dados/serie/bcdata.sgs.433/dados',
params=params
).json()
print(f"IPCA inflation from {start.date()} to {end.date()}:")
for entry in data:
print(f"{entry['data']}: {entry['valor']}%")
https://api.bcb.gov.br/dados/serie/bcdata.sgs.20716/dados/ultimos/10?formato=json
Frequently Asked Questions
- How do I find the series ID for a specific indicator?
- Search the SGS system at
https://www3.bcb.gov.br/sgspubto find series. Common IDs: 1 (USD), 11 (SELIC), 433 (IPCA), 20716 (IGP-M), 243 (Industrial Production). - What date formats does the API accept?
- Dates use the Brazilian format
DD/MM/YYYY. For the date range endpoint, usedataInicialanddataFinalparameters. - What output formats are available?
- Use
?formato=jsonfor JSON or?formato=xmlfor XML. JSON is recommended for modern applications. - How far back does the data go?
- Some series go back decades. The SELIC rate series starts in the 1990s, while other indicators may have data starting in the 1980s or earlier.
- Is there a rate limit?
- BCB's API is public Brazilian government data with no documented rate limits. Reasonable usage is expected.
- Can I use this commercially?
- Yes. All data from the Brazilian Central Bank is public and freely available for any purpose, including commercial applications.
API Details
- API URL
https://api.bcb.gov.br/dados/serie/bcdata.sgs.{id}/dados- Documentation
- dadosabertos.bcb.gov.br
- Category
- Finance
- Authentication
- Not Required
- Geographic Coverage
- Brazil (BR) — Brazilian economic indicators
What You Can Build
- Brazilian economic dashboard tracking SELIC, IPCA, and exchange rates
- Inflation calculator using official IPCA historical data
- Investment return comparator — SELIC vs CDI vs inflation
- Currency converter using official BCB exchange rates
- Economic calendar that highlights BCB monetary policy meetings