You need reproducible, high-quality historical data for the Central Bank of Turkey’s policy rate to drive pricing models, dashboards, and risk analytics. By the end of this article you will fetch multi-year TCMB policy rate history via REST, handle effective dates for a monthly series, compute changes and OHLC summaries for charting, and build a production-ready Python pipeline that writes clean CSV/Parquet for downstream systems.
TCMB_RATE: what it is, how it’s expressed, and how to read dates
TCMB_RATE is the Central Bank of Turkey (Türkiye Cumhuriyet Merkez Bankası) policy rate symbol in the Interest Rates API. It belongs to the central_bank category, is denominated in TRY, and is published on a monthly schedule. Values are expressed in percent per annum (for example, a JSON value of 36 means 36% annualized).
Because TCMB_RATE is monthly, its effective date in API responses is a calendar date string (YYYY-MM-DD) that represents the latest date within that month with data. For point-in-time lookups via the historical endpoint, the API notes: “For monthly symbols, the last day with data within that month is used.” This means a query like 2026-10-01 or 2026-10-31 will both return the same monthly value (the October fix), and the dates map in latest responses will show the effective date for that value.
All endpoints below are read-only GET requests under the base URL https://interestratesapi.com/api/v1/ and require an api_key query parameter. If you need a key, use this call to action: Get started with Interest Rates API or Register.
Discovering symbols (optional, but helpful in onboarding)
You can query the symbols catalogue to confirm that TCMB_RATE is available and to see metadata like frequency and category.
cURL
curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=TCMB_RATE"
Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/symbols",
params=dict(category="central_bank", api_key="YOUR_API_KEY")
)
symbols = resp.json()["symbols"]
tcmb = [s for s in symbols if s["symbol"] == "TCMB_RATE"]
print(tcmb)
JavaScript (fetch)
const res = await fetch(
"https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_API_KEY"
);
const json = await res.json();
console.log(json.symbols.find(s => s.symbol === "TCMB_RATE"));
PHP
<?php
$u = "https://interestratesapi.com/api/v1/symbols?category=central_bank&api_key=YOUR_API_KEY";
echo file_get_contents($u);
?
For more on fields and categories, see the MCP and Explore Interest Rates API features.
Multi-year history with /timeseries (lead workflow)
For historical analysis, begin with /timeseries. This endpoint returns daily records for daily symbols and month-dates for monthly symbols like TCMB_RATE. You specify an inclusive date range and one or more symbols. Downstream, you can resample or align the series as needed.
cURL (TCMB_RATE over a date range)
Official example JSON (structure and fields)
{
"success": true,
"date": "2026-10-31",
"base": "TRY",
"rates": {
"TCMB_RATE": 36
},
"dates": {
"TCMB_RATE": "2026-10-31"
},
"currencies": {
"TCMB_RATE": "TRY"
},
"base_filter_note": null
}
Interpretation notes:
- rates is a nested map: symbol → date → value.
- frequencies and currencies report the frequency and currency per symbol.
- Dates are ISO 8601 (YYYY-MM-DD). For monthly symbols, you will see one effective date per month in your selected range.
Values shown in example payloads are illustrative. In production, always read the frequencies and currencies blocks to drive logic (e.g., resampling and labeling).
Python (requests) — fetching and parsing a TCMB_RATE time series
import requests
from datetime import date
params = {
"start": "2024-01-01",
"end": "2026-12-31",
"symbols": "TCMB_RATE",
"api_key": "YOUR_API_KEY"
}
r = requests.get("https://interestratesapi.com/api/v1/timeseries", params=params)
ts = r.json()
series = ts["rates"]["TCMB_RATE"] # dict of date -> value
# Example: convert to sorted list of (date, value)
pairs = sorted(series.items())
print(pairs[:5])
JavaScript (fetch) — time series into arrays
const url = "https://interestratesapi.com/api/v1/timeseries?start=2024-01-01&end=2026-12-31&symbols=TCMB_RATE&api_key=YOUR_API_KEY";
const res = await fetch(url);
const data = await res.json();
const entries = Object.entries(data.rates.TCMB_RATE).sort((a, b) => a[0].localeCompare(b[0]));
const dates = entries.map(([d]) => d);
const values = entries.map(([, v]) => v);
console.log(dates[0], values[0]);
PHP — time series fetch
<?php
$q = http_build_query([
"start" => "2024-01-01",
"end" => "2026-12-31",
"symbols" => "TCMB_RATE",
"api_key" => "YOUR_API_KEY"
]);
$url = "https://interestratesapi.com/api/v1/timeseries?$q";
$json = file_get_contents($url);
$data = json_decode($json, true);
$series = $data["rates"]["TCMB_RATE"];
ksort($series);
foreach ($series as $d => $v) {
echo "$d,$v\n";
}
?
Point-in-time lookups with /historical
Use /historical when your business logic needs “the value current on a specific date.” For monthly TCMB_RATE, the API will return that month’s final observed value, even if you pass a mid-month date.
cURL
Official example JSON
In practice with TCMB_RATE, expect the currency_code to be TRY and the frequency monthly. When coding, rely on the currencies and frequencies blocks (where present) to remain robust across symbols.
Python
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/historical",
params=dict(date="2026-10-15", symbols="TCMB_RATE", api_key="YOUR_API_KEY")
)
h = resp.json()
print(h["rates"]["TCMB_RATE"], h.get("dates", {}).get("TCMB_RATE"))
JavaScript
const r = await fetch("https://interestratesapi.com/api/v1/historical?date=2026-10-15&symbols=TCMB_RATE&api_key=YOUR_API_KEY");
const j = await r.json();
console.log(j.rates.TCMB_RATE);
PHP
<?php
$u = "https://interestratesapi.com/api/v1/historical?date=2026-10-15&symbols=TCMB_RATE&api_key=YOUR_API_KEY";
echo file_get_contents($u);
?
Latest value for TCMB_RATE
To show current policy rate snapshots, call /latest. This is also useful for sanity checks in monitoring or alerting flows.
OFFICIAL cURL (copy-paste)
OFFICIAL JSON response (fields and meaning)
Key takeaways:
- rates.TCMB_RATE is the annual rate in percent.
- dates.TCMB_RATE is the effective date for that latest value.
- All date strings are ISO 8601; for monthly series, the date is the last applicable date in that month.
To try it live and integrate quickly, use Try Interest Rates API.
Change analysis with /fluctuation
When you need summarized changes over a window (start, end, absolute and percent change, range high/low), use /fluctuation. This is useful for macro monitors or monthly dashboards that highlight shifts in policy stance.
cURL
Official example JSON
JavaScript
const resp = await fetch(
"https://interestratesapi.com/api/v1/fluctuation?start=2026-01-01&end=2026-12-31&symbols=TCMB_RATE&api_key=YOUR_API_KEY"
);
const fx = await resp.json();
const s = fx.rates.TCMB_RATE;
console.log(`Change: ${s.change} (${s.change_pct}%) from ${s.start_date} to ${s.end_date}`);
PHP
<?php
$u = "https://interestratesapi.com/api/v1/fluctuation?start=2026-01-01&end=2026-12-31&symbols=TCMB_RATE&api_key=YOUR_API_KEY";
echo file_get_contents($u);
?
OHLC for candlesticks with /ohlc + Plotly
For charting time-bucketed open/high/low/close of policy rates, compute OHLC via the /ohlc endpoint. Even for monthly symbols, this is useful to standardize visualization across mixed dashboards where other series might be daily or weekly.
cURL
Official example JSON
data_points reports how many raw observations contributed to the bucket. For a true monthly symbol, this may be 1; for daily symbols bucketed monthly, it reflects the number of business days included in the aggregation window.
JavaScript (fetch + Plotly candlestick)
// Assume Plotly.js is loaded on the page
async function plotTCMB() {
const url = "https://interestratesapi.com/api/v1/ohlc?symbols=TCMB_RATE&period=monthly&start=2024-01-01&end=2026-12-31&api_key=YOUR_API_KEY";
const res = await fetch(url);
const ohlc = await res.json();
const rows = ohlc.rates.TCMB_RATE;
const x = rows.map(r => r.period + "-01");
const open = rows.map(r => r.open);
const high = rows.map(r => r.high);
const low = rows.map(r => r.low);
const close = rows.map(r => r.close);
const trace = {
type: "candlestick",
x, open, high, low, close,
increasing: { line: { color: "#2ca02c" } },
decreasing: { line: { color: "#d62728" } },
name: "TCMB_RATE"
};
const layout = {
title: "TCMB Policy Rate — Monthly OHLC",
xaxis: { type: "date" },
yaxis: { title: "Percent (annual)" }
};
Plotly.newPlot("tcmb-chart", [trace], layout);
}
plotTCMB();
Add a container with id="tcmb-chart" to your page to render the chart. For interactive dashboards, consider caching the raw /ohlc JSON and updating on a monthly cadence.
Python data pipeline: fetch → pandas → CSV/Parquet
This pipeline fetches TCMB_RATE history with /timeseries, converts it to a pandas DataFrame, normalizes dates, and writes both CSV and Parquet artifacts for downstream consumers. It is safe for cron or Airflow-style scheduling; add retries and logging for production.
Full Python example
import os
import sys
import json
import time
import requests
import pandas as pd
API_BASE = "https://interestratesapi.com/api/v1/"
API_KEY = os.environ.get("IR_API_KEY", "YOUR_API_KEY")
SYMBOL = "TCMB_RATE"
START = "2015-01-01"
END = "2026-12-31"
def fetch_timeseries(symbol: str, start: str, end: str):
url = API_BASE + "timeseries"
params = dict(symbols=symbol, start=start, end=end, api_key=API_KEY)
r = requests.get(url, params=params, timeout=30)
if r.status_code == 429:
# simple backoff using Retry-After if provided
retry_after = int(r.headers.get("Retry-After", "3"))
time.sleep(retry_after)
r = requests.get(url, params=params, timeout=30)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(data.get("error", "Unknown error"))
return data
def series_to_dataframe(ts_json: dict) -> pd.DataFrame:
series = ts_json["rates"][SYMBOL] # dict of date -> value
df = pd.DataFrame(
[(d, v) for d, v in series.items()],
columns=["date", "value"]
)
df["date"] = pd.to_datetime(df["date"], format="%Y-%m-%d", utc=False)
df.sort_values("date", inplace=True)
# Add metadata columns
currency = ts_json.get("currencies", {}).get(SYMBOL)
freq = ts_json.get("frequencies", {}).get(SYMBOL)
df["symbol"] = SYMBOL
df["currency"] = currency
df["frequency"] = freq
return df
def main():
ts = fetch_timeseries(SYMBOL, START, END)
df = series_to_dataframe(ts)
# For monthly series, ensure end-of-month labeling if required by your downstream:
# df_m = df.copy() # Already monthly for TCMB_RATE; keep as-is unless you need end-of-month alignment.
out_dir = "./data_tcmb"
os.makedirs(out_dir, exist_ok=True)
csv_path = os.path.join(out_dir, f"{SYMBOL}_{START}_{END}.csv")
pq_path = os.path.join(out_dir, f"{SYMBOL}_{START}_{END}.parquet")
df.to_csv(csv_path, index=False)
try:
df.to_parquet(pq_path, index=False)
except Exception as e:
print("Parquet write skipped (install pyarrow or fastparquet):", e, file=sys.stderr)
# Emit a small preview for logs
print(df.head().to_string(index=False))
print(f"Wrote {len(df)} rows to {csv_path}")
if __name__ == "__main__":
main()
Pipeline tips:
- Missing dates: monthly TCMB_RATE will only include dates for months with data. Do not forward-fill unless your use case requires it.
- data_points in /ohlc: interpret as the number of contributing raw observations; it’s useful for QA, not typically for modeling.
- File naming: include symbol and range in filenames for deterministic caching and audits.
Computing spreads and payments from returned values
Spreads: use /latest or a specific date from /historical to compute a spread between TCMB_RATE and another benchmark. The simplest spread is rate_a - rate_b in percentage points. For example, rate_a could be TCMB_RATE and rate_b could be another central bank rate returned by the API. Keep both rates in the same convention (percent per annum) and align effective dates.
Monthly payments: if you need to translate an annual policy rate into a rough monthly payment for a simple amortizing loan, convert the API’s percent value to a monthly decimal rate r_m = (value / 100) / 12, then apply the standard annuity formula:
- Payment = P × r_m / (1 − (1 + r_m)^(−n)), where P is principal and n is number of months.
- If r_m = 0, payment = P / n.
JavaScript utility for amortization (uses API output)
function monthlyPayment(principal, annualPercent, months) {
const r = (annualPercent / 100) / 12;
if (r === 0) return principal / months;
return principal * r / (1 - Math.pow(1 + r, -months));
}
// Example wiring:
// const tcmb = latest.rates.TCMB_RATE; // percent per annum from /latest
// const pmt = monthlyPayment(100000, tcmb, 120);
Comparing loan interest costs with /convert
When you need a quick comparison of total interest on a simple loan priced off two rates, use /convert. It returns total_interest and total_payment for each symbol at its latest value, plus the spread in difference.rate_spread.
cURL
Official example JSON
This endpoint simplifies quick “what-if” scenarios, but you can always compute bespoke amortization using the returned rate values if your pricing requires a different convention.
Operational considerations: frequency, business days, and caching
Frequency: TCMB_RATE is monthly. Expect one effective point per month in /timeseries and /historical. If you’re mixing symbols of different frequencies, use the frequencies object (when present) to programmatically resample.
Business days and publication timing: central banks observe local calendars. For monthly series, the final effective date for the month will appear in responses once published; weekends and holidays do not produce additional rows for monthly symbols.
Caching and rate limits: cache responses by URL, including query parameters (start, end, symbols). For production schedulers, respect 429 responses; the API provides Retry-After plus X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. For dashboards, consider caching monthly TCMB data at least until the next policy month.
Error handling: common non-200s include 401 (api_key issues), 403 (inactive account), 404 (no data for date/range), and 422 (validation like bad date formats). Keep your logs actionable with the error message and any details field returned.
To explore more features, visit Explore Interest Rates API features or Try Interest Rates API.
Complete endpoint quick-reference samples (TCMB_RATE)
/latest
/historical
/timeseries
/fluctuation
/ohlc
Language parity: Python, JavaScript, PHP
Below is a minimal parity snippet set you can reuse by only changing the endpoint path and params as needed.
Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/latest",
params=dict(symbols="TCMB_RATE", api_key="YOUR_API_KEY")
)
print(resp.json())
JavaScript (fetch)
const response = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=TCMB_RATE&api_key=YOUR_API_KEY"
);
console.log(await response.json());
PHP
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/latest?symbols=TCMB_RATE&api_key=YOUR_API_KEY");
?
FAQ
Q: What unit does TCMB_RATE use?
A: Percent per annum. For example, 36 means 36% annualized.
Q: How often is TCMB_RATE updated?
A: It is a monthly series. The API returns a single effective date per month once published.
Q: How are weekends and holidays handled?
A: Monthly series do not add extra rows for weekends/holidays. For /historical on a monthly symbol, the API uses the last day with data within that month.
Q: Can I chart TCMB_RATE as candlesticks?
A: Yes. Use /ohlc with period=monthly to get open/high/low/close buckets, then render with Plotly candlestick.
Q: How do I avoid quota issues?
A: Cache responses by URL and handle 429 by honoring Retry-After and X-RateLimit-* headers. Schedule monthly refreshes for TCMB_RATE.
Ship your integration today: fetch TCMB historicals, compute changes, and push clean datasets downstream. Register for an API key, then Get started with Interest Rates API. You can also Try Interest Rates API and Explore Interest Rates API features to see all available endpoints and symbols.