# Brazil Selic Interest Rate Scraper (`automation-lab/brazil-selic-rate-history`) Actor

Export official Banco Central do Brasil Selic target and effective rate observations by date for dashboards, models, monitoring, and data pipelines.

- **URL**: https://apify.com/automation-lab/brazil-selic-rate-history.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.44 / 1,000 observation extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Brazil Selic Interest Rate Scraper

Export official Banco Central do Brasil (BCB) Selic target and effective rate observations as structured data.

This Actor turns the official BCB SGS time series into clean records for recurring economic analysis, dashboards, financial models, spreadsheets, and alerts.

It uses the public BCB JSON API directly.
No API key, browser, login, or proxy is required.

### What does this Actor do?

Brazil Selic Interest Rate Scraper retrieves one or more official series:

- Selic target rate, BCB series 432
- annualized effective Selic rate, BCB series 1178
- daily effective Selic rate, BCB series 11

Choose the latest observation or a historical date range.
Results include normalized ISO dates, numeric rates, units, series identity, and an official source URL.

The default run exports the target and annualized effective series for the last 30 days.

### Who is it for?

Use this Actor if you are:

- a finance analyst refreshing a Brazil rates dashboard
- an economist comparing target and effective monetary-policy rates
- a data engineer loading BCB observations into a warehouse
- a risk team monitoring rate changes
- a researcher building a time-series dataset
- a developer integrating official Selic data into an application

The Actor is focused on Selic observations.
It does not calculate bond prices, loan payments, inflation, forecasts, or investment recommendations.

### Why use it?

The BCB API returns dates in Brazilian format and values as strings.
This Actor handles normalization and operational details for you:

- stable names for three commonly used Selic series
- ISO `YYYY-MM-DD` observation dates
- numeric rate values
- explicit annual or daily units
- latest-only and historical modes
- bounded retries for temporary upstream failures
- deterministic maximum-result limits
- Apify datasets, schedules, webhooks, API, and integrations

Every saved observation retains its official request URL for provenance.

### What Brazil Selic interest rate data can I extract?

| Field | Meaning |
| --- | --- |
| `observationDate` | Official observation date in `YYYY-MM-DD` format |
| `rate` | Numeric value reported by BCB |
| `unit` | `% per year` or `% per day` |
| `seriesType` | `target`, `effectiveAnnual`, or `effectiveDaily` |
| `seriesName` | Human-readable series name |
| `seriesCode` | Official BCB SGS numeric code |
| `frequency` | Source observation frequency |
| `isLatest` | Whether the row is newest for its series in the source response |
| `source` | `Banco Central do Brasil` |
| `sourceUrl` | Exact official API request used |
| `fetchedAt` | UTC retrieval timestamp |

All dataset schema fields are nullable so downstream exports remain resilient to source changes.
The Actor still validates critical dates and rate values before saving a row.

### Getting started

1. Open the Actor input page.
2. Select one or more Selic series.
3. Enable **Latest observations only** for current values, or provide a date range.
4. Choose a maximum number of observations.
5. Select newest-first or oldest-first sorting.
6. Click **Start**.
7. Open the **Dataset** tab to preview or download results.

For recurring monitoring, create an Apify schedule after confirming your input.
Use a webhook or integration to deliver each completed dataset downstream.

### Input parameters

#### `series`

An array containing one or more supported values.
Defaults to `target` and `effectiveAnnual`.
Duplicate values are rejected.

#### `latestOnly`

When `true`, requests the latest available observation for each selected series.
Do not combine this option with `startDate` or `endDate`.

#### `startDate`

First historical observation date, inclusive, in `YYYY-MM-DD` format.
When omitted in historical mode, it defaults to 30 days before the run.

#### `endDate`

Last historical observation date, inclusive, in `YYYY-MM-DD` format.
When omitted in historical mode, it defaults to the current run date.

#### `maxItems`

Maximum total observations saved across all selected series.
The allowed range is 1–10,000 and the default is 100.

#### `sort`

Use `descending` for newest observations first or `ascending` for oldest observations first.
The default is `descending`.

### Input examples

Latest target and effective annual rates:

