API to Get the Banxico (BANXICO_RATE) Rate

API to Get the Banxico (BANXICO_RATE) Rate

You need a reliable way to pull the Banco de México overnight policy rate directly into your code, keep it updated on business cycles, and compute downstream metrics like spreads and payments without building data plumbing by hand. By the end of this guide, you’ll fetch BANXICO_RATE over HTTPS, interpret effective dates and currencies, handle time series and OHLC, summarize fluctuations, and plug the rate into finance calculations inside your fintech application or analytics stack.

What BANXICO_RATE Represents and How It’s Expressed

BANXICO_RATE is the Banco de México (Banxico) overnight policy rate, exposed by the Interest Rates API as a central bank benchmark in MXN with monthly frequency. Central bank policy rates anchor a country’s monetary stance; downstream markets (interbank, lending, deposits, and fixed income) price relative to this benchmark.

Illustration: API to Get the Banxico (BANXICO_RATE) Rate

Key properties for developers:

  • Symbol: BANXICO_RATE
  • Category: central_bank
  • Currency: MXN
  • Frequency: monthly (effective on policy/business days; API supplies date fields)
  • Units: Percentage per annum (e.g., 6.5 means 6.5% annualized)

When you read a rate value from the API, it is a percentage value per annum. Use the dates map to understand which calendar day the value applies to, and the currencies map to confirm the currency context (here: MXN).

All endpoints are documented at interestratesapi.com. You’ll call them with HTTP GET and authenticate via the api_key query parameter on the base URL https://interestratesapi.com/api/v1/. To start building, get your credentials at the Register page and keep the API reference open in the MCP.

How Often Is BANXICO_RATE Published? Handling Frequency, Business Days, and Caching

BANXICO_RATE is monthly in this API. That means you should expect one value per month, and you’ll see the date for the latest publication in the dates field. For month-spanning endpoints (historical, time series), the API uses the last day with data inside the month when you query a specific date for a monthly symbol.

Operational tips:

  • Business days: Central bank decisions occur on scheduled dates; the value is treated as effective starting on the published effective date. If a date falls on a non-business day, handle next/previous business day logic in your app’s scheduling.
  • Time zones: Dates are UTC-normalized strings in YYYY-MM-DD. Treat them as date-only; don’t convert to local time components.
  • Caching: Because the rate updates monthly, it’s safe to cache the latest response daily (or even per session) to reduce API calls. For timeseries and OHLC, cache for the query window unless your app re-requests after a new month starts.

Discovering Symbols: /symbols

Use the catalogue to confirm the symbol identifier and metadata. BANXICO_RATE appears under the central_bank category and MXN currency.

cURL

curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=BANXICO_RATE"

JSON response example

{
    "success": true,
    "date": "2026-09-30",
    "base": "MXN",
    "rates": {
        "BANXICO_RATE": 6.5
    },
    "dates": {
        "BANXICO_RATE": "2026-09-30"
    },
    "currencies": {
        "BANXICO_RATE": "MXN"
    },
    "base_filter_note": null
}

Field notes:

  • symbol: The identifier you’ll use in all other endpoints (e.g., BANXICO_RATE).
  • frequency: Tells you how to interpret date fields downstream (BANXICO_RATE is monthly).

Python (requests)

import requests

params = {
'category': 'central_bank',
'base': 'MXN',
'api_key': 'YOUR_KEY',
}
resp = requests.get('https://interestratesapi.com/api/v1/symbols', params=params)
data = resp.json()
# Filter for BANXICO_RATE in data['symbols'] if needed.

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=MXN&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
// Locate BANXICO_RATE in json.symbols

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=MXN&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
// Iterate $data['symbols'] to find BANXICO_RATE
?>

Get the Latest BANXICO_RATE: /latest

Fetch the most recent monthly policy rate with its effective date and currency. Use these fields for dashboards, alerts, and pricing engines.

Official cURL (copy-paste)

Official JSON

How to read this:

  • rates.BANXICO_RATE is the annualized percentage value.
  • dates.BANXICO_RATE is the effective date for the current monthly observation.
  • currencies.BANXICO_RATE confirms the rate is denominated in MXN context.
  • date and base summarize the response.

Python (requests)

import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/latest',
params={'symbols': 'BANXICO_RATE', 'api_key': 'YOUR_KEY'}
)
data = resp.json()
rate = data['rates']['BANXICO_RATE']
effective_date = data['dates']['BANXICO_RATE']
currency = data['currencies']['BANXICO_RATE']

JavaScript (fetch)

const response = await fetch(
'https://interestratesapi.com/api/v1/latest?symbols=BANXICO_RATE&api_key=YOUR_KEY'
);
const data = await response.json();
const rate = data.rates.BANXICO_RATE;
const effectiveDate = data.dates.BANXICO_RATE;
const currency = data.currencies.BANXICO_RATE;

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/latest?symbols=BANXICO_RATE&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$rate = $data['rates']['BANXICO_RATE'];
$effectiveDate = $data['dates']['BANXICO_RATE'];
$currency = $data['currencies']['BANXICO_RATE'];
?>

