SELIC Historical Data API: Timeseries, Charts & Downloads

SELIC Historical Data API: Timeseries, Charts & Downloads

Introduction

In the world of finance, accurate and timely interest rate data is crucial for making informed decisions. For developers building fintech applications, economists analyzing market trends, and quantitative analysts conducting financial modeling, access to reliable interest rate data is essential. The SELIC (Sistema Especial de Liquidação e de Custódia) rate, Brazil's central bank rate, serves as a key benchmark for interest rates in the country. This blog post will explore how to effectively utilize the Interest Rates API to retrieve historical data, perform time series analysis, and visualize SELIC rates through various endpoints.

Understanding the SELIC Rate

The SELIC rate is the primary instrument used by the Central Bank of Brazil to control inflation and influence economic activity. It is the rate at which the government borrows money and is a critical indicator for investors and policymakers. Understanding its historical trends and fluctuations can provide valuable insights into Brazil's economic landscape. The Interest Rates API offers several endpoints that allow users to access this data efficiently.

Key API Endpoints for SELIC Data

The Interest Rates API provides multiple endpoints to access SELIC data, including the latest rates, historical values, time series data, and more. Below, we will discuss the most relevant endpoints for retrieving SELIC data and how to implement them effectively.

1. Retrieving Available Symbols

Before making requests for specific interest rates, it's essential to know the available symbols. The /api/v1/symbols endpoint allows you to retrieve a list of all available rate symbols, including SELIC.

cURL Example:


curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=BRL&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "SELIC",
"name": "Brazil SELIC Rate",
"category": "central_bank",
"country_code": "BR",
"currency_code": "BRL",
"frequency": "monthly",
"description": "The interest rate used by the Central Bank of Brazil for monetary policy."
}
]
}

2. Fetching the Latest SELIC Rate

To get the most recent value of the SELIC rate, you can use the /api/v1/latest endpoint. This endpoint returns the latest rates for specified symbols.

cURL Example:


curl "https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"date": "2026-07-05",
"base": "BRL",
"rates": {
"SELIC": 5.33
},
"dates": {
"SELIC": "2026-07-05"
},
"currencies": {
"SELIC": "BRL"
}
}

3. Historical Data Retrieval

For point-in-time lookups, the /api/v1/historical endpoint allows you to retrieve the SELIC rate for a specific date. This is particularly useful for analyzing historical trends and making comparisons.

cURL Example:


curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SELIC&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"date": "2025-06-15",
"base": "BRL",
"rates": {
"SELIC": 5.33
},
"currencies": {
"SELIC": "BRL"
}
}

4. Time Series Data

The /api/v1/timeseries endpoint is invaluable for fetching SELIC data over a specified date range. This allows for comprehensive time series analysis, which is essential for understanding trends and making forecasts.

cURL Example:


curl "https://interestratesapi.com/api/v1/timeseries?start=2025-07-05&end=2026-07-05&symbols=SELIC&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"base": "BRL",
"start_date": "2025-07-05",
"end_date": "2026-07-05",
"rates": {
"SELIC": {
"2025-07-05": 5.33,
"2025-08-05": 5.35,
"2025-09-05": 5.30
}
},
"frequencies": {
"SELIC": "monthly"
},
"currencies": {
"SELIC": "BRL"
}
}

5. Analyzing Fluctuations

To analyze the changes in the SELIC rate over a specified period, the /api/v1/fluctuation endpoint provides statistics such as the start and end values, percentage change, and high/low values.

cURL Example:


curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-07-05&end=2026-07-05&symbols=SELIC&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"rates": {
"SELIC": {
"start_date": "2025-07-05",
"end_date": "2026-07-05",
"start_value": 5.50,
"end_value": 5.33,
"change": -0.17,
"change_pct": -3.09,
"high": 5.50,
"low": 5.25
}
}
}

6. OHLC Data for Visualization

For those interested in visualizing SELIC data, the /api/v1/ohlc endpoint provides Open-High-Low-Close (OHLC) data, which is essential for creating candlestick charts.

cURL Example:


curl "https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-07-05&end=2026-07-05&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"period": "monthly",
"start_date": "2025-07-05",
"end_date": "2026-07-05",
"rates": {
"SELIC": [
{
"period": "2025-07",
"open": 5.50,
"high": 5.55,
"low": 5.30,
"close": 5.33,
"data_points": 23
}
]
}
}

To visualize this data, you can use libraries like Chart.js or Plotly. Below is a simple example using Chart.js to create a candlestick chart.


const ctx = document.getElementById('myChart').getContext('2d');
const chart = new Chart(ctx, {
type: 'candlestick',
data: {
datasets: [{
label: 'SELIC Rate',
data: [
{ x: '2025-07', o: 5.50, h: 5.55, l: 5.30, c: 5.33 }
]
}]
},
options: {}
});

Building a Data Pipeline with Python

For developers looking to integrate SELIC data into their applications, building a data pipeline using Python can be an effective approach. Below is a complete example of how to fetch SELIC data, store it in a Pandas DataFrame, and export it to CSV or Parquet format.


import requests
import pandas as pd

# Fetching SELIC time series data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-07-05', end='2026-07-05', symbols='SELIC', api_key='YOUR_KEY')
)
data = response.json()

# Creating a DataFrame
dates = data['rates']['SELIC']
df = pd.DataFrame(list(dates.items()), columns=['Date', 'Rate'])

# Exporting to CSV
df.to_csv('selic_rates.csv', index=False)

# Exporting to Parquet
df.to_parquet('selic_rates.parquet', index=False)

Common Pitfalls in Time Series Analysis

When working with time series data, there are several pitfalls to be aware of. Missing dates can lead to inaccurate analyses, especially when dealing with monthly symbols like SELIC. It's essential to handle weekends and holidays appropriately, as these can affect the availability of data points. Additionally, understanding the frequency of the data (daily vs. monthly) is crucial for accurate modeling and forecasting.

Another important aspect is the interpretation of the data_points field in the OHLC response. This field indicates the number of data points used to calculate the open, high, low, and close values. A low number of data points may suggest less reliability in the calculated values.

Conclusion

The Interest Rates API provides a powerful tool for accessing and analyzing SELIC data. By leveraging the various endpoints, developers can retrieve historical data, perform time series analysis, and visualize trends effectively. Whether you are building a fintech application or conducting economic research, the API offers the flexibility and reliability needed to make informed decisions based on accurate interest rate data.

To get started with the Interest Rates API, explore its features and capabilities, and unlock the potential of financial data analysis.

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key

Related posts