# Brazil Central Bank Data — USD/BRL, Selic, CDI & IPCA (`alauddinburki/bcb-sgs-data`) Actor

Banco Central do Brasil SGS series as clean rows: USD/BRL and EUR/BRL PTAX, Selic, CDI, IPCA and IGP-M inflation, IBC-Br and thousands more, by date. Any range, split automatically. No key.

- **URL**: https://apify.com/alauddinburki/bcb-sgs-data.md
- **Developed by:** [Alauddin burki](https://apify.com/alauddinburki) (community)
- **Categories:** Business, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil Central Bank Data — USD/BRL, Selic, CDI & IPCA

Get **Banco Central do Brasil** time series from its official SGS API as clean rows, one per **series and date**,
with ISO dates and numeric values. Pick from the checked series below, or give any other SGS series number:

| Series | What it holds |
|---|---|
| 1 | USD/BRL exchange rate (PTAX, selling), daily |
| 21619 | EUR/BRL exchange rate (PTAX, selling), daily |
| 432 | Selic target rate (% a year), daily |
| 11 | Selic rate (% a day), daily |
| 4389 | CDI rate annualised (% a year), daily |
| 433 | IPCA inflation (% a month), monthly |
| 13522 | IPCA inflation over 12 months (%), monthly |
| 189 | IGP-M inflation (% a month), monthly |
| 24364 | IBC-Br economic activity index, seasonally adjusted, monthly |

The Central Bank limits daily series to 10 years per request. The actor **splits long ranges automatically**, so
2010 to today is a single run. No key is needed.

### Use it for

- **Finance teams and importers:** a daily PTAX rate feed for accounting and invoicing.
- **Investors and analysts:** Selic, CDI and inflation as clean series for models and dashboards.

### Input examples

```json
{ "series": ["1", "432", "13522"], "startDate": "2026-01-01" }
```

```json
{ "series": ["1"], "startDate": "2010-01-01" }
```

```json
{ "series": ["4389", "433"], "latest": 3 }
```

### Output

| Field | Example |
|---|---|
| `series`, `seriesName` | 1 · USD/BRL exchange rate (PTAX, selling), daily |
| `date`, `value` | 2026-11-19 · 5.8889 |

The run's `SUMMARY` lists series that returned no data, such as a wrong number.

### Pricing

Pay per result: **$0.0005 per row**. Plus a start fee of $0.0001 per GB of allocated memory (minimum one event).

### Verification status (2026-11-19, local)

- ✅ 3 unit tests on live fixtures:
  - 10-year window splitting and latest-N;
  - ISO dates;
  - numeric rows with series names.
- ✅ Live runs:
  - **USD/BRL, Selic target and IPCA 12-month since 2026-09, plus a fake series** → 137 rows. The fake series was reported.
  - **Daily USD/BRL 2010–2026** → 4,240 rows, split into windows automatically.
  - **Latest 3 values of CDI and monthly IPCA** → 6 rows.
  - 0 schema mismatches.
- The values were checked against what each series should hold on the day (for example USD/BRL 5.89, Selic 13.75%, IPCA 12-month 4.63%).

# Actor input Schema

## `series` (type: `array`):

Which series to get.

## `otherSeries` (type: `array`):

Any other SGS number (find them in the BCB's SGS search).

## `startDate` (type: `string`):

YYYY-MM-DD. Default: one year ago.

## `endDate` (type: `string`):

YYYY-MM-DD. Default: today.

## `latest` (type: `integer`):

Only the newest N values of each series (max 20; overrides From/To).

## `maxItems` (type: `integer`):

Stop after this many.

## Actor input object example

```json
{
  "series": [
    "1",
    "432",
    "13522"
  ],
  "startDate": "2026-01-01",
  "maxItems": 100000
}
```

# Actor output Schema

## `results` (type: `string`):

Every row of the run, in the dataset (fields as listed under Output in the README).

## `summary` (type: `string`):

Counts, items not found and other notes for the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "series": [
        "1",
        "432",
        "13522"
    ],
    "startDate": "2026-01-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("alauddinburki/bcb-sgs-data").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "series": [
        "1",
        "432",
        "13522",
    ],
    "startDate": "2026-01-01",
}

# Run the Actor and wait for it to finish
run = client.actor("alauddinburki/bcb-sgs-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "series": [
    "1",
    "432",
    "13522"
  ],
  "startDate": "2026-01-01"
}' |
apify call alauddinburki/bcb-sgs-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alauddinburki/bcb-sgs-data"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ycnq39smi6Lwr4fXQ/builds/tUCUiQnjv2oE3Ecdh/openapi.json
