Introduction
In the rapidly evolving world of fintech, access to accurate and timely financial data is crucial for developers, economists, and analysts. One of the key data points that financial applications often require is interest rate data, particularly from central banks. This blog post will guide you through integrating the Central Bank of Turkey's policy rate, known as TCMB_RATE, into your application using the Interest Rates API. We will cover all necessary endpoints, provide code examples, and discuss best practices for handling the data effectively.
Why Use Interest Rates API?
The Interest Rates API provides a comprehensive solution for accessing various interest rates, including central bank rates, interbank rates, and treasury rates. By leveraging this API, developers can avoid the complexities of building their own data infrastructure, saving both time and resources. The API offers reliable, real-time data that can enhance financial applications, improve decision-making, and provide valuable insights into market trends.
Getting Started with TCMB_RATE
To begin integrating TCMB_RATE data into your application, you will first need to familiarize yourself with the available endpoints. The Interest Rates API offers several endpoints that allow you to retrieve symbols, latest rates, historical data, time series, fluctuation statistics, OHLC data, and conversion comparisons. Below, we will detail each endpoint and provide practical code examples.
1. Fetching Available Symbols
The first step in using the API is to retrieve the available symbols, including TCMB_RATE. This can be done using the /api/v1/symbols endpoint.
Endpoint: GET /api/v1/symbols
This endpoint returns a catalogue of available rate symbols, allowing you to filter by category, base currency, and provider.
cURL Example:
curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=TRY&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "TCMB_RATE",
"name": "Central Bank of Turkey Policy Rate",
"category": "central_bank",
"country_code": "TR",
"currency_code": "TRY",
"frequency": "monthly",
"description": "The interest rate set by the Central Bank of Turkey."
}
]
}
This response indicates that the TCMB_RATE symbol is available for use, along with its description and other relevant details.
2. Retrieving the Latest TCMB_RATE
Once you have confirmed the availability of TCMB_RATE, the next step is to fetch the latest value using the /api/v1/latest endpoint.
Endpoint: GET /api/v1/latest
This endpoint provides the latest interest rates for specified symbols.
cURL Example:
curl "https://interestratesapi.com/api/v1/latest?symbols=TCMB_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2026-07-19",
"base": "TRY",
"rates": {
"TCMB_RATE": 5.33
},
"dates": {
"TCMB_RATE": "2026-07-19"
},
"currencies": {
"TCMB_RATE": "TRY"
}
}
This response provides the latest TCMB_RATE value, which can be used in your application for financial calculations or analytics.
3. Accessing Historical TCMB_RATE Data
For applications that require historical data, the /api/v1/historical endpoint allows you to retrieve the TCMB_RATE for a specific date.
Endpoint: GET /api/v1/historical
This endpoint returns the interest rate for a specified date, which is particularly useful for trend analysis.
cURL Example:
curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=TCMB_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2025-06-15",
"base": "TRY",
"rates": {
"TCMB_RATE": 5.33
},
"currencies": {
"TCMB_RATE": "TRY"
}
}
This response shows the TCMB_RATE for June 15, 2025, allowing you to analyze historical trends in interest rates.
4. Analyzing Time Series Data
To analyze TCMB_RATE over a range of dates, you can use the /api/v1/timeseries endpoint.
Endpoint: GET /api/v1/timeseries
This endpoint provides a series of interest rates between two specified dates.
cURL Example:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-07-19&end=2026-07-19&symbols=TCMB_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"base": "TRY",
"start_date": "2025-07-19",
"end_date": "2026-07-19",
"rates": {
"TCMB_RATE": {
"2025-07-19": 5.33,
"2025-07-20": 5.34,
"2025-07-21": 5.35
}
},
"frequencies": {
"TCMB_RATE": "daily"
},
"currencies": {
"TCMB_RATE": "TRY"
}
}
This response provides daily TCMB_RATE values between the specified dates, enabling detailed financial analysis and forecasting.
5. Understanding Rate Fluctuations
The /api/v1/fluctuation endpoint allows you to analyze the change in TCMB_RATE over a specified period.
Endpoint: GET /api/v1/fluctuation
This endpoint returns statistics on the rate changes, including the start and end values, percentage change, and high/low values.
cURL Example:
curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-07-19&end=2026-07-19&symbols=TCMB_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"rates": {
"TCMB_RATE": {
"start_date": "2025-07-19",
"end_date": "2026-07-19",
"start_value": 5.50,
"end_value": 5.33,
"change": -0.17,
"change_pct": -3.09,
"high": 5.50,
"low": 5.25
}
}
}
This response provides valuable insights into the fluctuations of TCMB_RATE, which can be critical for risk assessment and investment strategies.
6. Obtaining OHLC Data
For applications that require candlestick data, the /api/v1/ohlc endpoint provides open, high, low, and close values for TCMB_RATE.
Endpoint: GET /api/v1/ohlc
This endpoint computes OHLC data on-the-fly from daily data.
cURL Example:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=TCMB_RATE&period=monthly&start=2025-07-19&end=2026-07-19&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"period": "monthly",
"start_date": "2025-07-19",
"end_date": "2026-07-19",
"rates": {
"TCMB_RATE": [
{
"period": "2025-07",
"open": 5.50,
"high": 5.55,
"low": 5.33,
"close": 5.33,
"data_points": 30
}
]
}
}
This response provides monthly OHLC data for TCMB_RATE, which is essential for technical analysis in trading applications.
7. Comparing Loan Interest Costs
The /api/v1/convert endpoint allows you to compare the total interest cost of loans between different rates.
Endpoint: GET /api/v1/convert
This endpoint compares the total interest cost of a simple loan at the latest rate of each symbol.
cURL Example:
curl "https://interestratesapi.com/api/v1/convert?from=TCMB_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": "TCMB_RATE",
"rate": 5.33,
"date": "2026-07-19",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-07-19",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}
This response provides a detailed comparison of loan costs between TCMB_RATE and another rate, which can be useful for financial decision-making.
Error Handling and Rate Limits
When working with the Interest Rates API, it's essential to handle errors gracefully. Common error responses include:
- 401: Missing or invalid api_key.
- 403: Account without active plan.
- 404: No symbols matched or no data for requested date/range.
- 422: Validation error (e.g., wrong date format, invalid symbol).
- 429: Request quota exhausted.
For rate limits, the API provides the following headers:
- X-RateLimit-Limit: The maximum number of requests allowed in a given time period.
- X-RateLimit-Remaining: The number of requests remaining in the current time window.
- X-RateLimit-Reset: The time when the rate limit will reset.
Implementing proper error handling and monitoring rate limits will ensure a smooth integration experience.
Mini Project: Node.js/Express Endpoint
To demonstrate the practical application of the TCMB_RATE data, we will create a simple Node.js/Express endpoint that fetches, caches, and serves TCMB_RATE data.
Setup
First, ensure you have Node.js and Express installed. Create a new project and install the necessary packages:
npm init -y
npm install express axios node-cache
Code Example:
const express = require('express');
const axios = require('axios');
const NodeCache = require('node-cache');
const app = express();
const cache = new NodeCache();
const API_KEY = 'YOUR_KEY';
const BASE_URL = 'https://interestratesapi.com/api/v1/latest?symbols=TCMB_RATE&api_key=' + API_KEY;
app.get('/tcmb-rate', async (req, res) => {
const cachedData = cache.get('tcmbRate');
if (cachedData) {
return res.json(cachedData);
}
try {
const response = await axios.get(BASE_URL);
cache.set('tcmbRate', response.data, 3600); // Cache for 1 hour
res.json(response.data);
} catch (error) {
res.status(500).json({ error: 'Failed to fetch data' });
}
});
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
This simple Express server fetches the latest TCMB_RATE data from the Interest Rates API, caches it for one hour, and serves it to clients. This approach minimizes API calls and improves response times.
Conclusion
Integrating TCMB_RATE data into your application using the Interest Rates API is a straightforward process that can significantly enhance your financial applications. By leveraging the various endpoints, you can access real-time and historical data, analyze trends, and make informed decisions. Proper error handling and caching strategies will ensure a robust integration. Start building your fintech application today and take advantage of the powerful data provided by the Interest Rates API.




