# Banco Central do Brasil API
> Live official Brazilian monetary and FX data, served straight from the Central Bank of Brazil's open SGS and PTAX APIs — no key, nothing cached. Brazil is the largest economy in Latin America and one of the highest-yielding major markets, and this exposes its headline numbers as clean JSON. The indicators endpoint returns the whole dashboard in one call: the Selic policy target rate set by the Copom, the CDI interbank rate, IPCA monthly and 12-month inflation, and the official USD/BRL and EUR/BRL PTAX exchange rates — in mid-2026 Selic sat at 14.50%, 12-month IPCA near 4.4% and the dollar around 5.17 reais. The selic endpoint returns the policy rate the Central Bank uses to steer the economy, with recent history. The inflation endpoint returns IPCA, Brazil's official consumer price index, both monthly and accumulated over twelve months. The exchange endpoint returns the official PTAX USD/BRL and EUR/BRL closing rates with recent history. The series endpoint exposes any of the thousands of time series in the Central Bank's SGS database by its numeric code, so you can pull Brazilian interest rates, prices, credit and monetary aggregates on demand. Everything is the Central Bank's own published data, live, nothing stored. This is the Brazil rates-and-FX layer for any fixed-income, forex, emerging-markets or macro app. Distinct from the ECB, Fed, Bank of Canada, Norges Bank and Bank of England APIs — this is Brazil's Selic, IPCA and the real. 6 endpoints, no key on our side.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/bcb-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 2 req/s
- **Starter** ($10/Mo) — 20,000 calls/Mo, 6 req/s
- **Pro** ($27/Mo) — 120,000 calls/Mo, 15 req/s
- **Mega** ($64/Mo) — 700,000 calls/Mo, 40 req/s

## Endpoints

### Brazil

#### `GET /v1/exchange` — PTAX USD/BRL and EUR/BRL

