Introduction
In the world of finance, accurate and timely interest rate data is crucial for making informed decisions. Whether you are a developer building fintech applications, an economist analyzing market trends, or a quantitative analyst working on financial models, having access to reliable interest rate data can significantly enhance your work. The Mexican Interbank Equilibrium Interest Rate (TIIE) is one such critical data point that financial professionals rely on. This blog post will explore how to access 28-day historical data for the TIIE through the Interest Rates API, focusing on time series analysis, data visualization, and practical implementation strategies.
Understanding the Mexican Interbank Equilibrium Interest Rate (TIIE)
The TIIE is a benchmark interest rate used in Mexico, reflecting the average rate at which banks lend to one another. It plays a vital role in the financial system, influencing lending rates for consumers and businesses alike. By analyzing historical TIIE data, financial professionals can gain insights into market trends, assess risk, and make informed investment decisions.
Accessing TIIE data through the Interest Rates API allows users to retrieve historical rates, perform time series analysis, and visualize trends effectively. The API provides various endpoints that cater to different data retrieval needs, making it a powerful tool for developers and analysts alike.
Key Features of the Interest Rates API
The Interest Rates API offers several endpoints that facilitate the retrieval of interest rate data. Below are the key features relevant to accessing the TIIE data:
- /api/v1/symbols: Retrieve a catalogue of available rate symbols, including TIIE.
- /api/v1/latest: Get the latest value for the TIIE and other interest rates.
- /api/v1/historical: Access historical data for the TIIE on specific dates.
- /api/v1/timeseries: Fetch a series of TIIE data between two dates for time series analysis.
- /api/v1/ohlc: Obtain OHLC (Open, High, Low, Close) data for candlestick charting.
- /api/v1/fluctuation: Analyze changes in the TIIE over a specified date range.
- /api/v1/convert: Compare loan interest costs between different rates.
Retrieving Historical Data with the /timeseries Endpoint
The /timeseries endpoint is particularly useful for fetching multi-year data for the TIIE. This endpoint allows users to specify a date range and retrieve daily or monthly data points, making it ideal for time series analysis.
To use the /timeseries endpoint, you need to specify the start and end dates, along with the symbol for the TIIE. Here’s how you can make a request:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-01-01&end=2026-01-01&symbols=TIIE&api_key=YOUR_KEY"
The expected JSON response will look like this:
{
"success": true,
"base": "MXN",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"TIIE": {
"2025-01-01": 5.25,
"2025-01-02": 5.30,
"2025-01-03": 5.28
}
},
"frequencies": {
"TIIE": "daily"
},
"currencies": {
"TIIE": "MXN"
}
}
This response provides a comprehensive view of the TIIE rates over the specified period, allowing for detailed analysis and visualization.
Point-in-Time Lookups with the /historical Endpoint
For scenarios where you need to retrieve the TIIE for a specific date, the /historical endpoint is the perfect solution. This endpoint allows you to specify a date and get the corresponding TIIE value.
Here’s an example of how to use the /historical endpoint:
curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=TIIE&api_key=YOUR_KEY"
The JSON response will be structured as follows:
{
"success": true,
"date": "2025-06-15",
"base": "MXN",
"rates": {
"TIIE": 5.40
},
"currencies": {
"TIIE": "MXN"
}
}
This response provides the TIIE value for June 15, 2025, allowing for precise historical analysis.
Visualizing Data with the /ohlc Endpoint
To create candlestick charts for the TIIE, the /ohlc endpoint is invaluable. This endpoint computes OHLC data on-the-fly from daily data, enabling users to visualize trends effectively.
To retrieve OHLC data for the TIIE, you can use the following request:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=TIIE&period=monthly&start=2025-01-01&end=2026-01-01&api_key=YOUR_KEY"
The expected JSON response will look like this:
{
"success": true,
"period": "monthly",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"TIIE": [
{
"period": "2025-01",
"open": 5.25,
"high": 5.30,
"low": 5.20,
"close": 5.28,
"data_points": 23
}
]
}
}
This response provides the necessary data to create candlestick charts, which can be integrated into applications using libraries like Chart.js or Plotly.
Building a Python Data Pipeline
For developers looking to automate the retrieval and processing of TIIE data, building a Python data pipeline is an effective approach. Below is a complete example of how to fetch TIIE data, store it in a Pandas DataFrame, and export it to CSV or Parquet format.
import requests
import pandas as pd
# Fetch TIIE timeseries data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-01-01', end='2026-01-01', symbols='TIIE', api_key='YOUR_KEY')
)
data = response.json()
# Convert to DataFrame
dates = data['rates']['TIIE'].keys()
values = data['rates']['TIIE'].values()
df = pd.DataFrame(list(zip(dates, values)), columns=['Date', 'TIIE'])
# Export to CSV
df.to_csv('tiie_data.csv', index=False)
# Export to Parquet
df.to_parquet('tiie_data.parquet', index=False)
This pipeline automates the data retrieval process and allows for easy storage and further analysis.
Common Pitfalls in Time Series Analysis
When working with time series data, there are several pitfalls to be aware of:
- Missing Dates: Ensure that your analysis accounts for weekends and holidays when the TIIE may not be available.
- Frequency Considerations: Be mindful of the frequency of the data (daily vs. monthly) and how it impacts your analysis.
- Data Points Interpretation: Understand how the number of data points affects the reliability of your analysis, especially for monthly symbols.
Conclusion
Accessing and analyzing the Mexican Interbank Equilibrium Interest Rate (TIIE) through the Interest Rates API provides financial professionals with a powerful tool for making informed decisions. By leveraging the various endpoints available, users can retrieve historical data, perform time series analysis, and visualize trends effectively. Whether you are building a fintech application or conducting economic research, the Interest Rates API is an invaluable resource.
For more information on how to get started, visit Get started with Interest Rates API. Explore the full range of features available at Explore Interest Rates API features and see how it can enhance your financial data analysis.




