Banxico Historical Data API: Timeseries, Charts & Downloads

Banxico Historical Data API: Timeseries, Charts & Downloads

Introduction

In the world of finance, access to accurate and timely interest rate data is crucial for developers, economists, and financial analysts. The Banxico Historical Data API provides a robust solution for retrieving interest rate data, specifically the Banxico Overnight Rate (BANXICO_RATE). This API allows users to access historical data, perform time series analysis, and visualize trends through charts. In this blog post, we will explore the capabilities of the Banxico Historical Data API, focusing on its endpoints, practical implementations, and how it can enhance financial applications.

Understanding the Banxico Historical Data API

The Banxico Historical Data API is part of the Interest Rates API, which offers a comprehensive suite of endpoints designed to facilitate the retrieval of interest rate data. The API is particularly valuable for developers building fintech applications, as it provides essential data for financial modeling, risk assessment, and economic analysis.

Key features of the API include:

  • Access to the latest interest rates and historical data.
  • Time series data for trend analysis.
  • OHLC (Open, High, Low, Close) data for candlestick charting.
  • Conversion capabilities for comparing loan interest costs.

API Endpoints Overview

The Banxico Historical Data API consists of several endpoints, each serving a specific purpose. Below, we will discuss each endpoint in detail, including its functionality, request format, and example responses.

1. Retrieve Available Symbols

The first step in using the API is to retrieve the available symbols for interest rates. This can be done using the /api/v1/symbols endpoint.

Request Example:

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

JSON Response Example:


{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "BANXICO_RATE",
"name": "Banxico Overnight Rate",
"category": "central_bank",
"country_code": "MX",
"currency_code": "MXN",
"frequency": "monthly",
"description": "The interest rate set by the Bank of Mexico for overnight loans."
}
]
}

This endpoint provides a list of available symbols, allowing developers to understand which rates they can query.

2. Get Latest Rates

To retrieve the latest value for a specific symbol, use the /api/v1/latest endpoint. This is particularly useful for applications that require real-time data.

Request Example:

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

JSON Response Example:


{
"success": true,
"date": "2026-08-03",
"base": "MXN",
"rates": {
"BANXICO_RATE": 5.33
},
"dates": {
"BANXICO_RATE": "2026-08-03"
},
"currencies": {
"BANXICO_RATE": "MXN"
}
}

This endpoint returns the most recent interest rate for the specified symbol, along with the date and currency information.

3. Historical Data Retrieval

For point-in-time lookups, the /api/v1/historical endpoint allows users to fetch the value of a symbol on a specific date.

Request Example:

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

JSON Response Example:


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

This endpoint is essential for analyzing historical trends and understanding how interest rates have changed over time.

4. Time Series Data

The /api/v1/timeseries endpoint is particularly powerful for developers looking to analyze trends over a specified date range. This endpoint allows users to retrieve a series of values between two dates.

Request Example:

curl "https://interestratesapi.com/api/v1/timeseries?start=2025-08-03&end=2026-08-03&symbols=BANXICO_RATE&api_key=YOUR_KEY"

JSON Response Example:


{
"success": true,
"base": "MXN",
"start_date": "2025-08-03",
"end_date": "2026-08-03",
"rates": {
"BANXICO_RATE": {
"2025-08-03": 5.33,
"2025-08-04": 5.35,
"2025-08-05": 5.34
}
},
"frequencies": {
"BANXICO_RATE": "daily"
},
"currencies": {
"BANXICO_RATE": "MXN"
}
}

This endpoint is ideal for conducting time series analysis, allowing users to visualize trends and fluctuations in interest rates over time.

5. Fluctuation Statistics

The /api/v1/fluctuation endpoint provides change statistics over a specified range, which is useful for understanding the volatility of interest rates.

Request Example:

curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-08-03&end=2026-08-03&symbols=BANXICO_RATE&api_key=YOUR_KEY"

JSON Response Example:


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

This endpoint helps users assess the performance of interest rates over time, providing insights into market behavior.

6. OHLC Data for Charting

The /api/v1/ohlc endpoint allows users to retrieve OHLC data, which is essential for creating candlestick charts. This is particularly useful for visualizing trends in financial data.

Request Example:

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

JSON Response Example:


{
"success": true,
"period": "monthly",
"start_date": "2025-08-03",
"end_date": "2026-08-03",
"rates": {
"BANXICO_RATE": [
{
"period": "2025-08",
"open": 5.50,
"high": 5.55,
"low": 5.33,
"close": 5.33,
"data_points": 23
}
]
}
}

This endpoint is crucial for developers looking to create visual representations of interest rate trends, enhancing the analytical capabilities of their applications.

7. Loan Interest Cost Comparison

The /api/v1/convert endpoint allows users to compare the total interest cost of loans between two different rates. This is particularly useful for financial analysts assessing loan options.

Request Example:

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

JSON Response Example:


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

This endpoint provides valuable insights for financial decision-making, allowing users to evaluate the cost-effectiveness of different loan options.

Implementing the Banxico Historical Data API

To effectively utilize the Banxico Historical Data API, developers can implement various strategies for data retrieval and analysis. Below, we will outline a Python data pipeline that fetches data, processes it, and exports it to CSV or Parquet formats.

Python Data Pipeline Example

Here’s a complete example of how to fetch data from the Banxico Historical Data API using Python, process it with Pandas, and export it to a CSV file:

import requests
import pandas as pd

# Define API endpoint and parameters
url = 'https://interestratesapi.com/api/v1/timeseries'
params = {
'start': '2025-08-03',
'end': '2026-08-03',
'symbols': 'BANXICO_RATE',
'api_key': 'YOUR_KEY'
}

# Fetch data from API
response = requests.get(url, params=params)
data = response.json()

# Process data into a DataFrame
dates = data['rates']['BANXICO_RATE']
df = pd.DataFrame(list(dates.items()), columns=['Date', 'BANXICO_RATE'])
df['Date'] = pd.to_datetime(df['Date'])

# Export to CSV
df.to_csv('banxico_rates.csv', index=False)

This pipeline demonstrates how to automate the retrieval and processing of interest rate data, making it easier for developers to integrate this information into their applications.

Common Pitfalls in Time Series Analysis

When working with time series data, developers should be aware of several common pitfalls:

  • Missing Dates: Ensure that your analysis accounts for weekends and holidays when data may not be available.
  • Frequency Considerations: Understand the frequency of the data (daily vs. monthly) and how it impacts your analysis.
  • Data Points Interpretation: Be cautious when interpreting the number of data points, as it may vary based on the frequency of the data.

By being aware of these issues, developers can enhance the accuracy and reliability of their financial analyses.

Conclusion

The Banxico Historical Data API is an invaluable resource for developers and financial analysts seeking to access and analyze interest rate data. With its comprehensive endpoints, users can retrieve historical data, perform time series analysis, and visualize trends effectively. By leveraging this API, developers can build robust fintech applications that provide critical insights into interest rate movements.

For more information and to explore the features of the Banxico Historical Data API, visit Interest Rates API. Start building your financial applications today!

Ready to get started?

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

Get API Key

Related posts