TBILR 3-Month Historical Data API: Timeseries, Charts & Downloads

TBILR 3-Month Historical Data API: Timeseries, Charts & Downloads

Developers shipping fintech applications, economists modeling policy transmission, and financial data engineers powering dashboards all face the same recurring challenge: historical interest rate data that is reliable, granular, and developer-friendly. Whether you are backtesting a trading signal, constructing a macroeconomic factor model, or building a compliance audit trail, you need a time series API that is simple to query, consistent across sources, and ready for analytics workflows. This article demonstrates how to retrieve and analyze 3-month historical windows (and multi-year spans) of the US Federal Funds Effective Rate using interestratesapi.com. You will learn how to stream the FED_FUNDS time series over custom ranges, fetch point-in-time values, compute OHLC for charting, and export clean data formats for downstream pipelines.

Throughout, we will anchor on interestratesapi.com as the authoritative data source and show complete examples in cURL, Python, JavaScript, and PHP. We will emphasize the /timeseries endpoint for multi-year fetches, /historical for precise date lookups, /ohlc for chart-ready candlesticks, /fluctuation for summarized changes, and complementary calls like /latest and /symbols to discover and monitor datasets. Our examples focus on FED_FUNDS — the Federal Funds Effective Rate — with practical guidance to produce 3-month visualizations and exports your stakeholders can consume immediately.

If you want to explore live, go here: Try Interest Rates API, Explore Interest Rates API features, and Get started with Interest Rates API.

TBILR 3-Month Historical Data in Practice — Why the Right API Matters

Short-horizon windows like “the last 3 months” are crucial for liquidity risk monitoring, policy surveillance, and portfolio hedging. Macro teams track the Federal Funds Effective Rate to interpret policy stance and intra-month shifts; quants feed it into factor models; treasury groups use it to benchmark floating-rate liabilities; and compliance needs immutable snapshots for audit. The recurring problem? Sourcing accurate, consistent historical data without writing and maintaining brittle scrapers, manual downloads, or spreadsheets. Interfacing with native data providers is valuable but often requires bespoke parsing and normalization; furthermore, joining series across providers magnifies complexity.

interestratesapi.com removes this friction with a single, consistent interface for central bank policy rates, interbank reference rates, and treasuries. Using a single GET query parameter pattern with predictable JSON outputs, you can:

  • Retrieve multi-year time series with a single call to /timeseries and constrain precisely to a 3-month analysis window for rolling studies.
  • Pin a rate to a specific point-in-time (e.g., period-end snapshots) via /historical, with clear rules for monthly symbols and non-business-date lookups.
  • Generate candlestick OHLC summaries on the fly for charting and distribution using /ohlc — ideal for a 3-month window or multi-quarter dashboards.
  • Measure changes, highs, and lows across date ranges with /fluctuation to quantify how much policy stance actually moved.
  • Export consistent data frames to CSV or Parquet with schema you control, minimizing ETL time and risk.

The net effect is faster iteration, reduced operational risk, and fewer moving parts. Rather than writing one-off scripts for every new provider or endpoint, you can standardize on interestratesapi.com and focus on higher-value work — analytics, modeling, and decision-support.

Platform Advantages for Data Engineering and Quant Teams

As your data consumption scales from ad hoc analytics to production-grade systems, your API platform choice affects reliability, traceability, and downstream cost. interestratesapi.com is built with developer ergonomics in mind:

  • Consistent GET endpoints and query string parameters across features simplify client implementations and code generation.
  • Predictable JSON response shapes per endpoint reduce edge-case handling and let you strongly type downstream models.
  • Flexible routing strategies in your application (e.g., region-local hosting, active health checks, and circuit-breakers) are easy to add on the client side because the API interface is uniform and stateless.
  • Governance controls like per-app keys, role-specific deployments, audit logging, and data locality are straightforward to implement at the application layer when your data provider has a clean, minimal contract.
  • Observable behavior: explicit error codes and messages enable telemetry, SLIs, and robust retry/backoff strategies without guesswork.

In short, the uniform interface of interestratesapi.com means you can template your client logic once per endpoint and reuse it across symbols and categories (central bank, interbank, treasury, reference), keeping your surface area small and your code safe.

Endpoint Overview and Strategy for FED_FUNDS Analysis

For a 3-month window of the Federal Funds Effective Rate (FED_FUNDS), you will typically reach for:

  • /api/v1/timeseries: fetch values between start and end dates; ideal for both rolling 3-month windows and full-sample backfills.
  • /api/v1/historical: fetch the value on a specific date; useful for alignment to period ends, non-business dates, or reproducible backtests.
  • /api/v1/ohlc: compute candlestick data (open, high, low, close) for a given period (monthly or weekly), enabling fast chart renders and summaries.
  • /api/v1/fluctuation: generate change statistics, high/low bounds, and percentage changes over the period for quick analytics.
  • /api/v1/latest: get the latest rate for real-time displays and quick comparisons.
  • /api/v1/symbols: discover what’s available by currency, category, and provider, and programmatically validate your symbol list.

