Introduction
In the rapidly evolving world of fintech, access to accurate and timely financial data is crucial for developers, economists, and analysts. One of the key data points in the financial landscape is the SELIC rate, Brazil's central bank interest rate. Integrating SELIC data into your application can provide valuable insights for financial modeling, risk assessment, and investment strategies. This blog post serves as a comprehensive guide to integrating SELIC data using the Interest Rates API from interestratesapi.com. We will cover all relevant endpoints, provide code examples, and discuss best practices for implementation.
Understanding the Importance of SELIC Data
The SELIC rate is a critical indicator of the Brazilian economy, influencing everything from consumer loans to government borrowing costs. For developers building fintech applications, having access to this data allows for enhanced financial analysis, better forecasting, and improved decision-making. Without such APIs, developers would face significant challenges in gathering and maintaining accurate financial data, which can be time-consuming and prone to errors if done manually.
Overview of the Interest Rates API
The Interest Rates API provides a straightforward way to access various interest rate data, including the SELIC rate. The API is designed to be user-friendly, with all requests made via the GET method. Authentication is handled through the api_key query parameter, ensuring secure access to the data. Below, we will explore the various endpoints available in the API, focusing on how to effectively integrate SELIC data into your applications.
API Endpoints for SELIC Data
The Interest Rates API offers several endpoints that are essential for accessing SELIC data. We will discuss each endpoint in detail, including its purpose, required parameters, and response structure. The endpoints we will cover are:
- /api/v1/symbols
- /api/v1/latest
- /api/v1/historical
- /api/v1/timeseries
- /api/v1/fluctuation
- /api/v1/ohlc
- /api/v1/convert
1. Endpoint: /api/v1/symbols
This endpoint provides a catalogue of available rate symbols, including the SELIC rate. It allows developers to filter symbols based on categories such as central bank rates, interbank rates, and more.
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 set by the Central Bank of Brazil"
}
]
}
The response includes the symbol for the SELIC rate, its name, category, and a brief description. This information is crucial for developers to understand what data they can access.
2. Endpoint: /api/v1/latest
This endpoint retrieves the latest value for specified symbols, including the SELIC rate. It is useful for applications that require real-time data.
cURL Example:
curl "https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2026-07-14",
"base": "MIXED",
"rates": {
"SELIC": 5.33
},
"dates": {
"SELIC": "2026-07-14"
},
"currencies": {
"SELIC": "BRL"
}
}
The response provides the latest SELIC rate along with the date of the data. This endpoint is essential for applications that need to display current interest rates.
3. Endpoint: /api/v1/historical
This endpoint allows developers to retrieve the SELIC rate for a specific date. It is particularly useful for historical analysis and financial modeling.
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"
}
}
The historical endpoint provides the SELIC rate for a specified date, allowing for in-depth analysis of trends over time.
4. Endpoint: /api/v1/timeseries
This endpoint retrieves a series of SELIC rates between two specified dates. It is ideal for applications that require trend analysis over a period.
cURL Example:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-07-14&end=2026-07-14&symbols=SELIC&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"base": "BRL",
"start_date": "2025-07-14",
"end_date": "2026-07-14",
"rates": {
"SELIC": {
"2025-07-14": 5.33,
"2025-07-15": 5.35
}
},
"frequencies": {
"SELIC": "daily"
},
"currencies": {
"SELIC": "BRL"
}
}
The timeseries endpoint provides daily SELIC rates between the specified dates, enabling developers to visualize trends and fluctuations.
5. Endpoint: /api/v1/fluctuation
This endpoint provides change statistics over a specified range, including the start and end values of the SELIC rate. It is useful for assessing the volatility of the rate.
cURL Example:
curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-07-14&end=2026-07-14&symbols=SELIC&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"rates": {
"SELIC": {
"start_date": "2025-07-14",
"end_date": "2026-07-14",
"start_value": 5.50,
"end_value": 5.33,
"change": -0.17,
"change_pct": -3.09,
"high": 5.50,
"low": 5.25
}
}
}
The fluctuation endpoint provides insights into how the SELIC rate has changed over a specified period, including percentage changes and high/low values.
6. Endpoint: /api/v1/ohlc
This endpoint provides Open, High, Low, and Close (OHLC) candlestick data for the SELIC rate over a specified period. It is particularly useful for traders and analysts.
cURL Example:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-07-14&end=2026-07-14&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"period": "monthly",
"start_date": "2025-07-14",
"end_date": "2026-07-14",
"rates": {
"SELIC": [
{
"period": "2025-07",
"open": 5.50,
"high": 5.50,
"low": 5.33,
"close": 5.33,
"data_points": 23
}
]
}
}
The OHLC endpoint provides a comprehensive view of the SELIC rate's performance over a specified period, allowing for detailed analysis of market trends.
7. Endpoint: /api/v1/convert
This endpoint allows for the comparison of loan interest costs between two rates, which can be useful for financial decision-making.
cURL Example:
curl "https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "SELIC",
"rate": 5.33,
"date": "2026-07-14",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-07-14",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}
The convert endpoint provides a comparison of total interest costs between two different rates, helping users make informed financial decisions.
Error Handling
When integrating with the Interest Rates API, it's essential to handle errors gracefully. The API can return several error codes that developers should be aware of:
- 401: Missing or invalid
api_key. - 403: Account without an active plan.
- 404: No symbols matched or no data for the requested date/range.
- 422: Validation error (e.g., wrong date format, invalid symbol).
- 429: Request quota exhausted.
For each of these errors, developers should implement appropriate error handling logic in their applications. For example, if a 404 error is returned, the application could prompt the user to check the requested date or symbol.
Rate Limit Headers
The Interest Rates API includes rate limit headers that provide information about the usage of the API:
- X-RateLimit-Limit: The maximum number of requests that can be made in a given time period.
- X-RateLimit-Remaining: The number of requests remaining in the current time window.
- X-RateLimit-Reset: The time when the rate limit will reset.
Developers should monitor these headers to avoid hitting rate limits and ensure their applications run smoothly.
Mini End-to-End Project: Node.js/Express Endpoint
To demonstrate the integration of SELIC data into an application, we will create a simple Node.js/Express endpoint that fetches, caches, and serves SELIC rate data. Below is a basic implementation:
const express = require('express');
const axios = require('axios');
const app = express();
const PORT = process.env.PORT || 3000;
const API_KEY = 'YOUR_KEY';
const BASE_URL = 'https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=' + API_KEY;
app.get('/api/selic', async (req, res) => {
try {
const response = await axios.get(BASE_URL);
res.json(response.data);
} catch (error) {
res.status(500).json({ error: 'Failed to fetch SELIC data' });
}
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
This simple Express application fetches the latest SELIC rate from the Interest Rates API and serves it at the endpoint /api/selic. Developers can expand this application by adding caching mechanisms, error handling, and additional endpoints as needed.
Conclusion
Integrating SELIC data into your fintech application using the Interest Rates API from interestratesapi.com is a straightforward process that can significantly enhance your application's capabilities. By leveraging the various endpoints available, developers can access real-time and historical data, perform trend analysis, and make informed financial decisions. For more information on the API and its features, be sure to Explore Interest Rates API features and Get started with Interest Rates API today.