Historical Value on a Date: /historical

Request the rate as of a specific calendar day. For monthly symbols, the API returns the last day with data inside that month. This is ideal for end-of-month snapshots or period-over-period calculations.

cURL

JSON response example

Field notes:

  • date echoes the requested date. For monthly series, the value reflects the observation within that month.
  • rates holds the policy rate value for the symbol on that date’s month.

Python (requests)

import requests

params = {'date': '2025-06-15', 'symbols': 'BANXICO_RATE', 'api_key': 'YOUR_KEY'}
resp = requests.get('https://interestratesapi.com/api/v1/historical', params=params)
data = resp.json()
value = data['rates']['BANXICO_RATE']

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=BANXICO_RATE&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const value = json.rates.BANXICO_RATE;

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=BANXICO_RATE&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$value = $data['rates']['BANXICO_RATE'];
?>

Continuous Series Between Dates: /timeseries

Use the timeseries endpoint to pull daily-observation rows over a window. Even for a monthly symbol, you may see repeated values across business days within a month, useful for charting or aligning with other daily data.

cURL

JSON response example

Field notes:

  • rates.BANXICO_RATE maps ISO dates to values. For monthly symbols, the observation often repeats for business days in the effective period.
  • frequencies summarizes the granularity returned.

Python (requests)

import requests

params = {
'start': '2025-11-01',
'end': '2026-11-01',
'symbols': 'BANXICO_RATE',
'api_key': 'YOUR_KEY',
}
resp = requests.get('https://interestratesapi.com/api/v1/timeseries', params=params)
data = resp.json()
series = data['rates']['BANXICO_RATE'] # dict of date -> value

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/timeseries?start=2025-11-01&end=2026-11-01&symbols=BANXICO_RATE&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const series = json.rates.BANXICO_RATE; // { 'YYYY-MM-DD': value }

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/timeseries?start=2025-11-01&end=2026-11-01&symbols=BANXICO_RATE&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$series = $data['rates']['BANXICO_RATE']; // associative array date => value
?>

Summarize Change Over a Range: /fluctuation

Compute change, percent change, and high/low across a date window without pulling the full series client-side. Handy for KPIs and monitoring.

cURL

JSON response example

Field notes:

  • change is end minus start; change_pct is percentage relative to start_value.
  • high/low are extrema in the window, based on daily observations.

Python (requests)

import requests

params = {'start': '2025-11-01', 'end': '2026-11-01', 'symbols': 'BANXICO_RATE', 'api_key': 'YOUR_KEY'}
resp = requests.get('https://interestratesapi.com/api/v1/fluctuation', params=params)
fx = resp.json()['rates']['BANXICO_RATE']
change = fx['change']
pct = fx['change_pct']

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/fluctuation?start=2025-11-01&end=2026-11-01&symbols=BANXICO_RATE&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const stats = json.rates.BANXICO_RATE;
const { start_value, end_value, change, change_pct, high, low } = stats;

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/fluctuation?start=2025-11-01&end=2026-11-01&symbols=BANXICO_RATE&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$fx = $data['rates']['BANXICO_RATE'];
$change = $fx['change'];
$changePct = $fx['change_pct'];
?>

Compute OHLC for Charting: /ohlc

Obtain open, high, low, close aggregates computed from daily data for weekly, monthly, or quarterly groupings. Even though BANXICO_RATE is monthly, OHLC is still useful for normalized chart structures and candlestick visualizations.

cURL

JSON response example

Field notes:

  • open/high/low/close are computed from daily observations inside each period—no separate OHLC dataset is stored.
  • data_points indicates the number of underlying daily values used for the aggregate, helpful for data-quality checks.

Python (requests)

import requests

params = {
'symbols': 'BANXICO_RATE',
'period': 'monthly',
'start': '2025-11-01',
'end': '2026-11-01',
'api_key': 'YOUR_KEY',
}
resp = requests.get('https://interestratesapi.com/api/v1/ohlc', params=params)
data = resp.json()
ohlc = data['rates']['BANXICO_RATE'] # list of dicts with period/open/high/low/close

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/ohlc?symbols=BANXICO_RATE&period=monthly&start=2025-11-01&end=2026-11-01&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const ohlc = json.rates.BANXICO_RATE; // [{ period, open, high, low, close, data_points }]

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/ohlc?symbols=BANXICO_RATE&period=monthly&start=2025-11-01&end=2026-11-01&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$ohlc = $data['rates']['BANXICO_RATE'];
?>

Compare Loan Interest Using BANXICO_RATE: /convert