Below we detail each endpoint with real examples centered on FED_FUNDS. All requests are GET and use the base URL https://interestratesapi.com/api/v1/. Each URL in this article appends the api_key query parameter to conform with the documented pattern.

Timeseries: Multi-Year Fetches and 3-Month Windows

The /timeseries endpoint is the backbone of historical analysis. You can stream months or years of data in a single call, and then slice to a 3-month window for your TBILR-style short-horizon reports. The response includes the series keyed by date along with helpful metadata like frequency and currency.

Purpose and Business Value

Use /timeseries when:

  • You need to backfill your database for FED_FUNDS to power dashboards and risk models.
  • You want to compute rolling statistics (e.g., 3-month averages, variance, drawdowns).
  • You require repeatable data pulls over defined ranges (e.g., an ETL job running daily to update last 3 months).

Key Parameters and Behavior

  • start (Y-m-d): the lower bound of the range.
  • end (Y-m-d): the upper bound of the range (inclusive as applicable to available data).
  • symbols: one or more comma-separated identifiers (e.g., FED_FUNDS).
  • Optional base: filter results by currency if needed across multiple symbols.

If you are focusing on a 3-month window, you can dynamically compute start as end minus ~90 days. FED_FUNDS is generally available at daily frequency; always consult frequencies in the response.

Example: 3-Month FED_FUNDS Timeseries Fetch

Replace YOUR_KEY with your actual key.

