You need a reliable way to fetch the Brazil SELIC Target Rate (symbol: SELIC) for risk models, lending engines, or macro dashboards. By the end of this article, you will know exactly how to query SELIC over HTTPS using GET requests, authenticate with an api_key parameter, parse the JSON fields (rates, dates, currencies), and apply the data to tasks like spread calculations, loan comparisons, and time series analysis.
What the SELIC Rate Represents and How It’s Expressed
SELIC is Brazil’s policy rate set by the Banco Central do Brasil. In the Interest Rates API, SELIC is exposed as a central bank benchmark with currency BRL and frequency noted as monthly. The value returned represents an annualized rate expressed as a percentage (for example, 13.75 means 13.75% per annum).
Effective dates are returned alongside values so you can tie a specific rate to its reference date. For monthly benchmarks like SELIC, the API aligns a date to the last available day in the specified month for historical queries (more on that below). Always read both the rates and dates maps together to avoid mismatching values to periods in backfills or end-of-month reconciliations.
To explore the broader ecosystem and register for an API key, visit interestratesapi.com.
How the Interest Rates API Works for SELIC
All endpoints are HTTP GET under the base URL https://interestratesapi.com/api/v1/ and use query-string authentication with api_key. You’ll pass symbols such as SELIC, optional date ranges, and read structured JSON responses.
- Base URL: https://interestratesapi.com/api/v1/
- Authentication: append ?api_key=YOUR_API_KEY to every request
- HTTP method: GET for all endpoints
Publication cadence and business days: SELIC is modeled as a monthly benchmark. You’ll typically handle it at a monthly granularity; if you query daily windows, you may observe flat daily values within a month or updates around policy decisions and official publications. For caching, it’s common to cache the latest SELIC response until your process detects a new effective date in the dates map or until your monthly close process runs. For daily or intramonth requests, use the dates field returned by the API to determine when a change has actually occurred.
Error handling: the API returns standardized error shapes (success=false with an error message). Rate limit details are carried in headers (X-RateLimit-*). When you reach the limit, the API uses HTTP 429 and may include a Retry-After header to back off cleanly.
Below we’ll walk through all seven endpoints you’ll use for SELIC.
1) Discovering SELIC with /symbols
Use the symbols catalogue to discover available rate identifiers and metadata such as category, country, currency, and frequency. For SELIC, you’ll find it under central_bank with currency_code BRL.
cURL
curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=SELIC"
JSON response (example)
{
"success": true,
"date": "2026-10-31",
"base": "BRL",
"rates": {
"SELIC": 13.75
},
"dates": {
"SELIC": "2026-10-31"
},
"currencies": {
"SELIC": "BRL"
},
"base_filter_note": null
}
Notes:
- Filter with base=BRL and category=central_bank to surface SELIC specifically.
- The frequency field informs how to interpret the time axis (SELIC is monthly).
Python (requests)
import requests
params = dict(category='central_bank', base='BRL', api_key='YOUR_API_KEY')
resp = requests.get('https://interestratesapi.com/api/v1/symbols', params=params)
catalogue = resp.json()
# Find SELIC in catalogue['symbols'] by symbol == 'SELIC'
JavaScript (fetch)
const url = 'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=BRL&api_key=YOUR_API_KEY';
const res = await fetch(url);
const symbols = await res.json();
// Locate SELIC by checking entries with symbol === 'SELIC'
PHP
<?php
$url = 'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=BRL&api_key=YOUR_API_KEY';
$response = file_get_contents($url);
$data = json_decode($response, true);
// Iterate $data['symbols'] to find 'SELIC'
?>
2) Getting the latest SELIC with /latest
Use /latest to fetch the current SELIC rate, its effective date, and currency. The following cURL and JSON are the official sample—copy as-is to test quickly.
cURL (official sample)
JSON (official sample)
How to read these fields:
- rates.SELIC: the annualized percentage rate for SELIC.
- dates.SELIC: the effective date for that value. For monthly benchmarks, this often corresponds to the month’s end or the last available day in the month.
- currencies.SELIC: the currency code (BRL for SELIC).
Python (requests)
import requests
resp = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(symbols='SELIC', api_key='YOUR_API_KEY')
)
data = resp.json()
selic = data['rates']['SELIC']
selic_date = data.get('dates', {}).get('SELIC')
JavaScript (fetch)
const response = await fetch(
'https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_API_KEY'
);
const latest = await response.json();
const selic = latest.rates.SELIC;
const selicDate = latest.dates?.SELIC;
PHP
<?php
$url = 'https://interestratesapi.com/api/v1/latest?symbols=SELIC&api_key=YOUR_API_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$selic = $data['rates']['SELIC'];
$selicDate = $data['dates']['SELIC'] ?? null;
?>
3) Point-in-time SELIC with /historical
Use /historical to fetch the SELIC value on a requested date. For monthly symbols, the API maps your date to the last day with data in that month.
cURL
JSON response (example)
Key details:
- When querying a date within a month, expect the SELIC value corresponding to the latest available day in that month.
- Use the currencies map to understand the denomination. SELIC is BRL in the official latest sample; example payloads here may show different base filters.
Python (requests)
import requests
params = dict(date='2025-06-15', symbols='SELIC', api_key='YOUR_API_KEY')
resp = requests.get('https://interestratesapi.com/api/v1/historical', params=params)
hist = resp.json()
value = hist['rates']['SELIC']
JavaScript (fetch)
const res = await fetch(
'https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=SELIC&api_key=YOUR_API_KEY'
);
const historical = await res.json();
const value = historical.rates.SELIC;
PHP
<?php
$query = http_build_query([
'date' => '2025-06-15',
'symbols' => 'SELIC',
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/historical?$query";
$data = json_decode(file_get_contents($url), true);
$value = $data['rates']['SELIC'];
?>
4) Time series for SELIC with /timeseries
Use /timeseries to construct historical panels for analytics, charts, and backtests across a date range. For SELIC, you’ll typically request a monthly window. The API returns per-day keyed values; for monthly benchmarks, expect repeated values across days within a period where the rate is unchanged.
cURL
JSON response (example)
How to consume:
- rates.SELIC is a date-keyed map. Iterate in chronological order for charts or compute month-end snapshots.
- frequencies.SELIC and currencies.SELIC help you normalize across symbols if you compare different benchmarks.
Python (requests)
import requests
from datetime import date
params = dict(
start='2025-11-15',
end='2026-11-15',
symbols='SELIC',
api_key='YOUR_API_KEY'
)
resp = requests.get('https://interestratesapi.com/api/v1/timeseries', params=params)
ts = resp.json()
series = ts['rates']['SELIC'] # dict keyed by YYYY-MM-DD
# Example: get the last available value
last_date = max(series.keys())
last_value = series[last_date]
JavaScript (fetch)
const url = 'https://interestratesapi.com/api/v1/timeseries?start=2025-11-15&end=2026-11-15&symbols=SELIC&api_key=YOUR_API_KEY';
const res = await fetch(url);
const ts = await res.json();
const entries = Object.entries(ts.rates.SELIC).sort((a, b) => a[0].localeCompare(b[0]));
const [lastDate, lastValue] = entries[entries.length - 1];
PHP
<?php
$params = http_build_query([
'start' => '2025-11-15',
'end' => '2026-11-15',
'symbols' => 'SELIC',
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/timeseries?$params";
$data = json_decode(file_get_contents($url), true);
$series = $data['rates']['SELIC']; // associative array date => value
ksort($series);
$lastDate = array_key_last($series);
$lastValue = $series[$lastDate];
?>
5) Range statistics for SELIC with /fluctuation
/fluctuation computes change, change_pct, and the high/low over a period. This is useful for risk monitoring, month-over-month summaries, and alerts.
cURL
JSON response (example)
Interpretation:
- change is end_value - start_value.
- change_pct is percentage change relative to start_value (null if start_value is 0).
- Use high and low to show range charts or trigger thresholds.
Python (requests)
import requests
params = dict(
start='2025-11-15',
end='2026-11-15',
symbols='SELIC',
api_key='YOUR_API_KEY'
)
resp = requests.get('https://interestratesapi.com/api/v1/fluctuation', params=params)
fx = resp.json()
metrics = fx['rates']['SELIC']
change_pct = metrics['change_pct']
JavaScript (fetch)
const res = await fetch(
'https://interestratesapi.com/api/v1/fluctuation?start=2025-11-15&end=2026-11-15&symbols=SELIC&api_key=YOUR_API_KEY'
);
const stats = await res.json();
const selicStats = stats.rates.SELIC;
const { change, change_pct, high, low } = selicStats;
PHP
<?php
$params = http_build_query([
'start' => '2025-11-15',
'end' => '2026-11-15',
'symbols' => 'SELIC',
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/fluctuation?$params";
$data = json_decode(file_get_contents($url), true);
$selicStats = $data['rates']['SELIC'];
$change = $selicStats['change'];
$changePct = $selicStats['change_pct'];
?>
6) SELIC OHLC with /ohlc
/ohlc rolls daily data into candlestick-style periods (monthly by default). Even for monthly policy rates, OHLC can be practical for dashboards that unify visualization across multiple symbols.
cURL
JSON response (example)
Notes:
- data_points is the count of daily data contributing to the aggregation window.
- period is returned as YYYY-MM for monthly aggregates.
Python (requests)
import requests
params = dict(
symbols='SELIC',
period='monthly',
start='2025-11-15',
end='2026-11-15',
api_key='YOUR_API_KEY'
)
resp = requests.get('https://interestratesapi.com/api/v1/ohlc', params=params)
ohlc = resp.json()
row = ohlc['rates']['SELIC'][0]
open_, high, low, close = row['open'], row['high'], row['low'], row['close']
JavaScript (fetch)
const url = 'https://interestratesapi.com/api/v1/ohlc?symbols=SELIC&period=monthly&start=2025-11-15&end=2026-11-15&api_key=YOUR_API_KEY';
const res = await fetch(url);
const ohlc = await res.json();
const firstCandle = ohlc.rates.SELIC[0];
const { open, high, low, close, data_points } = firstCandle;
PHP
<?php
$params = http_build_query([
'symbols' => 'SELIC',
'period' => 'monthly',
'start' => '2025-11-15',
'end' => '2026-11-15',
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/ohlc?$params";
$data = json_decode(file_get_contents($url), true);
$candle = $data['rates']['SELIC'][0];
$open = $candle['open'];
$close = $candle['close'];
?>
7) SELIC loan comparison with /convert
/convert compares simple-loan interest cost between two symbols using the latest rate for each. You can benchmark loans indexed to SELIC against another policy or reference rate while controlling the amount and term.
cURL
JSON response (example)
How to use this output:
- difference.rate_spread is the latest-rate difference between the two symbols.
- total_interest and total_payment compute a simple loan using those latest rates and your term.
Python (requests)
import requests
params = dict(from='SELIC', to='ECB_MRO', amount=100000, term_months=12, api_key='YOUR_API_KEY')
res = requests.get('https://interestratesapi.com/api/v1/convert', params=params)
cmp = res.json()
spread = cmp['difference']['rate_spread']
JavaScript (fetch)
const res = await fetch(
'https://interestratesapi.com/api/v1/convert?from=SELIC&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY'
);
const cmp = await res.json();
const spread = cmp.difference.rate_spread;
PHP
<?php
$params = http_build_query([
'from' => 'SELIC',
'to' => 'ECB_MRO',
'amount' => 100000,
'term_months' => 12,
'api_key' => 'YOUR_API_KEY'
]);
$url = "https://interestratesapi.com/api/v1/convert?$params";
$data = json_decode(file_get_contents($url), true);
$spread = $data['difference']['rate_spread'];
?>
Reading fields correctly: rates, dates, currencies, and frequency
Across endpoints, SELIC data appears under consistent keys. Keep these rules in your integrations:
- rates: The core numeric values, annualized percentage rates.
- dates: Per-symbol effective dates—always align your business logic to these timestamps for month-end cutovers and audit trails.
- currencies: Per-symbol currency codes. SELIC is denominated in BRL per the official latest sample.
- frequencies: Describes data frequency where present; SELIC is monthly, which influences how you chart and aggregate values.
Practical implementation notes for SELIC
Publication and business day nuances
SELIC is modeled as monthly in this API. For historical calls within a month, the API ties your requested date to the last day with data for that month. For monitoring changes, track the dates map and poll as needed around expected committee decision days or month-end. Within many months, you may see flat lines in daily time series until updates publish.
Caching strategy
- Cache /latest SELIC until the dates.SELIC changes or your scheduled refresh cycle runs (e.g., daily or around policy announcements).
- Cache /timeseries windows by month to avoid re-fetching static history.
- Respect 429 responses. Use Retry-After and the X-RateLimit-Reset header to schedule retries.
Error handling patterns
- 401/403: Ensure api_key is present and the account is active.
- 404: No data for symbol or date range—read any details field for available ranges and adjust queries accordingly.
- 422: Validate date formats (YYYY-MM-DD) and symbol names (must match exactly: SELIC).
- 429: Back off using Retry-After and consider jittered retries.
Computing a spread and monthly payment from SELIC
To compute a spread, obtain two latest rates (e.g., SELIC vs another symbol like ECB_MRO) and compute simple difference: spread = rate_A - rate_B. For user-facing displays, show both the absolute spread and its sign. You can also use /convert to produce a complete loan comparison without implementing the math yourself.
For a monthly payment estimate using a nominal annual SELIC rate r expressed as a percentage (e.g., 13.75), convert to a monthly rate m = r/100/12 and use the standard amortization formula for principal P over N months:
- Payment = P × m × (1 + m)^N / ((1 + m)^N − 1)
If you need a simple-interest approximation, multiply the annual rate by principal and pro-rate by months: interest = P × (r/100) × (N/12). Choose accordingly based on your product spec. Always use the dates map when storing historical payments for auditability.
Common fintech use cases with SELIC
- Loan pricing engines: index local lending products to SELIC, and refresh models when dates.SELIC rolls forward.
- Macro dashboards: chart SELIC time series with /timeseries and overlay OHLC for a unified look with other benchmarks.
- Risk/ALM: summarize period changes via /fluctuation and trigger alerts on high/low breaks or change_pct thresholds.
- Portfolio analytics: compute rate spreads and sensitivity to SELIC moves; store monthly levels for scenario analysis.
- Treasury tools: compare funding indexed to SELIC vs alternatives using /convert for quick cost deltas.
Putting it together: integration checklist
- Authentication: always pass api_key as a query parameter.
- Symbol accuracy: use SELIC exactly as the symbol for Brazil’s policy rate.
- Time logic: read dates.SELIC to match values to their effective dates.
- Frequency awareness: treat SELIC as a monthly series in your UI and caches.
- Error and backoff: handle 4xx/5xx errors; respect rate limit headers on 429.
Full endpoint catalog recap for SELIC
- /symbols: discover SELIC and metadata.
- /latest: get the current SELIC, effective date, and currency.
- /historical: fetch SELIC on a given date, with monthly mapping rules.
- /timeseries: build SELIC panels for ranges; iterate date-keyed values.
- /fluctuation: compute change, change_pct, high, low over a range.
- /ohlc: view SELIC in OHLC aggregates for consistent dashboards.
- /convert: compare loan interest based on the latest SELIC vs another symbol.
Where to go next
Explore the full method catalogue and field behavior at the MCP, and get your api_key to start building.
Register for an API key and wire SELIC into your pricing engines, dashboards, and analytics today. Also visit interestratesapi.com for product details.
FAQ
Q: Is SELIC returned as a percentage or decimal?
A: As a percentage (e.g., 13.75 means 13.75% per year). Convert to decimals for math by dividing by 100.
Q: How should I handle dates for monthly SELIC?
A: Use the dates map to align values to effective dates. For /historical mid-month requests, the API uses the last available day with data in that month.
Q: Can I compare SELIC against another policy rate?
A: Yes. Use /latest to fetch both rates, compute a spread directly, or call /convert to get a simple-loan comparison with total interest and total payment.
Q: How do I avoid unnecessary polling?
A: Cache /latest results and check dates.SELIC for changes. For broader ranges, cache /timeseries by month. Respect 429 responses and Retry-After headers.
Q: What error responses should I expect?
A: Standardized errors with success=false. Common cases include 401/403 for authentication, 404 for missing data, 422 for validation issues, and 429 for rate limits.