**Parameters:**
- `history` (query, optional, string) — Days of USD/BRL history (default 20) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/exchange?history=10"
```

**Response:**
```json
{
    "data": {
        "base": "BRL",
        "source": "Banco Central do Brasil (PTAX)",
        "eur_brl": {
            "date": "2026-06-08",
            "rate": 5.9682
        },
        "usd_brl": {
            "date": "2026-06-08",
            "rate": 5.1695
        },
        "usd_brl_history": [
            {
                "date": "2026-05-25",
                "rate": 5.0072
            },
            {
                "date": "2026-05-26",
                "rate": 5.0211
            },
            {
                "date": "2026-05-27",
                "rate": 5.0579
            },
            {
                "date": "2026-05-28",
                "rate": 5.0517
            },
            {
                "date": "2026-05-29",
                "rate": 5.0569
            },
            {
                "date": "2026-06-01",
                "rate": 5.0303
            },
            {
                "date": "2026-06-02",
                "rate": 5.016
            },
            {
                "date": "2026-06-03",
                "rate": 5.0415
            },
            {
                "date": "2026-06-05",
                "rate": 5.1244
            },
            {
                "date": "2026-06-08",
                "rate": 5.1695
            }
        ],
        "quote_convention": "1 USD / 1 EUR in BRL (PTAX sell)"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:29.580Z",
        "request_id": "a074e72d-010a-400e-9cc5-657462d1697d"
    },
    
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/indicators` — Headline dashboard

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/indicators"
```

**Response:**
```json
{
    "data": {
        "source": "Banco Central do Brasil",
        "country": "Brazil",
        "eur_brl": {
            "date": "2026-06-08",
            "value": 5.9682
        },
        "usd_brl": {
            "date": "2026-06-08",
            "value": 5.1695
        },
        "currency": "BRL",
        "ipca_12m_pct": {
            "date": "2026-04-01",
            "value": 4.39
        },
        "cdi_daily_pct": {
            "date": "2026-06-05",
            "value": 0.0534
        },
        "ipca_month_pct": {
            "date": "2026-04-01",
            "value": 0.67
        },
        "selic_target_pct": {
            "date": "2026-06-17",
            "value": 14.5
        }
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:31.003Z",
        "request_id": "9c7661db-9976-4c95-923b-9ee33388f62f"
    },
    "status": "ok",
    "message": "Indicators retrieved successfully",
    "success": true
}
```

#### `GET /v1/inflation` — IPCA inflation

**Parameters:**
- `history` (query, optional, string) — Number of past months (default 12) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/inflation?history=6"
```

**Response:**
```json
{
    "data": {
        "unit": "%",
        "month": "2026-04-01",
        "source": "Banco Central do Brasil",
        "history": [
            {
                "date": "2025-11-01",
                "month_pct": 0.18
            },
            {
                "date": "2025-12-01",
                "month_pct": 0.33
            },
            {
                "date": "2026-01-01",
                "month_pct": 0.33
            },
            {
                "date": "2026-02-01",
                "month_pct": 0.7
            },
            {
                "date": "2026-03-01",
                "month_pct": 0.88
            },
            {
                "date": "2026-04-01",
                "month_pct": 0.67
            }
        ],
        "indicator": "IPCA — Brazil official consumer price index",
        "month_pct": 0.67,
        "accumulated_12m_pct": 4.39,
        "accumulated_12m_date": "2026-04-01"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:31.542Z",
        "request_id": "20bf6d3a-73b3-4e70-8fe8-61bb7e1967f4"
    },
    "status": "ok",
    "message": "Inflation retrieved successfully",
    "success": true
}
```

#### `GET /v1/selic` — Selic policy target rate

**Parameters:**
- `history` (query, optional, string) — Number of past values (default 12) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/selic?history=6"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-17",
        "unit": "% per year",
        "source": "Banco Central do Brasil",
        "history": [
            {
                "date": "2026-06-12",
                "rate_pct": 14.5
            },
            {
                "date": "2026-06-13",
                "rate_pct": 14.5
            },
            {
                "date": "2026-06-14",
                "rate_pct": 14.5
            },
            {
                "date": "2026-06-15",
                "rate_pct": 14.5
            },
            {
                "date": "2026-06-16",
                "rate_pct": 14.5
            },
            {
                "date": "2026-06-17",
                "rate_pct": 14.5
            }
        ],
        "rate_pct": 14.5,
        "indicator": "Selic — Brazil policy target rate (Copom)"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:32.085Z",
        "request_id": "862e0e5b-9a01-4eb0-a4be-78546025b9e1"
    },
    "status": "ok",
    "message": "Selic retrieved successfully",
    "success": true
}
```

#### `GET /v1/series` — Any SGS time series by code

**Parameters:**
- `code` (query, required, string) — Numeric SGS series code Example: `433`
- `n` (query, optional, string) — Number of observations (default 12, max 1000) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/series?code=433&n=6"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "latest": {
            "date": "2026-04-01",
            "value": 0.67
        },
        "source": "Banco Central do Brasil — SGS",
        "sgs_code": 433,
        "observations": [
            {
                "date": "2025-11-01",
                "value": 0.18
            },
            {
                "date": "2025-12-01",
                "value": 0.33
            },
            {
                "date": "2026-01-01",
                "value": 0.33
            },
            {
                "date": "2026-02-01",
                "value": 0.7
            },
            {
                "date": "2026-03-01",
                "value": 0.88
            },
            {
                "date": "2026-04-01",
                "value": 0.67
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:32.453Z",
        "request_id": "261fce0a-f494-43e0-b85b-fc3b0018952b"
    },
    "status": "ok",
    "message": "Series retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcb-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "Banco Central do Brasil — SGS + PTAX (live)",
        "service": "bcb-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/selic": "Selic policy target rate + history (history=N).",
            "GET /v1/series": "Any SGS time series by code (code=433, n=).",
            "GET /v1/exchange": "Official PTAX USD/BRL and EUR/BRL + USD/BRL history.",
            "GET /v1/inflation": "IPCA monthly + 12-month accumulated + history.",
            "GET /v1/indicators": "Headline dashboard in one call: Selic, CDI, IPCA, USD/BRL, EUR/BRL."
        },
        "description": "Live official Brazilian monetary and FX data from the Central Bank of Brazil's open SGS and PTAX APIs: a one-call indicators dashboard (Selic target, CDI, IPCA monthly and 12-month, USD/BRL and EUR/BRL); the Selic policy rate with history; IPCA inflation monthly and accumulated over twelve months; the official PTAX USD/BRL and EUR/BRL closing rates with history; and any of the thousands of SGS time series by code. Live, no key, nothing stored. Distinct from the ECB, Fed, Bank of Canada, Norges Bank and Bank of England APIs — this is Brazil's Selic, IPCA and the real.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-09T11:38:32.847Z",
        "request_id": "03e54084-3681-4944-87dc-09cc7e9d1187"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/bcb-api
OpenAPI spec: https://www.oanor.com/api/bcb-api/openapi.json
