CBK Timeseries API: Historical Prints and Charts

CBK Timeseries API: Historical Prints and Charts

You need reliable historical prints of the Central Bank of Kuwait Discount Rate (CBK_RATE) for backtesting, risk models, and charts—without stitching spreadsheets or handling edge cases by hand. By the end of this guide, you will query CBK_RATE time series from the Interest Rates API, handle monthly frequency nuances, compute spreads and monthly payments from the returned values, export data to CSV/Parquet, and render OHLC-style charts for analysis and dashboards.

What CBK_RATE represents and how to read it

CBK_RATE is the Central Bank of Kuwait Discount Rate. In Interest Rates API responses it is expressed as a percentage rate per annum (for example 5.33 means 5.33% p.a.), not as a decimal fraction. CBK_RATE is a monthly-frequency central bank benchmark. Effective dates follow two important conventions you should account for:

  • Monthly symbol: CBK_RATE does not change daily. The rate is applicable for a given month and may appear on the last business day with data in that month.
  • Point-in-time lookups: when you request a specific date for a monthly symbol, the API returns the last day with data within that month (details below under historical lookups).

All examples below use the Interest Rates API at Try Interest Rates API, which provides central bank and interbank benchmarks over REST. Every request is a GET with authentication via the api_key query parameter. See Explore Interest Rates API features and Get started with Interest Rates API for product context.

Multi-year historical retrieval with /timeseries (lead workflow)

Use /timeseries to fetch CBK_RATE over a defined date range. Because CBK_RATE is monthly, you will see one value per month (even though the endpoint always returns a calendar map). Downstream, you can upsample or downsample according to your model’s requirements.

CBK_RATE timeseries: cURL

curl "https://interestratesapi.com/api/v1/timeseries?start=2023-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY"

Illustrative JSON (field names as documented; values are examples):

{
"success": true,
"base": "USD",
"start_date": "2023-01-01",
"end_date": "2026-09-30",
"rates": {
"CBK_RATE": {
"2023-01-31": 4.25,
"2023-02-28": 4.50,
"2023-03-31": 4.75
}
},
"frequencies": { "CBK_RATE": "monthly" },
"currencies": { "CBK_RATE": "USD" }
}

How to read:

  • rates.CBK_RATE: date-to-value map of percentage levels. For monthly benchmarks, the date keys typically correspond to the last business day with data in each month.
  • frequencies.CBK_RATE = "monthly": confirms frequency classification for downstream resampling.
  • currencies.CBK_RATE: the currency identifier associated with the series as provided by the API.

CBK_RATE timeseries: Python (requests)

import requests

resp = requests.get(
"https://interestratesapi.com/api/v1/timeseries",
params=dict(start="2023-01-01", end="2026-09-30", symbols="CBK_RATE", api_key="YOUR_API_KEY")
)
data = resp.json()

# Access the series
series = data["rates"]["CBK_RATE"] # dict of date -> rate (%)
freq = data.get("frequencies", {}).get("CBK_RATE")
ccy = data.get("currencies", {}).get("CBK_RATE")

# Example: compute monthly differences (spread between consecutive months)
dates = sorted(series.keys())
month_to_month_spread = {}
prev = None
for d in dates:
if prev is not None:
month_to_month_spread[d] = series[d] - series[prev]
prev = d

print("Frequency:", freq, "Currency:", ccy)
print("First 3 months:", [(d, series[d]) for d in dates[:3]])
print("First 3 spreads:", list(month_to_month_spread.items())[:3])

CBK_RATE timeseries: JavaScript (fetch)

const url = "https://interestratesapi.com/api/v1/timeseries?start=2023-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY";
const response = await fetch(url);
const data = await response.json();

const series = data.rates.CBK_RATE; // date -> rate (%)
const freq = data.frequencies?.CBK_RATE;
const ccy = data.currencies?.CBK_RATE;

// Convert to sorted array for charting
const points = Object.entries(series)
.sort((a, b) => a[0].localeCompare(b[0]))
.map(([date, value]) => ({ date, value }));