This endpoint compares total interest cost between two benchmark rates for a simple loan over a chosen term. It fetches each rate’s latest value and computes total interest and payment based on a simple-rate model.

cURL

JSON response example

Field notes:

  • from and to each include the latest rate, valuation date, and computed totals for the specified amount and term.
  • difference.rate_spread gives the simple spread between the two latest rates.

Python (requests)

import requests

params = {
'from': 'BANXICO_RATE',
'to': 'ECB_MRO',
'amount': 100000,
'term_months': 12,
'api_key': 'YOUR_KEY',
}
resp = requests.get('https://interestratesapi.com/api/v1/convert', params=params)
data = resp.json()
spread = data['difference']['rate_spread']

JavaScript (fetch)

const url = 'https://interestratesapi.com/api/v1/convert?from=BANXICO_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const spread = json.difference.rate_spread;

PHP

<?php
$url = 'https://interestratesapi.com/api/v1/convert?from=BANXICO_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
$spread = $data['difference']['rate_spread'];
?>

Practical Finance: Spreads and Monthly Payment Calculations

With the returned BANXICO_RATE, you can compute:

  • Rate spread vs. another benchmark: spread = r1 − r2. For example, the difference.rate_spread in the convert response shows the arithmetic difference in percentage points between the two latest rates.
  • Monthly payment (amortizing, fixed-rate model): Given principal P, annual rate r (as a decimal, e.g., 0.065), and n months, the monthly periodic rate i = r/12. The standard annuity payment is: Payment = P × i / (1 − (1 + i)^(-n)). This formula uses the API’s percentage rate divided by 100 to form r.

Note: The API provides the rate as a percentage. Always divide by 100 for finance formulas (e.g., 6.5% becomes 0.065). For interest-only periods or simple interest calculations, adapt formulas accordingly; the API does not enforce a specific loan amortization model.

Error Handling, Rate Limits, and Reliability

All endpoints return structured errors with success=false and an error message. Common cases:

  • 401: Missing or invalid api_key.
  • 403: Account without active plan.
  • 404: No symbols matched or no data for requested date/range (may include details about available ranges).
  • 422: Validation error (date format or symbol typos).
  • 429: Request quota exhausted; check Retry-After, X-RateLimit-* headers.

To maximize uptime, validate symbols (via /symbols), cache /latest for the day, debounce user-driven ranges, and handle 429s with incremental backoff. Keep links to interestratesapi.com handy while developing.

Real-World Use Cases for BANXICO_RATE

  • Interest rate dashboards: Display the current Banxico policy rate with its effective date, monthly change (via /fluctuation), and a sparkline built from /timeseries.
  • Loan pricing: Benchmark floating-rate MXN loans as margin over BANXICO_RATE and compute expected payments with the annuity formula. Recompute when /latest changes month to month.
  • Macro research: Correlate BANXICO_RATE movements to inflation, growth, or FX series by aligning dates from /timeseries and aggregating with /ohlc.
  • Risk models: Stress-test portfolios by shifting BANXICO_RATE by user-defined shocks and recomputing loan or bond cashflows, with validation against /historical snapshots.

Putting It Together: A Minimal Integration Flow

  1. Confirm the symbol and metadata once via /symbols.
  2. Fetch /latest BANXICO_RATE on startup and cache for the session or day.
  3. For charts, pull /timeseries for the last 12–24 months; refresh when a new month begins.
  4. For summaries, use /fluctuation to compute month-to-date or year-to-date deltas.
  5. For visuals, obtain /ohlc monthly series for candlesticks or standard OHLC plotting.
  6. If comparing lending benchmarks, call /convert with BANXICO_RATE as the “from” rate.

All endpoints are GET and authenticated with api_key. Base URL is https://interestratesapi.com/api/v1/. Explore details in the MCP and test live calls from your terminal.

FAQ

How is BANXICO_RATE expressed?
As a percentage per annum. Convert to decimal by dividing by 100 for calculations. For monthly payments, use r/12 as the periodic rate.

What does the date field represent?
Use dates.BANXICO_RATE to read the effective date of the current observation. For monthly symbols in /historical, the API returns the last day with data within the requested month.

How often should I refresh the latest value?
BANXICO_RATE is monthly; refreshing daily is generally sufficient. On decision days or at month boundaries, re-fetch immediately after publication.

How can I compute the spread against another benchmark?
Either subtract rates you fetch via /latest or use the difference.rate_spread field from the /convert endpoint when comparing BANXICO_RATE to another symbol.

What should I do on a 404 for a given date?
Check the details field if present for the available range and adjust your start/end or the date to a month known to have data.

Ready to wire up BANXICO_RATE in your finance app? Start building with the Interest Rates API at interestratesapi.com and get your credentials here: Register. If you need endpoint-level details while coding, keep the MCP open in a side tab.

Ready to get started?

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

Get API Key