curl "https://interestratesapi.com/api/v1/timeseries?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(
start='2026-06-15',
end='2026-09-15',
symbols='FED_FUNDS',
api_key='YOUR_KEY'
)
)
data = resp.json()
print(data)
const response = await fetch(
'https://interestratesapi.com/api/v1/timeseries?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/timeseries?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY';
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
?>

Realistic JSON Response and Field Meanings

{
"success": true,
"base": "USD",
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"rates": {
"FED_FUNDS": {
"2026-06-17": 5.33,
"2026-06-18": 5.33,
"2026-06-19": 5.33,
"2026-06-20": 5.33,
"2026-06-21": 5.33,
"2026-06-24": 5.33,
"2026-06-25": 5.33,
"2026-06-26": 5.33,
"2026-06-27": 5.33,
"2026-06-28": 5.33,
"2026-07-01": 5.33,
"2026-07-02": 5.33,
"2026-07-03": 5.33,
"2026-07-05": 5.33,
"2026-07-08": 5.33,
"2026-07-09": 5.33,
"2026-07-10": 5.33,
"2026-07-11": 5.33,
"2026-07-12": 5.33,
"2026-07-15": 5.33,
"2026-07-16": 5.33,
"2026-07-17": 5.33,
"2026-07-18": 5.33,
"2026-07-19": 5.33,
"2026-07-22": 5.33,
"2026-07-23": 5.33,
"2026-07-24": 5.33,
"2026-07-25": 5.33,
"2026-07-26": 5.33,
"2026-07-29": 5.33,
"2026-07-30": 5.33,
"2026-07-31": 5.33,
"2026-08-01": 5.33,
"2026-08-02": 5.33,
"2026-08-05": 5.33,
"2026-08-06": 5.33,
"2026-08-07": 5.33,
"2026-08-08": 5.33,
"2026-08-09": 5.33,
"2026-08-12": 5.33,
"2026-08-13": 5.33,
"2026-08-14": 5.33,
"2026-08-15": 5.33,
"2026-08-16": 5.33,
"2026-08-19": 5.33,
"2026-08-20": 5.33,
"2026-08-21": 5.33,
"2026-08-22": 5.33,
"2026-08-23": 5.33,
"2026-08-26": 5.33,
"2026-08-27": 5.33,
"2026-08-28": 5.33,
"2026-08-29": 5.33,
"2026-08-30": 5.33,
"2026-09-02": 5.33,
"2026-09-03": 5.33,
"2026-09-04": 5.33,
"2026-09-05": 5.33,
"2026-09-06": 5.33,
"2026-09-09": 5.33,
"2026-09-10": 5.33,
"2026-09-11": 5.33,
"2026-09-12": 5.33,
"2026-09-13": 5.33
}
},
"frequencies": { "FED_FUNDS": "daily" },
"currencies": { "FED_FUNDS": "USD" }
}

Practical interpretation:

  • success: true indicates the request succeeded.
  • base: the currency associated with this series; for FED_FUNDS it is USD.
  • start_date, end_date: echoes the requested boundaries, possibly adjusted to first/last available data.
  • rates: nested mapping of symbol → date → value.
  • frequencies: for each symbol, the declared data frequency (e.g., daily).
  • currencies: per-symbol currency codes to help unify multi-symbol panels.

Time Series Pitfalls and Best Practices

  • Missing dates: Monetary policy rates may not publish on weekends/holidays. Do not assume contiguous daily keys. If your model requires business-day alignment, reindex and forward-fill carefully.
  • Frequency: FED_FUNDS often appears at a daily cadence; other rates can be monthly. Always read the frequencies field to avoid mis-aggregating data.
  • Window selection: For a 3-month dashboard, compute the start date programmatically and request only what you need to reduce payload and faster loads.
  • Storage: Normalize to a tidy format (symbol, date, value, currency) to simplify downstream joins and time-based indexing.

Try in your browser: Get started with Interest Rates API.

Historical: Point-in-Time Snapshots and Edge Cases

The /historical endpoint returns a single date’s value. This is ideal for end-of-month snapshots, compliance backfills, or reproducing the exact inputs to a previously run model. For monthly symbols, the last day with data in that month is used; for daily symbols, if the requested date has no print (e.g., weekend), the API returns the value for the nearest valid date in that window as per its data policy for the symbol (consult symbol frequency rules and your own alignment needs).

Example: Point-in-Time FED_FUNDS Lookup

Suppose you want the value aligned to 2025-06-15:

curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=FED_FUNDS&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/historical',
params=dict(
date='2025-06-15',
symbols='FED_FUNDS',
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=FED_FUNDS&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=FED_FUNDS&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

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

Interpretation:

  • date: The requested date.
  • rates: A per-symbol mapping for that date.
  • base, currencies: Reinforce currency and allow schema-driven processing.

Edge cases to consider:

  • Weekends/holidays: If a symbol does not publish on that day, plan for “nearest available” logic or fetch the relevant business day with /timeseries first.
  • Monthly symbols: For monthly data, the API uses the last day with data in the month; if you query mid-month, you’ll get the appropriate month’s available print according to its data cadence.

OHLC: Candlestick Data for Charting (Monthly or Weekly)

The /ohlc endpoint constructs candlesticks from daily data, producing open, high, low, and close per period. For 3-month dashboards, you can request monthly OHLC and render with Chart.js or Plotly for quick visual insights. Because OHLC is computed on-the-fly, you do not need to maintain separate aggregates.

Example: Monthly OHLC for FED_FUNDS

curl "https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=2026-06-15&end=2026-09-15&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/ohlc',
params=dict(
symbols='FED_FUNDS',
period='monthly',
start='2026-06-15',
end='2026-09-15',
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=2026-06-15&end=2026-09-15&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=2026-06-15&end=2026-09-15&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

{
"success": true,
"period": "monthly",
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"rates": {
"FED_FUNDS": [
{
"period": "2026-06",
"open": 5.33,
"high": 5.33,
"low": 5.33,
"close": 5.33,
"data_points": 10
},
{
"period": "2026-07",
"open": 5.33,
"high": 5.33,
"low": 5.33,
"close": 5.33,
"data_points": 23
},
{
"period": "2026-08",
"open": 5.33,
"high": 5.33,
"low": 5.33,
"close": 5.33,
"data_points": 22
},
{
"period": "2026-09",
"open": 5.33,
"high": 5.33,
"low": 5.33,
"close": 5.33,
"data_points": 9
}
]
}
}

Interpretation:

  • period: The aggregation cadence; choose weekly or monthly.
  • open, high, low, close: Candlestick values per period, derived from the underlying daily series.
  • data_points: Count of underlying daily observations included in that period; essential for detecting partial months or sparse data periods.

Chart Integration: Chart.js Example

Below is a minimal Chart.js snippet that consumes the OHLC output. Adapt your mapping from the returned JSON to the dataset format expected by your charting library.

<canvas id="fedFundsOhlcChart" width="800" height="400"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
(async function() {
const url = 'https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=2026-06-15&end=2026-09-15&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const rows = json.rates.FED_FUNDS;

// Prepare labels and data series
const labels = rows.map(r => r.period);
const opens = rows.map(r => r.open);
const highs = rows.map(r => r.high);
const lows = rows.map(r => r.low);
const closes = rows.map(r => r.close);

// Simple line chart of close values; candlestick plugins are available if preferred
const ctx = document.getElementById('fedFundsOhlcChart').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels,
datasets: [{
label: 'FED_FUNDS Close',
data: closes,
borderColor: '#1f77b4',
backgroundColor: 'rgba(31, 119, 180, 0.15)',
tension: 0.1
}]
},
options: {
responsive: true,
scales: {
y: { title: { display: true, text: 'Rate (%)' } },
x: { title: { display: true, text: 'Month' } }
}
}
});
})();
</script>

For candlestick visualization, consider a candlestick plugin or a library like Plotly, which natively supports OHLC traces.

Plotly Candlestick Example

<div id="plotlyFedFunds"></div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
(async function() {
const url = 'https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=2026-06-15&end=2026-09-15&api_key=YOUR_KEY';
const res = await fetch(url);
const json = await res.json();
const rows = json.rates.FED_FUNDS;

const data = [{
x: rows.map(r => r.period),
open: rows.map(r => r.open),
high: rows.map(r => r.high),
low: rows.map(r => r.low),
close: rows.map(r => r.close),
type: 'candlestick',
increasing: { line: { color: '#2ca02c' } },
decreasing: { line: { color: '#d62728' } },
name: 'FED_FUNDS'
}];

const layout = {
title: 'FED_FUNDS Monthly Candlesticks',
xaxis: { title: 'Period' },
yaxis: { title: 'Rate (%)' }
};

Plotly.newPlot('plotlyFedFunds', data, layout);
})();
</script>