console.log(freq, ccy, points.slice(0, 5));

CBK_RATE timeseries: PHP

<?php
$ch = curl_init("https://interestratesapi.com/api/v1/timeseries?start=2023-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close($ch);

$data = json_decode($resp, true);
$series = $data["rates"]["CBK_RATE"]; // date => rate (%)
$freq = $data["frequencies"]["CBK_RATE"] ?? null;
$ccy = $data["currencies"]["CBK_RATE"] ?? null;

// Example: calculate average over the range
$sum = 0.0;
$n = 0;
foreach ($series as $date => $value) {
$sum += $value;
$n += 1;
}
$avg = $n > 0 ? $sum / $n : null;
echo "Frequency: $freq, Currency: $ccy, Observations: $n, Average: $avg\n";
?>

Point-in-time lookups with /historical (date edge-cases)

Use /historical for a point-in-time query. For monthly benchmarks like CBK_RATE, the API returns the value associated with the last day with data within that month. That means:

  • If you request 2025-06-15, you’ll receive the June value as of the last business day with data in that month.
  • Weekend or holiday requests resolve to the applicable monthly observation; you don’t need to “roll” dates manually.

/historical for CBK_RATE: cURL

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

Illustrative JSON (values are examples):

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

Practical patterns:

  • Cache per month: since CBK_RATE is monthly, cache lookups keyed by year-month to avoid redundant calls for the same period.
  • Display the effective date: pair the returned value with your own resolver that highlights the month. When you need the rate’s precise “as-of” business day within the month for audit, rely on /timeseries boundaries or /ohlc’s data_points for context.

/historical for CBK_RATE: Python

import requests

r = requests.get(
"https://interestratesapi.com/api/v1/historical",
params=dict(date="2025-06-15", symbols="CBK_RATE", api_key="YOUR_API_KEY")
)
data = r.json()
rate = data["rates"]["CBK_RATE"] # % p.a.
ccy = data["currencies"]["CBK_RATE"]
print("CBK_RATE on 2025-06-15 (monthly as-of):", rate, ccy)

/historical for CBK_RATE: JavaScript

const res = await fetch("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=CBK_RATE&api_key=YOUR_API_KEY");
const data = await res.json();
console.log("CBK_RATE:", data.rates.CBK_RATE, "Currency:", data.currencies.CBK_RATE);

/historical for CBK_RATE: PHP

<?php
$ch = curl_init("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=CBK_RATE&api_key=YOUR_API_KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close($ch);

$data = json_decode($resp, true);
echo "CBK_RATE: " . $data["rates"]["CBK_RATE"] . " " . $data["currencies"]["CBK_RATE"] . PHP_EOL;
?>

Change analytics with /fluctuation

When modeling sensitivity or deltas across two dates, use /fluctuation. It returns start/end values, absolute and percentage change, and the observed high/low within the range. This is useful to comment on stability or to bound scenario analysis.

/fluctuation for CBK_RATE: cURL

curl "https://interestratesapi.com/api/v1/fluctuation?start=2024-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY"

Illustrative JSON (values are examples):

{
"success": true,
"rates": {
"CBK_RATE": {
"start_date": "2024-01-01",
"end_date": "2026-09-30",
"start_value": 5.25,
"end_value": 5.33,
"change": 0.08,
"change_pct": 1.52,
"high": 5.50,
"low": 5.25
}
}
}

/fluctuation for CBK_RATE: Python

import requests

resp = requests.get(
"https://interestratesapi.com/api/v1/fluctuation",
params=dict(start="2024-01-01", end="2026-09-30", symbols="CBK_RATE", api_key="YOUR_API_KEY")
)
data = resp.json()
f = data["rates"]["CBK_RATE"]
print("Change:", f["change"], "pct:", f["change_pct"], "high:", f["high"], "low:", f["low"])

/fluctuation for CBK_RATE: JavaScript

const res = await fetch("https://interestratesapi.com/api/v1/fluctuation?start=2024-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY");
const data = await res.json();
const s = data.rates.CBK_RATE;
console.log(`Δ=${s.change} (${s.change_pct}%), high=${s.high}, low=${s.low}`);

/fluctuation for CBK_RATE: PHP

<?php
$ch = curl_init("https://interestratesapi.com/api/v1/fluctuation?start=2024-01-01&end=2026-09-30&symbols=CBK_RATE&api_key=YOUR_API_KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close($ch);

$data = json_decode($resp, true);
$s = $data["rates"]["CBK_RATE"];
echo "Start: {$s["start_value"]}, End: {$s["end_value"]}, Change: {$s["change"]} ({$s["change_pct"]}%)".PHP_EOL;
?>

OHLC candlesticks for CBK_RATE with /ohlc

Even for monthly benchmarks, candlestick frames can be useful to summarize intramonth movements when the underlying data is daily or business-day stamped. The API computes OHLC on-the-fly from daily data. For CBK_RATE (monthly), you will often see open=close within a month unless there was a change during that period. The data_points field indicates the number of calendar entries evaluated for the period.

/ohlc for CBK_RATE: cURL

curl "https://interestratesapi.com/api/v1/ohlc?symbols=CBK_RATE&period=monthly&start=2024-01-01&end=2026-09-30&api_key=YOUR_API_KEY"

Illustrative JSON (values are examples):

{
"success": true,
"period": "monthly",
"start_date": "2024-01-01",
"end_date": "2026-09-30",
"rates": {
"CBK_RATE": [
{
"period": "2024-01",
"open": 5.25,
"high": 5.25,
"low": 5.25,
"close": 5.25,
"data_points": 23
},
{
"period": "2024-02",
"open": 5.25,
"high": 5.50,
"low": 5.25,
"close": 5.50,
"data_points": 21
}
]
}
}

Charting CBK_RATE OHLC with Chart.js

The snippet below transforms /ohlc output to a typical OHLC bar data structure for Chart.js (via a financial chart plugin). Adjust the adapter to your charting library of choice.

// Assume `ohlcData` is the parsed JSON from /ohlc above
const rows = ohlcData.rates.CBK_RATE.map(r => ({
t: r.period + "-01", // first day of month, suitable for display
o: r.open,
h: r.high,
l: r.low,
c: r.close
}));

// Example Chart.js dataset (requires a financial/ohlc plugin)
const dataset = {
label: "CBK_RATE",
data: rows
};

// In your Chart initialization, set type to 'candlestick' or 'ohlc' per plugin docs.

/ohlc for CBK_RATE: Python

import requests

r = requests.get(
"https://interestratesapi.com/api/v1/ohlc",
params=dict(symbols="CBK_RATE", period="monthly", start="2024-01-01", end="2026-09-30", api_key="YOUR_API_KEY")
)
ohlc = r.json()["rates"]["CBK_RATE"]
# Example: detect months with intramonth change
changed_months = [x for x in ohlc if not (x["open"] == x["close"] == x["high"] == x["low"])]
print("Months with a change:", [x["period"] for x in changed_months])

/ohlc for CBK_RATE: JavaScript

const res = await fetch("https://interestratesapi.com/api/v1/ohlc?symbols=CBK_RATE&period=monthly&start=2024-01-01&end=2026-09-30&api_key=YOUR_API_KEY");
const data = await res.json();
const frames = data.rates.CBK_RATE;
const withChange = frames.filter(f => !(f.open === f.close && f.high === f.low));
console.log("Periods with movements:", withChange.map(f => f.period));

/ohlc for CBK_RATE: PHP

<?php
$ch = curl_init("https://interestratesapi.com/api/v1/ohlc?symbols=CBK_RATE&period=monthly&start=2024-01-01&end=2026-09-30&api_key=YOUR_API_KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close($ch);

$data = json_decode($resp, true);
$rows = $data["rates"]["CBK_RATE"];
foreach ($rows as $r) {
echo "{$r["period"]}: O={$r["open"]} H={$r["high"]} L={$r["low"]} C={$r["close"]} (n={$r["data_points"]})\n";
}
?>

Python pipeline: fetch → pandas DataFrame → CSV/Parquet

This end-to-end example pulls a multi-year CBK_RATE series via /timeseries, normalizes it into a DataFrame, and exports to CSV and Parquet. This is a drop-in pipeline for backtesting or scheduled data loads.

import requests
import pandas as pd
from pathlib import Path

API = "https://interestratesapi.com/api/v1/timeseries"
PARAMS = dict(
start="2015-01-01",
end="2026-09-30",
symbols="CBK_RATE",
api_key="YOUR_API_KEY"
)

resp = requests.get(API, params=PARAMS)
j = resp.json()

# Build a DataFrame from the date map
series = j["rates"]["CBK_RATE"] # {date_str: rate_percent}
df = pd.DataFrame(
[{"date": k, "cbk_rate": v} for k, v in series.items()]
).sort_values("date")

# Normalize to month-end index (CBK_RATE is monthly)
df["date"] = pd.to_datetime(df["date"])
df = df.set_index("date").asfreq("M", method="pad") # carry forward within month-end alignment

# Export
outdir = Path("exports")
outdir.mkdir(exist_ok=True)
df.to_csv(outdir / "cbk_rate_timeseries.csv", index=True)
df.to_parquet(outdir / "cbk_rate_timeseries.parquet", index=True)

print("Rows:", len(df), "First:", df.index.min().date(), "Last:", df.index.max().date())

Computing spreads and monthly payments from CBK_RATE

Typical downstream tasks include calculating spreads over another benchmark and estimating simple monthly payments. Use the API results as follows:

  • Rate spread: spread = CBK_RATE − other_rate (both in percentage points). For time series, compute the spread per aligned date key.
  • Simple monthly payment (interest-only): payment = principal × (CBK_RATE / 100) × (1 / 12). For amortizing loans, apply your amortization schedule; the API provides the benchmark rate, not the loan terms.

Example (JavaScript) using the CBK_RATE value you retrieved:

function interestOnlyMonthlyPayment(principal, annualRatePct) {
return principal * (annualRatePct / 100) / 12;
}

// Spread in percentage points
function spread(bp1, bp2) {
return bp1 - bp2;
}

// Usage:
// const cbk = 5.33; // % from API
// const ref = 4.50; // % from another symbol via API
// console.log("Monthly payment:", interestOnlyMonthlyPayment(250000, cbk));
// console.log("Spread:", spread(cbk, ref));

Practical details that save time

  • HTTP method: All endpoints are GET. Authentication is via api_key in the query string (no headers).
  • Frequency and business days: CBK_RATE is monthly. The API associates the monthly observation with the last day with data in that month. No concept of “trading days” applies; still, business-day alignment affects which calendar key appears in the /timeseries map.
  • Caching: Cache by month for CBK_RATE to avoid unnecessary re-fetches. For analytics dashboards, consider a daily cache TTL that respects your refresh cadence.
  • Missing dates: For monthly symbols, do not assume a value for every calendar day. Use the provided date keys as authoritative and resample if needed.
  • data_points in /ohlc: This counts the number of calendar data points considered to compute OHLC for the period. It helps validate whether a month had a single static value (open=high=low=close) or multiple observations.
  • Error handling: Check for success=false and handle HTTP status codes. Watch for 401 (missing/invalid api_key), 403 (no active plan), 404 (no data in range), 422 (validation), and 429 (quota). Observe Retry-After and X-RateLimit-* headers on 429.

Quick connectivity check: known JSON shape from /latest

The snippet below shows a real /latest response from Interest Rates API (for a different symbol) so you can verify field names and parsing. This is an actual example provided for reference to response structure:

{"success":true,"date":"2026-09-24","base":"USD","rates":{"SOFR":3.88},"dates":{"SOFR":"2026-09-24"},"currencies":{"SOFR":"USD"},"base_filter_note":null}

Use the same field-reading approach for CBK_RATE via /latest or other endpoints. For production, request CBK_RATE explicitly with the symbols parameter.

Optional: compare loan interest costs with /convert

When you need a quick comparison of simple loan interest cost between CBK_RATE and another benchmark’s latest levels, use /convert. This provides the computed interest totals in a single call (using simple interest, as documented by the endpoint).

/convert: cURL (CBK_RATE vs ECB_MRO)

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

Illustrative JSON (values are examples):

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

/convert: Python

import requests

r = requests.get(
"https://interestratesapi.com/api/v1/convert",
params=dict(from="CBK_RATE", to="ECB_MRO", amount=100000, term_months=12, api_key="YOUR_API_KEY")
)
print(r.json())

/convert: JavaScript

const res = await fetch("https://interestratesapi.com/api/v1/convert?from=CBK_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY");
const data = await res.json();
console.log(data.difference.rate_spread, data.difference.interest_saved);

/convert: PHP

<?php
$ch = curl_init("https://interestratesapi.com/api/v1/convert?from=CBK_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close($ch);
print_r(json_decode($resp, true));
?>

Discoverability and symbol verification

To confirm that CBK_RATE is available and categorized correctly, use /symbols with filters. This aids dynamic UIs that list valid inputs for users.

/symbols: cURL

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

Filter results to find the entry with symbol "CBK_RATE". Use category, country, and currency fields to drive UX filters. For the full reference surface, see MCP.

Operational guidance, rate limits, and retries

  • Pagination: None of the endpoints above paginate; ranges are controlled by start/end parameters.
  • Throttling: On 429 (quota exhausted), back off using the Retry-After header and inspect X-RateLimit-* headers for reset timing.
  • Idempotency: Reads are idempotent. Combine deterministic parameters (e.g., month keys for CBK_RATE) with cache keys for stability.
  • Monitoring: Log success flags and error fields from JSON to triage issues quickly. Many 404s include details about the available date range.

End-to-end example: from API to dashboard

This section outlines the data flow you can deploy with CI/CD or a scheduled job:

  1. Fetch multi-year CBK_RATE via /timeseries (monthly series).
  2. Normalize to a monthly index in pandas, export CSV/Parquet for analysts.
  3. Serve a thin API or static file to a frontend that calls /ohlc for the latest 24–36 months for a candlestick widget.
  4. Compute spreads client-side between CBK_RATE and another symbol you fetch concurrently (e.g., ECB_MRO), and show an interest-only monthly payment estimator.
  5. Cache results keyed by YYYY-MM to avoid repeated monthly work.

If you need to scale beyond a pilot, keep the same endpoints and switch the scheduler cadence (e.g., monthly) since CBK_RATE is monthly-frequency.

FAQ

Q: What units does CBK_RATE use?
A: Percent per annum (e.g., 5.33 means 5.33% p.a.). Convert to decimal for formulas by dividing by 100.

Q: How does /historical resolve dates for a monthly symbol?
A: It returns the observation associated with the last day with data within that month. You can request any day in that month and receive the same monthly rate.

Q: Why are there gaps in the /timeseries calendar?
A: CBK_RATE is monthly. Use the provided date keys as authoritative and resample your index if you require day-level or uniform month-end alignment.

Q: Can I get OHLC for CBK_RATE even if it’s monthly?
A: Yes. /ohlc summarizes the underlying calendar observations; for months without changes you will often see open=high=low=close with data_points indicating the evaluated entries.

Q: How should I cache?
A: Cache by symbol and year-month (e.g., CBK_RATE:2026-09). For analytics, consider an additional daily TTL if you also query near month boundaries.

Build your CBK_RATE feed now: Register for an API key and start integrating. For product context and endpoints, see Try Interest Rates API and Explore Interest Rates API features. Finally, when you’re ready to ship, Get started with Interest Rates API and wire the endpoints above into your data pipelines and dashboards.

Ready to get started?

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

Get API Key

Related posts