How to Integrate Brazilian Selic Rate Data into Your App: Complete API Guide

How to Integrate Brazilian Selic Rate Data into Your App: Complete API Guide

Building reliable Finance applications that react to monetary policy in real time demands accurate central bank rate data, consistent time series, and tools to quantify changes. Brazil’s SELIC (Sistema Especial de Liquidação e Custódia) — the benchmark policy rate set by Banco Central do Brasil — drives funding costs across BRL markets, from treasury auctions to credit pricing and discount curves. Without a robust data pipeline, teams end up scraping multiple sources, normalizing formats, backfilling gaps, and dealing with version drift across services. The result: fragile infrastructure, inconsistent analytics, and longer time-to-market.

This guide shows how to integrate the SELIC Target Rate into your app using the Interest Rates API at interestratesapi.com. You will learn to discover symbols, fetch the latest SELIC reading, retrieve historical and full time series, compute fluctuations, generate OHLC aggregates, and compare interest cost impacts across rates — all with standardized JSON, reliable semantics, and production-ready code in cURL, Python, JavaScript, and PHP. We also include a complete Node.js/Express example that caches SELIC data for low-latency delivery to your downstream services.

Every example in this article uses the following base URL and GET requests:

Base URL: https://interestratesapi.com/api/v1/

All endpoints are GET-only, and requests use api_key in the query string. For example: ?api_key=YOUR_KEY. You should never use headers for authentication with this API.

If you want to test endpoints quickly, you can start here: Try Interest Rates API, Explore Interest Rates API features, Get started with Interest Rates API.

Why SELIC Data Matters for Finance Apps

The SELIC Target Rate is the primary monetary policy lever in Brazil, setting the tone for BRL funding costs, bank lending, and discounting of cash flows. For fintech applications, quant research platforms, and enterprise risk systems, incorporating SELIC data delivers:

  • Pricing precision for BRL-linked products: loans, savings yields, structured products, and ALM simulation.
  • Sensitivity analyses for macro scenarios and stress testing: compute beta exposures to policy shifts and evaluate pass-through.
  • Backtesting and research workflows: time series for model training and event studies around COPOM meeting dates.
  • Risk and compliance visibility: policy rate audits, governance checks, and standardized analytics.

Without a unified API, teams must stitch together disparate sources, build ETL that constantly chases formatting changes, and reinvent analytics primitives like OHLC or period-over-period fluctuations. The Interest Rates API at interestratesapi.com provides:

  • Consistent JSON schemas across endpoints.
  • Deterministic frequency semantics (daily or monthly), with clear symbol metadata.
  • Analytics-ready endpoints (fluctuation, OHLC, loan interest comparison) that reduce your in-house code footprint.
  • Simple, uniform GET requests with query-parameter authentication for clean client implementation and cacheability.

Integration Roadmap: From Discovery to Analytics

The recommended flow to add SELIC to your app is:

  1. Discover the symbol with /symbols and verify metadata (category, frequency).
  2. Fetch current levels with /latest for dashboards and alerting.
  3. Pull historical context with /timeseries for charts, models, and backtests.
  4. Retrieve specific snapshots with /historical for event studies and end-of-period reporting.
  5. Quantify changes with /fluctuation for KPIs and alerting thresholds.
  6. Generate OHLC aggregates with /ohlc for candlestick charts and volatility summaries.
  7. Compare interest costs across rates with /convert to show business impact directly.

Each step below includes cURL, Python, JavaScript, and PHP examples you can use in production. All requests are GET and include the api_key query parameter.

Step 1 — Discover SELIC with /symbols

Before you integrate, confirm SELIC’s metadata via the symbols catalogue. This ensures you know the symbol identifier (SELIC), the category (central_bank), frequency (monthly for policy rate targets), and other useful descriptors to drive UI and caching policies.

Endpoint: GET https://interestratesapi.com/api/v1/symbols

Common filters:

  • base: filter by currency code (e.g., BRL or USD-converted sources, where applicable).
  • category: central_bank, interbank, treasury, reference.
  • provider: fred, ecb, bis (when relevant to a symbol family).