Fluctuation: Change, High, Low, and Percentage Move

The /fluctuation endpoint summarizes how a symbol moved over a range. For a 3-month lens, this gives instant clarity on total change, highs, lows, and spread. It is particularly valuable for executive dashboards and alerting.

Example: 3-Month Fluctuation for FED_FUNDS

curl "https://interestratesapi.com/api/v1/fluctuation?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/fluctuation',
params=dict(
start='2026-06-15',
end='2026-09-15',
symbols='FED_FUNDS',
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/fluctuation?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/fluctuation?start=2026-06-15&end=2026-09-15&symbols=FED_FUNDS&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

{
"success": true,
"rates": {
"FED_FUNDS": {
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"start_value": 5.33,
"end_value": 5.33,
"change": 0.00,
"change_pct": 0.00,
"high": 5.33,
"low": 5.33
}
}
}

Interpretation:

  • start_value, end_value: The values at the edges of the window for the symbol.
  • change, change_pct: Absolute and percentage move across the range.
  • high, low: The maximum and minimum observed values during the range.

This is invaluable for alerting, formatted PDF reports, and summary tiles in dashboards.

Latest: Monitoring the Current Print

While most analytics focus on history, many front-ends display the latest print. The /latest endpoint returns the most recent available value per symbol (and supports multiple symbols for comparative views).

Example: Latest FED_FUNDS (plus ECB_MRO for context)

curl "https://interestratesapi.com/api/v1/latest?symbols=FED_FUNDS,ECB_MRO&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(
symbols='FED_FUNDS,ECB_MRO',
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/latest?symbols=FED_FUNDS,ECB_MRO&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/latest?symbols=FED_FUNDS,ECB_MRO&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

{
"success": true,
"date": "2026-09-15",
"base": "MIXED",
"rates": {
"FED_FUNDS": 5.33,
"ECB_MRO": 4.50
},
"dates": {
"FED_FUNDS": "2026-09-15",
"ECB_MRO": "2026-09-15"
},
"currencies": {
"FED_FUNDS": "USD",
"ECB_MRO": "EUR"
}
}

Use this endpoint for readouts in apps, real-time tickers, and quick comparisons. For analytics and backtesting, prefer /timeseries unless you only need the most current value.

Symbols: Discover Availability and Metadata

Before hard-coding identifiers, call /symbols to validate what’s available, filter by currency or category, and present options in UIs. For example, to list central bank rates in USD:

curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=USD&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/symbols',
params=dict(
category='central_bank',
base='USD',
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=USD&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/symbols?category=central_bank&base=USD&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

{
"success": true,
"count": 2,
"symbols": [
{
"symbol": "FED_FUNDS",
"name": "US Federal Funds Rate",
"category": "central_bank",
"country_code": "US",
"currency_code": "USD",
"frequency": "daily",
"description": "The interest rate at which depository institutions lend reserve balances to each other overnight"
}
]
}

The symbols response provides:

  • symbol: The identifier to use in other endpoints (e.g., FED_FUNDS).
  • name, description: Human-readable metadata for UIs and documentation.
  • category, country_code, currency_code: Useful for filtering and organizing lists.
  • frequency: Critical for downstream modeling decisions and charting interval choices.

Convert: Compare Loan Interest Costs Across Benchmarks

The /convert endpoint computes a simple loan cost comparison using the latest rate for two symbols. While this is not a substitute for full amortization or compounding logic, it’s very effective for interactive tools that quantify funding choices or rate spreads.

Example: Compare FED_FUNDS vs ECB_MRO for a USD 100,000 12-Month Loan

curl "https://interestratesapi.com/api/v1/convert?from=FED_FUNDS&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"
import requests

resp = requests.get(
'https://interestratesapi.com/api/v1/convert',
params=dict(
from='FED_FUNDS',
to='ECB_MRO',
amount=100000,
term_months=12,
api_key='YOUR_KEY'
)
)
print(resp.json())
const response = await fetch(
'https://interestratesapi.com/api/v1/convert?from=FED_FUNDS&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY'
);
const data = await response.json();
console.log(data);
<?php
$url = 'https://interestratesapi.com/api/v1/convert?from=FED_FUNDS&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY';
$response = file_get_contents($url);
print_r(json_decode($response, true));
?>

Realistic JSON Response and Field Meanings

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

Interpretation:

  • amount, term_months: Inputs for the simple-interest comparison.
  • from, to: Per-rate breakdown of rate, date, and total cost over the term.
  • difference: Spread and implied savings given the latest prints.

End-to-End Python Data Pipeline: Fetch → DataFrame → CSV/Parquet

Below is a complete Python example that:

  • Fetches a 3-month FED_FUNDS window using /timeseries.
  • Normalizes JSON to a pandas DataFrame.
  • Computes a few common analytics (rolling mean, day-over-day change).
  • Exports both CSV and Parquet for downstream systems.
import os
import requests
import pandas as pd
from datetime import date, timedelta

API_BASE = 'https://interestratesapi.com/api/v1/'
API_KEY = os.getenv('IR_API_KEY', 'YOUR_KEY')

def fetch_timeseries(symbol, start, end):
url = f'{API_BASE}timeseries'
params = dict(symbols=symbol, start=start, end=end, api_key=API_KEY)
r = requests.get(url, params=params)
r.raise_for_status()
data = r.json()
if not data.get('success'):
raise RuntimeError(f"API error: {data.get('error', 'Unknown error')}")
return data

def normalize_rates(json_data, symbol):
series = json_data['rates'][symbol]
df = pd.DataFrame([
{'date': pd.to_datetime(d), 'symbol': symbol, 'value': v}
for d, v in series.items()
])
df = df.sort_values('date').reset_index(drop=True)
df['currency'] = json_data['currencies'][symbol]
df['frequency'] = json_data['frequencies'][symbol]
return df

def compute_features(df):
# Example features on a daily series
df['d1_change'] = df['value'].diff()
df['d1_change_pct'] = df['value'].pct_change() * 100.0
df['rolling_7d_mean'] = df['value'].rolling(7, min_periods=1).mean()
return df

def export_data(df, out_dir='./exports', stem='fed_funds_3m'):
os.makedirs(out_dir, exist_ok=True)
csv_path = os.path.join(out_dir, f'{stem}.csv')
pq_path = os.path.join(out_dir, f'{stem}.parquet')
df.to_csv(csv_path, index=False)
try:
df.to_parquet(pq_path, index=False)
except Exception as e:
print(f"Parquet export skipped: {e}")
return csv_path, pq_path

if __name__ == '__main__':
end_date = date(2026, 9, 15)
start_date = end_date - timedelta(days=92) # approx. 3 months
start_str = start_date.isoformat()
end_str = end_date.isoformat()

symbol = 'FED_FUNDS'
raw = fetch_timeseries(symbol, start_str, end_str)
df = normalize_rates(raw, symbol)
df = compute_features(df)
csv_path, pq_path = export_data(df)

print('Exported:')
print(' CSV:', csv_path)
print(' Parquet:', pq_path)
print(df.tail())

Tips:

  • Use clean schema (date, symbol, value, currency, frequency) to support multi-symbol joins.
  • Compute features after sorting by date to avoid look-ahead bias.
  • Export both CSV (for universal tooling) and Parquet (for analytics platforms; compression and schema advantages).

To try this pipeline with live data, visit Explore Interest Rates API features.

Designing 3-Month Dashboards and Rolling Analytics

A TBILR-style “3-month historical” dashboard for FED_FUNDS typically includes:

  • Line chart of daily values over the last 90 days, highlighting policy meetings.
  • Monthly candlestick panel using /ohlc for the visible months.
  • Summary cards from /fluctuation: change, high, low, percentage move.
  • A “Latest” tile from /latest with the latest print date.
  • Download buttons that export CSV and Parquet slices for the same window.

Implementation notes:

  • Use /timeseries once per load; cache results to feed the line chart and compute internal rollups.
  • Invoke /ohlc for the same window to align chart sections; the data_points field is a sanity check for partial months.
  • Call /fluctuation for the window to display summary tiles; this avoids computing high/low client-side.
  • Provide “Download CSV” that simply streams your normalized DataFrame export from your server — consistent with your pipeline.

Performance and Reliability Patterns

Productionizing your integration with interestratesapi.com benefits from standard patterns:

  • Client-side retries: wrap GET requests with bounded retries and exponential backoff when encountering transient network errors.
  • Health checks and circuit breakers: isolate failures and fail fast to degradations by short-circuiting calls when your telemetry indicates an outage condition.
  • Regional routing: deploy your service near your users to reduce end-to-end latency; the API’s stateless GET interface is friendly to CDNs and edge proxies.
  • Observability: record endpoint, latency, status code, and success flag. Parse error payloads for targeted routing strategies (for example, fall back to cached data when appropriate).

Because interestratesapi.com’s responses are explicit and consistent across endpoints, it is straightforward to standardize middlewares for logging, error translation, and schema validation in your language of choice.

Error Handling and Troubleshooting

When a request fails, the response includes success=false and an error message. Some 404s may include details with available ranges. Build robust handlers that detect these cases and react appropriately (e.g., prompt for a different date range, or show a “no data” banner).

Common Error Shapes and Remediation

  • 401: The request did not include valid credentials. Ensure your credentials are attached to the query string correctly.
  • 403: The account is not permitted to access the resource.
  • 404: The symbols parameter did not match any known identifiers or no data exists for the specified date range. Confirm the symbol and adjust dates.
  • 422: Validation failure (e.g., invalid date format, misspelled symbol). Correct the payload shape or values.

Example: Handling a 422 in JavaScript

async function getSeries(start, end, symbols) {
const url = `https://interestratesapi.com/api/v1/timeseries?start=${start}&end=${end}&symbols=${symbols}&api_key=YOUR_KEY`;
const res = await fetch(url);
if (!res.ok) {
const text = await res.text();
throw new Error(`HTTP ${res.status}: ${text}`);
}
const json = await res.json();
if (!json.success) {
throw new Error(json.error || 'Unknown API error');
}
return json;
}

(async function run() {
try {
const data = await getSeries('2026-06-15', '2026-09-15', 'FED_FUNDS');
console.log('Timeseries points:', Object.keys(data.rates.FED_FUNDS).length);
} catch (err) {
console.error('Fetch failed:', err.message);
// Show user-friendly notification, log telemetry, fallback to cache, etc.
}
})();

For deeper exploration, visit Try Interest Rates API.

Complete Walkthrough: Building a Minimal FED_FUNDS Web App

To tie it all together, here’s a conceptual client-side sequence for a single-page dashboard:

  • On load, compute a 3-month window end=today, start=end-90 days.
  • Fetch /timeseries for FED_FUNDS; render a line chart and table.
  • Fetch /ohlc monthly for the same window; render a candlestick component.
  • Fetch /fluctuation for context tiles (change, high, low).
  • Fetch /latest for a “Last updated on {date}” banner.

JavaScript Implementation Sketch

<div id="summary"></div>
<div id="latest"></div>
<canvas id="seriesChart" width="800" height="200"></canvas>
<div id="ohlcChart"></div>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
(async function() {
const end = new Date('2026-09-15');
const start = new Date(end.getTime() - 90*24*60*60*1000);
const toISO = d => d.toISOString().slice(0,10);

const seriesUrl = `https://interestratesapi.com/api/v1/timeseries?start=${toISO(start)}&end=${toISO(end)}&symbols=FED_FUNDS&api_key=YOUR_KEY`;
const ohlcUrl = `https://interestratesapi.com/api/v1/ohlc?symbols=FED_FUNDS&period=monthly&start=${toISO(start)}&end=${toISO(end)}&api_key=YOUR_KEY`;
const fluctUrl = `https://interestratesapi.com/api/v1/fluctuation?start=${toISO(start)}&end=${toISO(end)}&symbols=FED_FUNDS&api_key=YOUR_KEY`;
const latestUrl = `https://interestratesapi.com/api/v1/latest?symbols=FED_FUNDS&api_key=YOUR_KEY`;

const [seriesRes, ohlcRes, fluctRes, latestRes] = await Promise.all([
fetch(seriesUrl), fetch(ohlcUrl), fetch(fluctUrl), fetch(latestUrl)
]);

const seriesJson = await seriesRes.json();
const ohlcJson = await ohlcRes.json();
const fluctJson = await fluctRes.json();
const latestJson = await latestRes.json();

// 1) Render latest
const latestRate = latestJson.rates.FED_FUNDS;
const latestDate = latestJson.dates.FED_FUNDS;
document.getElementById('latest').innerText =
`Latest FED_FUNDS: ${latestRate}% (as of ${latestDate})`;

// 2) Line chart for series
const series = seriesJson.rates.FED_FUNDS;
const labels = Object.keys(series).sort();
const values = labels.map(d => series[d]);

new Chart(document.getElementById('seriesChart').getContext('2d'), {
type: 'line',
data: {
labels,
datasets: [{ label: 'FED_FUNDS', data: values, borderColor: '#1f77b4', tension: 0.1 }]
},
options: { scales: { y: { title: { display: true, text: 'Rate (%)' } } } }
});

// 3) Summary tiles from fluctuation
const f = fluctJson.rates.FED_FUNDS;
document.getElementById('summary').innerText =
`3M Change: ${f.change} (${f.change_pct}%), High: ${f.high}, Low: ${f.low}`;

// 4) Candlestick chart via Plotly
const rows = ohlcJson.rates.FED_FUNDS;
const trace = {
x: rows.map(r => r.period),
open: rows.map(r => r.open),
high: rows.map(r => r.high),
low: rows.map(r => r.low),
close: rows.map(r => r.close),
type: 'candlestick',
name: 'FED_FUNDS'
};
Plotly.newPlot('ohlcChart', [trace], { title: 'FED_FUNDS OHLC (Monthly)' });
})();
</script>

Detailed Endpoint Documentation and Practical Use Cases

GET /api/v1/symbols — Catalogue

Purpose: Discover rate symbols by category, currency, and provider. Business value: programmatic discovery, UI dropdowns, validation, and metadata-driven analytics.

  • Filters: base (ISO 3-letter), category (central_bank|interbank|treasury|reference), provider (fred|ecb|bis).
  • Response fields: success, count, symbols[]. Each symbol includes symbol, name, category, country_code, currency_code, frequency, description.

Use cases:

  • Populate a selection UI for users to choose between FED_FUNDS and other rates like SOFR or US_TREASURY_3M.
  • Automated schema generation based on frequency and currency metadata.

GET /api/v1/latest — Latest Values

Purpose: Fast retrieval of current prints for one or more symbols. Business value: front-end widgets, monitoring dashboards, alerts.

  • Query: symbols (comma-separated), optional base and category.
  • Response: date, rates, dates (per-symbol latest date), currencies.

Use cases:

  • Show “as-of” banners with latest date and value for each symbol.
  • Cross-rate comparison cards (e.g., FED_FUNDS vs ECB_MRO).

GET /api/v1/historical — Point-in-Time

Purpose: Reproducible historical lookups for audits, EOM/EOD snapshots, and backtest reproducibility. Business value: accuracy, compliance, and alignment across analytics teams.

  • Query: date (Y-m-d), symbols (optional multi), base (optional).
  • Response: date, rates, currencies.

Use cases:

  • End-of-quarter snapshots for performance reports.
  • Exact replay of a signal computed on a known date.

GET /api/v1/timeseries — Historical Series

Purpose: Primary time series retrieval for modeling and visualization. Business value: single-call backfills, rolling window analytics, scalable ETL.

  • Query: start, end, symbols, optional base.
  • Response: success, base, start_date, end_date, rates, frequencies, currencies.

Use cases:

  • Backfill multi-year FED_FUNDS history for factor models.
  • Build recurring 3-month summaries or calendars of policy-driven moves.

GET /api/v1/fluctuation — Change Analytics

Purpose: Summarize movement across a range without client-side computation. Business value: reduced code, quick KPIs, and consistent calculations across teams.

  • Query: start, end, symbols.
  • Response per symbol: start_date, end_date, start_value, end_value, change, change_pct, high, low.

Use cases:

  • Executive summary tiles in dashboards.
  • Alerting when change_pct breaches thresholds.

GET /api/v1/ohlc — Candlestick Aggregates

Purpose: On-the-fly OHLC from daily data for charting and period-bound comparisons. Business value: simpler chart workflows and standardized definitions of open/high/low/close.

  • Query: symbols, optional period (weekly|monthly|quarterly), start, end.
  • Response: period, start_date, end_date, rates[symbol] = OHLC rows with data_points.

Use cases:

  • Multi-month candlestick dashboards for policy rate behavior.
  • Quality checks via data_points for partial months.

GET /api/v1/convert — Loan Cost Comparison

Purpose: Simple-interest comparison at the latest rates for two symbols. Business value: illustrative calculators for treasury, lending, and funding strategy.

  • Query: from, to, amount, optional term_months.
  • Response: from{}, to{}, difference{} with rate_spread and interest_saved.

Use cases:

  • Sales and advisory tools quantifying rate differentials.
  • Interactive widgets aligning consumers to benchmarked choices.

Comprehensive Example: Multi-Endpoint JSON Responses in One Flow

Below is a realistic sequence that might occur in a server-side ETL job for a 3-month window, showing combined responses across endpoints. Note: values are illustrative and echo the documented structures. This composite view helps with mapping fields into your data store.

1) /timeseries for FED_FUNDS

{
"success": true,
"base": "USD",
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"rates": {
"FED_FUNDS": {
"2026-06-17": 5.33,
"2026-06-18": 5.33
}
},
"frequencies": { "FED_FUNDS": "daily" },
"currencies": { "FED_FUNDS": "USD" }
}

2) /fluctuation for the same window