```json
{
  "series": ["target", "effectiveAnnual"],
  "latestOnly": true,
  "maxItems": 2,
  "sort": "descending"
}
```

Historical target rate:

```json
{
  "series": ["target"],
  "startDate": "2026-09-01",
  "endDate": "2026-09-08",
  "maxItems": 20,
  "sort": "ascending"
}
```

Target versus effective rate dataset:

```json
{
  "series": ["target", "effectiveAnnual"],
  "startDate": "2025-09-01",
  "endDate": "2026-09-08",
  "maxItems": 1000,
  "sort": "ascending"
}
```

### Output example

A historical target-rate row looks like this:

```json
{
  "observationDate": "2026-09-04",
  "rate": 14,
  "unit": "% per year",
  "seriesType": "target",
  "seriesName": "Selic target rate",
  "seriesCode": 432,
  "frequency": "daily",
  "isLatest": false,
  "source": "Banco Central do Brasil",
  "sourceUrl": "https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados?formato=json&dataInicial=01%2F09%2F2026&dataFinal=08%2F09%2F2026",
  "fetchedAt": "2026-09-08T12:00:00.000Z"
}
```

Results are stored in the run's default dataset.
Download them as JSON, CSV, Excel, XML, or RSS through Apify.

### How much does it cost to export Brazil Selic rate observations?

Pay-per-event pricing has two parts:

- a one-time `$0.005` start charge per run
- one `observation` event for each dataset row

The exact tier price is shown in Apify Console before a run.
At the BRONZE tier, 100 observations cost the start fee plus 100 observation events.
At higher plan tiers, per-observation prices decrease according to the displayed pricing curve.

The Actor never charges an observation event for an invalid, duplicate, empty, or failed record.
A no-result historical query incurs only the start event.

### Monitoring and data-pipeline workflows

#### Rate-change monitoring

Schedule `latestOnly` runs daily.
Compare the new dataset with the previous run in your storage or automation tool.
Trigger a notification when `rate` changes for the target series.

#### Dashboard refresh

Request a rolling historical window in ascending order.
Send the dataset to Google Sheets, Airtable, Make, Zapier, or your warehouse.
Use `seriesCode` and `observationDate` as a compound key.

#### Financial-model input

Export target and effective annual rates together.
Keep `seriesType` as the dimension and `rate` as the numeric measure.
Use `sourceUrl` and `fetchedAt` for auditability.

#### Backfill

Choose a fixed historical range and a sufficiently high `maxItems`.
The Actor applies the limit after combining and sorting selected series.
Split very large workflows into bounded date windows if the official service rejects a broad request.

### Reliability and failure behavior

The Actor validates input before charging the start event.
Malformed dates, unknown series, duplicate series, and contradictory latest/date settings fail clearly.

Official requests use a 20-second timeout.
Temporary transport errors, HTTP 429 responses, and server errors are retried up to three times with bounded backoff.
Deterministic client errors are not retried blindly.

If BCB returns malformed JSON, an invalid date, or a non-numeric rate, the run fails rather than emitting misleading records.

### Limits and data interpretation

- Data availability and revision timing are controlled by Banco Central do Brasil.
- The target series can include calendar-day observations while effective series commonly follow business days.
- Different series use different units; always retain the `unit` field.
- `isLatest` means newest within the source response, not a prediction about future policy.
- The Actor reports official observations and does not infer COPOM decision periods.
- Source URLs and field names may change if BCB changes its public service.
- `maxItems` applies across all selected series, not separately to each series.

Consult official BCB methodology before comparing annual and daily rates mathematically.

### Apify API with cURL

Replace `YOUR_TOKEN` with your Apify API token:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~brazil-selic-rate-history/runs?token=YOUR_TOKEN&waitForFinish=120" \
  -H "Content-Type: application/json" \
  -d '{"series":["target","effectiveAnnual"],"latestOnly":true,"maxItems":2}'
```

Read results from the run's `defaultDatasetId`.
Avoid putting long-lived tokens into source control.

### JavaScript API example

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/brazil-selic-rate-history').call({
  series: ['target', 'effectiveAnnual'],
  latestOnly: true,
  maxItems: 2,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Python API example

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/brazil-selic-rate-history').call(run_input={
    'series': ['target', 'effectiveAnnual'],
    'latestOnly': True,
    'maxItems': 2,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use with MCP and AI agents

#### Claude Code

Add the Apify MCP server to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/brazil-selic-rate-history"
```