Request examples to find SELIC:

cURL:

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

Python (requests):

import requests

resp = requests.get(
"https://interestratesapi.com/api/v1/symbols",
params=dict(category="central_bank", api_key="YOUR_KEY")
)
symbols = resp.json()
print(symbols)

JavaScript (fetch):

const response = await fetch(
"https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_KEY"
);
const data = await response.json();
console.log(data);

PHP:

<?php
$url = "https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_KEY";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);

Illustrative JSON response excerpt (fields and structure):

{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "SELIC",
"name": "Brazil SELIC Target Rate",
"category": "central_bank",
"country_code": "BR",
"currency_code": "BRL",
"frequency": "monthly",
"description": "The benchmark interest rate set by Banco Central do Brasil (COPOM) guiding monetary policy and short-term funding costs"
}
]
}

Key fields and usage:

  • symbol: The exact identifier you must use across all endpoints (SELIC).
  • frequency: Monthly implies that /historical queries snap to the last day with data in the target month. This informs your chart aggregation logic and caching TTLs after policy meetings.
  • country_code and currency_code: Useful for routing SELIC to BRL dashboards, risk contexts, and currency-aware components.

Practical use cases:

  • Build symbol pickers filtered by category=central_bank to control UI exposure.
  • Validate incoming symbol strings from user inputs before making data calls.
  • Drive per-symbol caching and orchestration based on frequency (e.g., monthly rates may require less frequent polling than interbank daily rates).

Step 2 — Fetch the Latest SELIC Value with /latest

Dashboards, alerts, and risk monitors often need the freshest SELIC level at all times. Use /latest to get the current reading in a single call. You can request multiple symbols at once to optimize network round-trips.

Endpoint: GET https://interestratesapi.com/api/v1/latest

Key parameters:

  • symbols: Comma-separated list, e.g., SELIC or SELIC,ECB_MRO.
  • base: Optional currency filter across mixed symbols; typically not required for SELIC lookups.

cURL:

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

Python:

import requests

response = requests.get(
"https://interestratesapi.com/api/v1/latest",
params=dict(symbols="SELIC", api_key="YOUR_KEY")
)
data = response.json()
print(data)

JavaScript:

const res = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_KEY"
);
const latest = await res.json();
console.log(latest);

PHP:

<?php
$params = http_build_query([
'symbols' => 'SELIC',
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/latest?$params";
$json = file_get_contents($url);
$latest = json_decode($json, true);
print_r($latest);

Example JSON:

{
"success": true,
"date": "2026-09-19",
"base": "MIXED",
"rates": {
"SELIC": 5.33
},
"dates": {
"SELIC": "2026-09-19"
},
"currencies": {
"SELIC": "USD"
}
}

Field details:

  • rates: A dictionary keyed by symbol, delivering the current rate value.
  • dates: For each symbol, the effective date of the latest value (important for end-of-month policy rolls).
  • currencies: The currency context for the symbol (e.g., USD or BRL depending on the underlying data normalization).

Implementation tips:

  • Cache the /latest result for short intervals aligned to SELIC publication cadence. For intra-day UIs, poll at a conservative rate with exponential backoff on transient failures.
  • Consider multi-symbol requests (SELIC plus ECB_MRO, FED_FUNDS, etc.) when building global dashboards to reduce request overhead.

Step 3 — Retrieve Full SELIC History with /timeseries

Time series are the foundation for analytics: plotting charts, computing moving averages, training models, and measuring policy impact. The /timeseries endpoint delivers a contiguous range between start and end for specified symbols, with frequency semantics preserved.

Endpoint: GET https://interestratesapi.com/api/v1/timeseries

Required params:

  • start: YYYY-MM-DD
  • end: YYYY-MM-DD (must be on or after start)
  • symbols: comma-separated list (e.g., SELIC)

cURL:

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

Python:

import requests

params = dict(
start="2025-01-01",
end="2026-09-19",
symbols="SELIC",
api_key="YOUR_KEY"
)
resp = requests.get("https://interestratesapi.com/api/v1/timeseries", params=params)
series = resp.json()
print(series)

JavaScript:

const url = new URL("https://interestratesapi.com/api/v1/timeseries");
url.searchParams.set("start", "2025-01-01");
url.searchParams.set("end", "2026-09-19");
url.searchParams.set("symbols", "SELIC");
url.searchParams.set("api_key", "YOUR_KEY");

const r = await fetch(url.toString());
const timeseries = await r.json();
console.log(timeseries);

PHP:

<?php
$query = http_build_query([
'start' => '2025-01-01',
'end' => '2026-09-19',
'symbols' => 'SELIC',
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/timeseries?$query";
$json = file_get_contents($url);
$timeseries = json_decode($json, true);
print_r($timeseries);

Example JSON:

{
"success": true,
"base": "USD",
"start_date": "2025-01-01",
"end_date": "2026-09-19",
"rates": {
"SELIC": {
"2025-01-02": 5.33,
"2025-01-03": 5.33,
"2025-01-06": 5.33
}
},
"frequencies": { "SELIC": "daily" },
"currencies": { "SELIC": "USD" }
}

Field breakdown:

  • rates.SELIC: Date-keyed dictionary of rate values. For monthly symbols, returns the last available date per month; for daily series, daily points appear accordingly.
  • start_date / end_date: Confirm the server-interpreted range, useful for auditing and logging.
  • frequencies / currencies: Per-symbol context you can surface in the UI or use to drive resampling.

Practical use cases:

  • Build rolling policy charts, with moving windows for 1Y, 3Y, or since-inception.
  • Train regression or regime-switching models with SELIC as an explanatory variable for BRL spreads.
  • Drive valuation engines that require period-by-period discount rate updates.

Performance tips:

  • Respect symbol frequencies when setting chart intervals. Monthly series visually benefit from end-of-month markers.
  • Batch symbols to minimize round-trips, but segment very large requests by time to fit client memory constraints.

Step 4 — Request Exact Snapshots with /historical

You often need an authoritative point-in-time SELIC value (e.g., quarter-end, budget cycle checkpoint, or the day after a COPOM announcement). Use /historical for a specific date. For monthly series, the service returns the last day with data in that month.

Endpoint: GET https://interestratesapi.com/api/v1/historical

Required params:

  • date: YYYY-MM-DD

Optional params:

  • symbols: e.g., SELIC
  • base: Optional filter

cURL:

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

Python:

import requests

resp = requests.get(
"https://interestratesapi.com/api/v1/historical",
params=dict(date="2025-06-15", symbols="SELIC", api_key="YOUR_KEY")
)
hist = resp.json()
print(hist)

JavaScript:

const response = await fetch(
"https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SELIC&api_key=YOUR_KEY"
);
const snapshot = await response.json();
console.log(snapshot);

PHP:

<?php
$params = http_build_query([
'date' => '2025-06-15',
'symbols' => 'SELIC',
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/historical?$params";
$data = json_decode(file_get_contents($url), true);
print_r($data);

Example JSON:

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

Best practices:

  • For month-end statements, pass any date within the month; the service returns the last date with data for SELIC in that period.
  • Keep an audit log with the request parameters and the response date to maintain reproducibility of reports.

Step 5 — Measure Policy Moves with /fluctuation

Stakeholders care about how much the policy rate has changed over a defined period. The /fluctuation endpoint computes start-to-end changes, percent change, and the high/low across the range. These metrics power alerts, KPI widgets, and portfolio sensitivity dashboards.

Endpoint: GET https://interestratesapi.com/api/v1/fluctuation

Required:

  • start: YYYY-MM-DD
  • end: YYYY-MM-DD
  • symbols: e.g., SELIC

cURL:

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

Python:

import requests

params = dict(
start="2025-09-19",
end="2026-09-19",
symbols="SELIC",
api_key="YOUR_KEY"
)
resp = requests.get("https://interestratesapi.com/api/v1/fluctuation", params=params)
fluc = resp.json()
print(fluc)

JavaScript:

const url = "https://interestratesapi.com/api/v1/fluctuation?start=2025-09-19&end=2026-09-19&symbols=SELIC&api_key=YOUR_KEY";
const response = await fetch(url);
const stats = await response.json();
console.log(stats);

PHP:

<?php
$q = http_build_query([
'start' => '2025-09-19',
'end' => '2026-09-19',
'symbols' => 'SELIC',
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/fluctuation?$q";
$data = json_decode(file_get_contents($url), true);
print_r($data);

Example JSON:

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

Interpretation:

  • change: Absolute difference over the range. Negative values indicate easing; positive values indicate tightening.
  • change_pct: Percentage change vs start_value. Useful for normalizing move magnitudes across disparate rates.
  • high / low: Range extremes; feed alert rules, confidence bands, and scenario overlays.

Use cases:

  • Alert if SELIC changes more than a threshold over a quarter.
  • Display sparkline plus high/low badges next to portfolio KPIs.

Step 6 — Create Candlesticks and Aggregates with /ohlc

For charting and at-a-glance visuals, OHLC aggregates (open-high-low-close) convey the amplitude of rate moves over time. The /ohlc endpoint constructs these on the fly from daily data. Choose period=monthly, weekly, or quarterly. Even for monthly SELIC, OHLC is helpful when visualizing within-month moves or comparing across symbols that have daily changes.

Endpoint: GET https://interestratesapi.com/api/v1/ohlc

Required:

  • symbols: e.g., SELIC

Optional:

  • period: monthly (default), weekly, or quarterly
  • start, end: YYYY-MM-DD

cURL:

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

Python:

import requests

params = dict(
symbols="SELIC",
period="monthly",
start="2025-01-01",
end="2026-09-19",
api_key="YOUR_KEY"
)
resp = requests.get("https://interestratesapi.com/api/v1/ohlc", params=params)
ohlc = resp.json()
print(ohlc)

JavaScript:

const r = await fetch(
"https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-01-01&end=2026-09-19&api_key=YOUR_KEY"
);
const ohlc = await r.json();
console.log(ohlc);

PHP:

<?php
$params = http_build_query([
'symbols' => 'SELIC',
'period' => 'monthly',
'start' => '2025-01-01',
'end' => '2026-09-19',
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/ohlc?$params";
$data = json_decode(file_get_contents($url), true);
print_r($data);

Example JSON:

{
"success": true,
"period": "monthly",
"start_date": "2025-01-01",
"end_date": "2026-09-19",
"rates": {
"SELIC": [
{
"period": "2025-01",
"open": 5.50,
"high": 5.50,
"low": 5.33,
"close": 5.33,
"data_points": 23
},
{
"period": "2025-02",
"open": 5.33,
"high": 5.33,
"low": 5.25,
"close": 5.25,
"data_points": 20
}
]
}
}

How to use it:

  • Draw candlestick charts for executive dashboards and macro summaries.
  • Compute realized volatility proxies from (high - low) spans.
  • Compare monthly SELIC aggregates to interbank benchmarks (e.g., ESTR, SONIA) to analyze global policy dispersion.

Step 7 — Compare Interest Costs Across Rates with /convert

Product and credit teams often ask: “What’s the interest cost difference if we priced this loan off SELIC versus another central bank rate?” The /convert endpoint answers that by computing the total interest on a simple loan using the latest rate from each symbol, returning side-by-side totals and spreads.

Endpoint: GET https://interestratesapi.com/api/v1/convert

Required:

  • from: a symbol, e.g., SELIC
  • to: another symbol, e.g., ECB_MRO
  • amount: principal amount

Optional:

  • term_months: 1–360 (default 12)

cURL:

curl "https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"

Python:

import requests

params = dict(
from="SELIC",
to="ECB_MRO",
amount=100000,
term_months=12,
api_key="YOUR_KEY"
)
resp = requests.get("https://interestratesapi.com/api/v1/convert", params=params)
comp = resp.json()
print(comp)

JavaScript:

const u = "https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY";
const response = await fetch(u);
const comparison = await response.json();
console.log(comparison);

PHP:

<?php
$query = http_build_query([
'from' => 'SELIC',
'to' => 'ECB_MRO',
'amount' => 100000,
'term_months' => 12,
'api_key' => 'YOUR_KEY'
]);
$url = "https://interestratesapi.com/api/v1/convert?$query";
$data = json_decode(file_get_contents($url), true);
print_r($data);

Example JSON:

{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "SELIC",
"rate": 5.33,
"date": "2026-09-19",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-09-19",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}

Applications:

  • Show business stakeholders the direct impact of policy rate differentials in currency-agnostic terms.
  • Run sensitivity toggles in product UIs to educate users on potential cost savings.

Putting It Together: A Node.js/Express SELIC Microservice with Caching

Below is a minimal Node.js/Express service that fetches the latest SELIC rate, caches it in memory, and serves it to downstream clients. It demonstrates:

  • GET-only calls with the api_key query parameter.
  • Basic retry and backoff logic.
  • Caching to relieve pressure on upstream calls and reduce latency.

Code (server.js):

import express from "express";
import fetch from "node-fetch";

const app = express();
const PORT = process.env.PORT || 8080;

const API_BASE = "https://interestratesapi.com/api/v1";
const API_KEY = process.env.INTERESTRATES_API_KEY; // do not hardcode in source

// Simple in-memory cache
let cache = {
selic: null,
timestamp: 0,
ttlMs: 5 * 60 * 1000 // 5 minutes
};

async function fetchLatestSELIC() {
const url = `${API_BASE}/latest?symbols=SELIC&api_key=${encodeURIComponent(API_KEY)}`;
let attempt = 0;
const maxAttempts = 3;
const baseDelay = 300;

while (attempt < maxAttempts) {
try {
const res = await fetch(url, { method: "GET" });
if (!res.ok) {
// Log header diagnostics if available
const limit = res.headers.get("X-RateLimit-Limit");
const remaining = res.headers.get("X-RateLimit-Remaining");
const reset = res.headers.get("X-RateLimit-Reset");
console.error("Upstream error", res.status, { limit, remaining, reset });

// If 5xx, retry; for 4xx, break unless you implement key rotation or other logic
if (res.status >= 500) {
throw new Error(`Server error: ${res.status}`);
}
const body = await res.text();
return { error: true, status: res.status, body };
}

const data = await res.json();
if (!data.success) {
return { error: true, status: 502, body: data };
}
return { error: false, data };
} catch (err) {
attempt += 1;
if (attempt >= maxAttempts) {
return { error: true, status: 503, body: err.message };
}
const delay = baseDelay * Math.pow(2, attempt - 1);
await new Promise((r) => setTimeout(r, delay));
}
}
return { error: true, status: 503, body: "Unknown error" };
}

app.get("/selic/latest", async (req, res) => {
const now = Date.now();
if (cache.selic && now - cache.timestamp < cache.ttlMs) {
return res.json({
source: "cache",
...cache.selic
});
}

const result = await fetchLatestSELIC();
if (result.error) {
return res.status(result.status || 502).json({
success: false,
error: "Failed to fetch SELIC",
details: result.body || null
});
}

cache.selic = result.data;
cache.timestamp = now;
res.json({ source: "origin", ...result.data });
});

app.listen(PORT, () => {
console.log(`SELIC microservice listening on port ${PORT}`);
});

Deployment tips:

  • Externalize INTERESTRATES_API_KEY via environment variables.
  • Set a cache TTL that matches your UI needs; for monthly policy targets, 5–15 minutes is usually enough.
  • Add a health endpoint that validates both cache staleness and upstream reachability.

Complete JSON Example Gallery for Quick Reference

This section collects four realistic JSON shapes you can use as references when building your data models and serializers. These mirror real response structures from the endpoints you will rely on most when working with SELIC.

1) /latest for SELIC:

{
"success": true,
"date": "2026-09-19",
"base": "MIXED",
"rates": {
"SELIC": 5.33
},
"dates": {
"SELIC": "2026-09-19"
},
"currencies": {
"SELIC": "USD"
}
}

2) /timeseries range:

{
"success": true,
"base": "USD",
"start_date": "2025-01-01",
"end_date": "2026-09-19",
"rates": {
"SELIC": {
"2025-01-02": 5.33,
"2025-01-03": 5.33,
"2025-01-06": 5.33,
"2025-02-03": 5.25,
"2025-03-03": 5.25
}
},
"frequencies": { "SELIC": "daily" },
"currencies": { "SELIC": "USD" }
}

3) /fluctuation over a year:

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

4) /ohlc monthly SELIC series:

{
"success": true,
"period": "monthly",
"start_date": "2025-01-01",
"end_date": "2026-09-19",
"rates": {
"SELIC": [
{ "period": "2025-01", "open": 5.50, "high": 5.50, "low": 5.33, "close": 5.33, "data_points": 23 },
{ "period": "2025-02", "open": 5.33, "high": 5.33, "low": 5.25, "close": 5.25, "data_points": 20 },
{ "period": "2025-03", "open": 5.25, "high": 5.25, "low": 5.25, "close": 5.25, "data_points": 22 }
]
}
}

Error Handling and Troubleshooting: Building for Resilience

Even robust APIs encounter transient or user-driven errors. Handling them cleanly keeps your user experience smooth and your operations predictable. The Interest Rates API returns a consistent error shape on failures:

{
"success": false,
"error": "Human-readable error message",
"details": "Optional additional context (often for 404s)"
}

Common statuses:

  • 401 Unauthorized: The api_key query parameter is missing, invalid, or revoked.
  • 403 Forbidden: The calling account is not permitted to access the resource in its current state.
  • 404 Not Found: No symbols matched your query or there is no data for the requested date/range. A details field may include available ranges to guide your next request.
  • 422 Unprocessable Entity: Validation error, such as malformed dates (use YYYY-MM-DD), invalid symbol identifiers, or start greater than end.
  • 429 Too Many Requests: Your request quota is exhausted temporarily. The response includes Retry-After and rate-limit headers for well-behaved backoff.

Rate limit headers to inspect:

  • X-RateLimit-Limit: Total request quota for the window.
  • X-RateLimit-Remaining: Remaining requests available in the current window.
  • X-RateLimit-Reset: Epoch timestamp or seconds-until-reset indicating when your quota window will refresh.

Retry strategy:

  • On 429, read Retry-After and sleep that duration before retrying. As a fallback, use exponential backoff (e.g., 0.5s, 1s, 2s, 4s).
  • On 5xx, retry with exponential backoff up to a safe cap (e.g., 3–5 attempts) and short-circuit if the call is not business critical.
  • On 4xx (except 429), do not retry immediately; instead, fix request parameters or surface actionable errors to the user.

Validation checklist:

  • Symbols: Always use exact identifiers from the catalogue (e.g., SELIC). Do not guess symbol strings.
  • Dates: Use YYYY-MM-DD. Ensure end is not before start. For monthly series like SELIC, expect the last date of the given month to be used in /historical.
  • Query parameters: GET-only with api_key in the query string for all calls to interestratesapi.com.

Diagnostics in code:

  • Log the full request URL (excluding sensitive values), response status, and parsed JSON error message.
  • Capture response headers for 429 to improve your backoff logic.
  • Include upstream error details in observability dashboards to spot pattern changes.

Endpoint-by-Endpoint Reference and Production Patterns

This section consolidates every endpoint discussed, with code in cURL, Python, JavaScript, and PHP. Use it as a quick integration recipe set when wiring up your services.

/symbols — Discover rate identifiers and metadata

Purpose: Build symbol pickers, validate inputs, and fetch metadata (frequency, category) for orchestration.

cURL:

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

Python:

import requests
r = requests.get("https://interestratesapi.com/api/v1/symbols",
params={"category": "central_bank", "api_key": "YOUR_KEY"})
print(r.json())

JavaScript:

const response = await fetch(
"https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_KEY"
);
console.log(await response.json());

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_KEY");

/latest — Current value per symbol

Purpose: Power dashboards, alerts, and risk monitors that require the freshest SELIC value.

cURL:

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

Python:

import requests
resp = requests.get("https://interestratesapi.com/api/v1/latest",
params={"symbols": "SELIC", "api_key": "YOUR_KEY"})
print(resp.json())

JavaScript:

const res = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_KEY"
);
console.log(await res.json());

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_KEY");

/timeseries — Continuous series between dates

Purpose: History for charts, modeling, and backtesting.

cURL:

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

Python:

import requests
params = {"start": "2025-01-01", "end": "2026-09-19", "symbols": "SELIC", "api_key": "YOUR_KEY"}
print(requests.get("https://interestratesapi.com/api/v1/timeseries", params=params).json())

JavaScript:

const ts = await fetch(
"https://interestratesapi.com/api/v1/timeseries?start=2025-01-01&end=2026-09-19&symbols=SELIC&api_key=YOUR_KEY"
).then(r => r.json());
console.log(ts);

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/timeseries?start=2025-01-01&end=2026-09-19&symbols=SELIC&api_key=YOUR_KEY");

/historical — Value on a specific date

Purpose: Point-in-time snapshots for statements and event studies.

cURL:

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

Python:

import requests
print(requests.get("https://interestratesapi.com/api/v1/historical",
params={"date": "2025-06-15", "symbols": "SELIC", "api_key": "YOUR_KEY"}).json())

JavaScript:

console.log(
await (await fetch("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SELIC&api_key=YOUR_KEY")).json()
);

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SELIC&api_key=YOUR_KEY");

/fluctuation — Change statistics over a range

Purpose: KPI cards, alert thresholds, and volatility summaries.

cURL:

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

Python:

import requests
params = {"start": "2025-09-19", "end": "2026-09-19", "symbols": "SELIC", "api_key": "YOUR_KEY"}
print(requests.get("https://interestratesapi.com/api/v1/fluctuation", params=params).json())

JavaScript:

console.log(
await (await fetch("https://interestratesapi.com/api/v1/fluctuation?start=2025-09-19&end=2026-09-19&symbols=SELIC&api_key=YOUR_KEY")).json()
);

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/fluctuation?start=2025-09-19&end=2026-09-19&symbols=SELIC&api_key=YOUR_KEY");

/ohlc — OHLC candlestick aggregates

Purpose: Candlestick charts and amplitude analysis.

cURL:

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

Python:

import requests
params = {"symbols": "SELIC", "period": "monthly", "start": "2025-01-01", "end": "2026-09-19", "api_key": "YOUR_KEY"}
print(requests.get("https://interestratesapi.com/api/v1/ohlc", params=params).json())

JavaScript:

console.log(
await (await fetch("https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-01-01&end=2026-09-19&api_key=YOUR_KEY")).json()
);

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-01-01&end=2026-09-19&api_key=YOUR_KEY");

/convert — Loan interest cost comparison

Purpose: Show business impact of pricing a loan off SELIC vs another benchmark.

cURL:

curl "https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=250000&term_months=24&api_key=YOUR_KEY"

Python:

import requests
params = {"from": "SELIC", "to": "ECB_MRO", "amount": 250000, "term_months": 24, "api_key": "YOUR_KEY"}
print(requests.get("https://interestratesapi.com/api/v1/convert", params=params).json())

JavaScript:

console.log(
await (await fetch("https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=250000&term_months=24&api_key=YOUR_KEY")).json()
);

PHP:

<?php
echo file_get_contents("https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=250000&term_months=24&api_key=YOUR_KEY");

Engineering Best Practices for Finance-Grade Integrations

Finance systems demand high availability, reproducibility, and traceability. When integrating SELIC and adjacent rates from interestratesapi.com, consider:

  • Caching and TTLs: Align TTLs with frequency and publication cadence. For SELIC, set a conservative cache window and refresh immediately after expected policy updates.
  • Circuit breakers: Trip if the upstream is unavailable or slow, serve cached data, and recover with jittered backoff.
  • Health checks: Probe both cached freshness and upstream reachability. Use synthetic canary calls to detect schema drift early.
  • Observability: Log request parameters, status codes, and timing; track rate-limit headers to guide operational decisions.
  • Governance and keys: Use per-application keys, scoped environment variables, and audit trails for who deployed what and when.
  • Data locality and latency: Collocate services where possible; reuse HTTP connections and enable keep-alive.
  • Idempotence and purity: All endpoints are GET; ensure intermediaries and CDNs can safely cache responses based on URL.

Resilience patterns:

  • Fallback chains: If a multi-symbol call fails, degrade gracefully by calling smaller subsets or serving stale-but-reasonable cache for secondary symbols.
  • Backpressure: Throttle downstream clients if the upstream returns 429 or if your service detects load spikes.

Real-World Scenarios Where SELIC Integration Adds Value

- Lending origination and repricing: A Brazilian lender wants to reprice variable-rate loans monthly based on SELIC. With /latest and /historical, the system updates borrower rates, logs the specific SELIC date used, and computes new payment schedules. /fluctuation flags significant policy shifts to trigger extra disclosures.

- Treasury and ALM dashboards: A corporate treasury team consolidates global policy rates to steer cash deployment. They pull SELIC via /timeseries for historical context and use /ohlc to visualize within-month dispersion versus other central bank rates. The team runs /convert scenarios to show how a policy pivot would alter expected interest costs on short-term financings.

- Quant research and risk: A macro desk builds models using SELIC as an input variable for BRL spread prediction. /timeseries provides the training window; /historical anchors event windows around COPOM meetings. /fluctuation quantifies the signal strength over various horizons, and OHLC aggregates measure realized amplitude for strategy selection.

- Finance analytics SaaS: A B2B analytics platform exposes widgets and APIs to client developers. They host a microservice (like the Node.js example above) to serve SELIC to client apps with strict SLAs. Logs and rate-limit headers enable capacity planning; caching controls ensure predictable latency during peak usage.

Troubleshooting Checklist

Use this quick guide when something goes wrong:

  • Did you append api_key as a query parameter to the URL? All endpoints are GET-only and require ?api_key=YOUR_KEY (do not send it as a header).
  • Are you using the exact symbol SELIC spelled correctly and included in the available symbols list?
  • Are your dates in YYYY-MM-DD format and valid calendar dates? For /timeseries, is end on or after start?
  • Did you inspect response.status and the JSON error fields? For 429, check Retry-After and X-RateLimit-* headers and apply backoff.
  • Are you logging the full request URL (without sensitive values) and status for observability?
  • Is your cache TTL appropriate? Stale data can mislead analytics; too-aggressive refresh can throttle upstream.

Security and Governance Considerations

For Finance and enterprise contexts, align your usage of interestratesapi.com with internal controls:

  • Per-app keys: Assign unique environment variables per service and environment (dev, staging, prod) for traceability.
  • Roles and least privilege: Segment access across microservices and teams; automate key rotation policies.
  • Audit trails: Keep append-only logs of when symbols are added to mission-critical systems and track mean time to recovery after upstream incidents.
  • Data governance: Version your internal data transformations, store response snippets used for official reports, and archive time series for reproducibility.

Conclusion and Next Steps

By standardizing on interestratesapi.com, your Finance applications gain a single, consistent interface to the Brazil SELIC rate and a full suite of endpoints that turn raw data into analytics-ready signals. In this guide, you learned to:

  • Discover SELIC with /symbols.
  • Fetch the latest value with /latest for dashboards and alerting.
  • Build historical context with /timeseries and point-in-time snapshots with /historical.
  • Quantify and visualize changes using /fluctuation and /ohlc.
  • Demonstrate business impact directly with /convert.
  • Deploy a production-ready Node.js microservice with caching and retries.

From macro research and stress testing to loan pricing and ALM, these capabilities reduce engineering toil and accelerate delivery. Ready to integrate SELIC into your stack? Start here: Try Interest Rates API, Explore Interest Rates API features, Get started with Interest Rates API.

Ready to get started?

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

Get API Key

Related posts