{
"success": true,
"rates": {
"FED_FUNDS": {
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"start_value": 5.33,
"end_value": 5.33,
"change": 0.00,
"change_pct": 0.00,
"high": 5.33,
"low": 5.33
}
}
}

3) /ohlc monthly for the same window

{
"success": true,
"period": "monthly",
"start_date": "2026-06-15",
"end_date": "2026-09-15",
"rates": {
"FED_FUNDS": [
{ "period": "2026-06", "open": 5.33, "high": 5.33, "low": 5.33, "close": 5.33, "data_points": 10 },
{ "period": "2026-07", "open": 5.33, "high": 5.33, "low": 5.33, "close": 5.33, "data_points": 23 },
{ "period": "2026-08", "open": 5.33, "high": 5.33, "low": 5.33, "close": 5.33, "data_points": 22 }
]
}
}

4) /latest for FED_FUNDS

{
"success": true,
"date": "2026-09-15",
"base": "MIXED",
"rates": { "FED_FUNDS": 5.33 },
"dates": { "FED_FUNDS": "2026-09-15" },
"currencies": { "FED_FUNDS": "USD" }
}

Mapping guidance:

  • Persist raw timeseries by date and symbol first; then compute derived analytics.
  • Store fluctuation and OHLC results in summary tables keyed by (symbol, period_start, period_end) to accelerate dashboards.
  • Persist latest to a separate “current snapshot” table for quick landing-page queries, updated on a predictable schedule.

