The financial landscape is constantly evolving, and access to accurate interest rate data is crucial for developers, economists, and financial analysts. The TCMB Historical Data API from Interest Rates API provides a comprehensive solution for retrieving interest rate data, including central bank rates, interbank rates, and financial time series analysis. This blog post will delve into the features and capabilities of the TCMB Historical Data API, focusing on the TCMB_RATE, the Central Bank of Turkey Policy Rate, and how developers can leverage this API for their fintech applications.
Understanding the TCMB Historical Data API
The TCMB Historical Data API is designed to provide developers with easy access to historical and current interest rate data. This API is particularly valuable for applications that require real-time financial data, such as trading platforms, economic research tools, and financial analytics dashboards. By utilizing the TCMB Historical Data API, developers can efficiently integrate interest rate data into their applications, enabling better decision-making and analysis.
Key features of the TCMB Historical Data API include:
- Access to a wide range of interest rate symbols, including TCMB_RATE.
- Endpoints for retrieving the latest rates, historical data, time series data, and fluctuation statistics.
- Support for various programming languages, including cURL, Python, JavaScript, and PHP.
Getting Started with the API
To begin using the TCMB Historical Data API, developers need to familiarize themselves with the available endpoints and their functionalities. The API uses the GET method for all requests, and authentication is handled through the api_key query parameter.
Endpoint Overview
The following endpoints are available in the TCMB Historical Data API:
- GET /api/v1/symbols: Retrieve a catalogue of available rate symbols.
- GET /api/v1/latest: Get the latest value per symbol.
- GET /api/v1/historical: Retrieve the value on a specific date.
- GET /api/v1/timeseries: Get a series of values between two dates.
- GET /api/v1/fluctuation: Get change statistics over a range.
- GET /api/v1/ohlc: Retrieve OHLC candlestick data.
- GET /api/v1/convert: Compare loan interest costs between two rates.
Using the /timeseries Endpoint
The /timeseries endpoint is particularly useful for developers looking to analyze historical interest rate data over a specified date range. This endpoint allows users to retrieve a series of values for a given symbol, such as TCMB_RATE, between two dates.
Request Format
The request format for the /timeseries endpoint is as follows:
GET https://interestratesapi.com/api/v1/timeseries?start=YYYY-MM-DD&end=YYYY-MM-DD&symbols=TCMB_RATE&api_key=YOUR_KEY
Example Request
To retrieve the TCMB_RATE data from May 20, 2025, to May 20, 2026, the following cURL command can be used:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-05-20&end=2026-05-20&symbols=TCMB_RATE&api_key=YOUR_KEY"
Example Response
The response from the /timeseries endpoint will include the historical rates for the specified date range:
{
"success": true,
"base": "USD",
"start_date": "2025-05-20",
"end_date": "2026-05-20",
"rates": {
"TCMB_RATE": {
"2025-01-02": 5.33,
"2025-01-03": 5.33,
"2025-01-06": 5.33
}
},
"frequencies": {
"TCMB_RATE": "daily"
},
"currencies": {
"TCMB_RATE": "USD"
}
}
This response provides a detailed view of the TCMB_RATE over the specified period, allowing developers to analyze trends and fluctuations in interest rates.
Point-in-Time Lookups with /historical Endpoint
The /historical endpoint is essential for retrieving the interest rate on a specific date. This is particularly useful for applications that require historical data for analysis or reporting purposes.
Request Format
The request format for the /historical endpoint is as follows:
GET https://interestratesapi.com/api/v1/historical?date=YYYY-MM-DD&symbols=TCMB_RATE&api_key=YOUR_KEY
Example Request
To retrieve the TCMB_RATE for June 15, 2025, the following cURL command can be used:
curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=TCMB_RATE&api_key=YOUR_KEY"
Example Response
The response from the /historical endpoint will provide the interest rate for the specified date:
{
"success": true,
"date": "2025-06-15",
"base": "USD",
"rates": {
"TCMB_RATE": 5.33
},
"currencies": {
"TCMB_RATE": "USD"
}
}
This response allows developers to access specific interest rate data for any given date, facilitating accurate financial analysis.
Building Candlestick Charts with /ohlc Endpoint
The /ohlc endpoint provides OHLC (Open, High, Low, Close) candlestick data, which is essential for visualizing interest rate trends over time. This data can be used to create interactive charts using libraries like Chart.js or Plotly.
Request Format
The request format for the /ohlc endpoint is as follows:
GET https://interestratesapi.com/api/v1/ohlc?symbols=TCMB_RATE&period=monthly&start=YYYY-MM-DD&end=YYYY-MM-DD&api_key=YOUR_KEY
Example Request
To retrieve monthly OHLC data for TCMB_RATE from May 20, 2025, to May 20, 2026, the following cURL command can be used:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=TCMB_RATE&period=monthly&start=2025-05-20&end=2026-05-20&api_key=YOUR_KEY"
Example Response
The response from the /ohlc endpoint will include the OHLC data for the specified period:
{
"success": true,
"period": "monthly",
"start_date": "2025-05-20",
"end_date": "2026-05-20",
"rates": {
"TCMB_RATE": [
{
"period": "2025-01",
"open": 5.50,
"high": 5.50,
"low": 5.33,
"close": 5.33,
"data_points": 23
}
]
}
}
This data can be utilized to create candlestick charts, providing visual insights into interest rate movements over time.
Implementing a Data Pipeline with Python
Developers can build a data pipeline to fetch TCMB_RATE data, process it using pandas, and export it to CSV or Parquet formats. This is particularly useful for data analysis and reporting.
Python Code Example
Below is a complete Python code snippet demonstrating how to fetch TCMB_RATE data, convert it into a pandas DataFrame, and export it to a CSV file:
import requests
import pandas as pd
# Fetching the timeseries data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-05-20', end='2026-05-20', symbols='TCMB_RATE', api_key='YOUR_KEY')
)
data = response.json()
# Processing the data into a DataFrame
dates = data['rates']['TCMB_RATE'].keys()
values = data['rates']['TCMB_RATE'].values()
df = pd.DataFrame({'Date': dates, 'TCMB_RATE': values})
# Exporting to CSV
df.to_csv('tcmb_rate_data.csv', index=False)
This code snippet demonstrates how to automate the retrieval and storage of interest rate data, enabling further analysis and reporting.
Common Pitfalls in Time Series Analysis
When working with time series data, developers should be aware of common pitfalls that can affect the accuracy and reliability of their analyses. Some of these include:
- Missing Dates: Ensure that the data retrieved covers all necessary dates, especially when analyzing trends over time.
- Frequency Considerations: Be mindful of the frequency of the data (daily vs. monthly) and how it impacts analysis.
- Data Points Interpretation: Understand how data points are calculated and represented in the API responses.
Conclusion
The TCMB Historical Data API from Interest Rates API provides a robust solution for accessing interest rate data, enabling developers to build powerful fintech applications. By leveraging the various endpoints, including /timeseries, /historical, and /ohlc, developers can gain valuable insights into interest rate trends and fluctuations. With the ability to automate data retrieval and analysis, the API streamlines the process of integrating financial data into applications, ultimately enhancing decision-making and financial analysis.
For more information on how to get started with the TCMB Historical Data API, visit Explore Interest Rates API features and Get started with Interest Rates API.