#### Claude Desktop, Cursor, and VS Code

Claude Desktop, Cursor, and VS Code clients can use this MCP server configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/brazil-selic-rate-history"
    }
  }
}
```

Example prompts:

- "Get the latest official Selic target and effective annual rates."
- "Export the BCB Selic target rate from 2026-01-01 through 2026-06-30."
- "Build an ascending target-versus-effective Selic dataset for my dashboard."

The agent still needs an Apify token with permission to run the Actor.

### Responsible use and legality

This Actor accesses a public official data service without authentication.
Use the results responsibly and comply with applicable BCB terms, attribution guidance, and local law.

Do not present the data as personal financial advice.
For regulated, contractual, or investment decisions, verify observations and methodology against official BCB publications.
Retain `sourceUrl` to make provenance review straightforward.

### Troubleshooting

#### Why did my run return no rows?

Check that the requested dates contain observations for the selected series.
Effective series commonly omit weekends and holidays.
Try a wider historical range or `latestOnly: true`.

#### Why was my input rejected?

Dates must use `YYYY-MM-DD` and the start cannot be after the end.
Do not provide dates with `latestOnly: true`.
Choose each supported series at most once.

#### Why do target and effective series have different row counts?

Series 432 can contain calendar-day target observations.
Effective-rate series generally contain business-day market observations.
This is source behavior, not missing Actor pagination.

#### What should I do after a temporary BCB outage?

Inspect the run log first.
The Actor already retries transient failures three times.
If the official service remains unavailable, rerun later rather than enabling a proxy.

### FAQ

#### Is this an official Banco Central do Brasil product?

No.
This independent Apify Actor reads the official public BCB SGS API and preserves official provenance in each row.

#### Does it need a BCB API key?

No.
The supported SGS endpoints are public and anonymous.

#### Can I fetch only the current Selic rate?

Yes.
Enable `latestOnly` and select the desired series.

#### Can I export more than one series?

Yes.
Select any combination of target, effective annual, and effective daily series.

#### Does the Actor calculate accumulated Selic returns?

No.
It exports source observations without inventing compounded values or forecasts.

#### Can I schedule it?

Yes.
Use an Apify schedule and connect a webhook or integration to the resulting dataset.

### Related Actors

For broader market datasets, explore other public Actors from [Automation Lab](https://apify.com/automation-lab).
This Actor is intentionally standalone for official Selic observations; no currently verified Automation Lab Actor provides a necessary adjacent BCB workflow.

# Actor input Schema

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

Official series to export: target rate, annualized effective rate, or daily effective rate.

## `latestOnly` (type: `boolean`):

Return the latest available observation for each selected series. Leave dates empty when enabled.

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

First observation date to include (YYYY-MM-DD). Defaults to 30 days before the run.

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

Last observation date to include (YYYY-MM-DD). Defaults to the run date.

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

Maximum total observations saved across all selected series.

## `sort` (type: `string`):

Order results by observation date.

## Actor input object example

```json
{
  "series": [
    "target",
    "effectiveAnnual"
  ],
  "latestOnly": false,
  "maxItems": 20,
  "sort": "descending"
}
```

# Actor output Schema

## `overview` (type: `string`):

Default dataset containing normalized target and effective Selic rate observations.

# 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": [
        "target",
        "effectiveAnnual"
    ],
    "latestOnly": false,
    "maxItems": 20,
    "sort": "descending"
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/brazil-selic-rate-history").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": [
        "target",
        "effectiveAnnual",
    ],
    "latestOnly": False,
    "maxItems": 20,
    "sort": "descending",
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/brazil-selic-rate-history").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": [
    "target",
    "effectiveAnnual"
  ],
  "latestOnly": false,
  "maxItems": 20,
  "sort": "descending"
}' |
apify call automation-lab/brazil-selic-rate-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/brazil-selic-rate-history"
        }
    }
}
```

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/UPNDgPpmIMx4lNNPG/builds/ATVn7cxgc7Ezs3eyh/openapi.json