Advanced Tips: Multi-Symbol Panels and Currency Normalization

While our focus is FED_FUNDS, realistic dashboards compare central bank rates and interbank benchmarks side by side (e.g., FED_FUNDS, SOFR, US_TREASURY_3M). You can request multiple symbols in /timeseries or /latest and use the base and currencies fields to ensure you model them consistently. For cross-currency panels, present rates in native currency (rates are unitless percentages but may come from different monetary zones); be explicit in labels and tooltips to avoid ambiguity.

Other considerations:

  • Consistency checks: Use /symbols to verify your universe before running time series fetches; fail fast on typos or deprecations.
  • Aggregation standards: For dashboards mixing daily and monthly series, resample the daily series to monthly averages or end-of-month values so comparisons are like-for-like.
  • Imputation policy: Always document your fill strategy (forward fill vs. nearest available) and apply it uniformly across models.

PHP and Python Helpers: Reusable GET Clients

Python Utility

import requests

class IRClient:
def __init__(self, api_key, base='https://interestratesapi.com/api/v1/'):
self.api_key = api_key
self.base = base

def get(self, path, **params):
params = {**params, 'api_key': self.api_key}
url = self.base + path.lstrip('/')
r = requests.get(url, params=params, timeout=30)
r.raise_for_status()
data = r.json()
if not data.get('success', True) and 'error' in data:
raise RuntimeError(data['error'])
return data

# Usage
# client = IRClient('YOUR_KEY')
# ts = client.get('timeseries', symbols='FED_FUNDS', start='2026-06-15', end='2026-09-15')

PHP Utility

<?php
class IRClient {
private $apiKey;
private $base;

public function __construct($apiKey, $base = 'https://interestratesapi.com/api/v1/') {
$this->apiKey = $apiKey;
$this->base = $base;
}

public function get($path, $params = []) {
$params['api_key'] = $this->apiKey;
$query = http_build_query($params);
$url = rtrim($this->base, '/') . '/' . ltrim($path, '/') . '?' . $query;
$response = file_get_contents($url);
if ($response === false) {
throw new Exception("HTTP request failed for $url");
}
$data = json_decode($response, true);
if (isset($data['success']) && $data['success'] === false) {
$msg = isset($data['error']) ? $data['error'] : 'Unknown API error';
throw new Exception($msg);
}
return $data;
}
}

// Usage:
// $client = new IRClient('YOUR_KEY');
// $ts = $client->get('timeseries', ['symbols' => 'FED_FUNDS', 'start' => '2026-06-15', 'end' => '2026-09-15']);
?>

Security, Governance, and Observability Patterns

Integrating interestratesapi.com into enterprise stacks benefits from a few patterns:

  • Per-application credentials: issue distinct credentials per service or environment so you can audit and rotate without cross-impact.
  • Roles and separation: segment responsibilities between data acquisition, transformation, and consumption layers for traceability.
  • Audit logs: record request metadata and response status at your gateway for compliance and incident analysis.
  • Data locality: co-locate your ETL runners and storage with your application tier to minimize transfer latencies; the stateless GET interface makes this simple.

These patterns amplify the strengths of interestratesapi.com’s clean endpoint design, helping you deliver robust and transparent data services internally.

FAQ: Modeling Considerations for FED_FUNDS 3-Month Analytics

  • How do I treat non-business days? Use /timeseries to fetch a continuous span and then reindex to the business calendar you require, forward-filling or skipping as your methodology dictates.
  • Why do OHLC data_points matter? They indicate how many daily observations compose a monthly or weekly candle, which helps identify partial periods and ensure apples-to-apples comparisons.
  • How do I combine FED_FUNDS with US_TREASURY_3M or SOFR? Request multiple symbols in /timeseries and pivot to a wide matrix keyed by date, then standardize frequency (e.g., daily) via left-joins and consistent fill rules.

Putting It All Together and Next Steps

A production-quality TBILR-style “3-month historical” dashboard for FED_FUNDS can be built rapidly on top of interestratesapi.com:

  • Use /timeseries to fetch the rolling 3-month window for daily line charts and CSV/Parquet exports.
  • Use /ohlc with monthly to power candlestick charts that summarize sub-month volatility (or stability) and reveal intra-month dynamics.
  • Use /fluctuation for KPIs like absolute/percentage change and high/low, enabling simple alerting and executive summaries.
  • Use /historical to anchor point-in-time snapshots for compliance, backtesting, and reproducible audits.
  • Use /latest for prominent as-of badges and real-time context.
  • Use /symbols to validate symbol universes and drive dynamic UI lists.

With these building blocks, you can deliver reliable, fast analytics without reinventing the data acquisition wheel. Start building today:

By standardizing on interestratesapi.com for your interest rate time series, you minimize integration overhead and maximize reliability. The result is a sustainable data pipeline that turns raw historical rates into actionable dashboards, analytics, and decisions — from 3-month horizons to multi-decade backtests.

Ready to get started?

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

Get API Key

Related posts