Interest Rates (Historical)
curl --request GET \
--url https://api.financialdatasets.ai/macro/interest-rates \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/macro/interest-rates"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/macro/interest-rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/macro/interest-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/macro/interest-rates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/macro/interest-rates")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/macro/interest-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"interest_rates": [
{
"bank": "<string>",
"name": "<string>",
"rate": 123,
"date": "<string>"
}
],
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Interest Rates
Historical
Get the daily policy rate of 10 major central banks, one row per calendar day, back to the 1940s.
GET
/
macro
/
interest-rates
Interest Rates (Historical)
curl --request GET \
--url https://api.financialdatasets.ai/macro/interest-rates \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/macro/interest-rates"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/macro/interest-rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/macro/interest-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/macro/interest-rates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/macro/interest-rates")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/macro/interest-rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"interest_rates": [
{
"bank": "<string>",
"name": "<string>",
"rate": 123,
"date": "<string>"
}
],
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Overview
The Interest Rates API lets you pull the policy rate of 10 major central banks as a daily series: one row per calendar day, newest first, with a rate change appearing on the first day the new rate is in effect. We source our data from authoritative sources that compile each central bank’s official policy rate. The daily series is published once a week, so the newest day is typically two to nine days behind the calendar. For the Federal Reserve the rate is the midpoint of the target range (for example3.875 for a 3.75 to 4.00 percent range).
To get started, please create an account and grab your API key at financialdatasets.ai.
You will use the API key to authenticate your API requests.
Coverage
| Central Banks | Years of Coverage | Frequency | Updated |
|---|---|---|---|
| 10 | 70+ years | Daily | Weekly, as the source publishes |
Available Central Banks
You can fetch a list of available central banks with aGET request to:
https://api.financialdatasets.ai/macro/interest-rates/banks/
Window and pagination
bank is required. start_date and end_date are optional and inclusive. With no dates the response covers the trailing five years; pass start_date to reach further back (for example start_date=1954-07-01 for the whole Federal Reserve series).
Responses are paged at 10 rows, newest first. When more rows remain the response carries next_page_url; request it as-is to continue.
Getting Started
There are only 3 steps for making a successful API call:- Add your API key to the header of the request as
X-API-KEY. - Add the
bankparameter, which is required - Execute the API request.
Example
Interest Rates
import requests
# add your API key to the headers
headers = {
"X-API-KEY": "your_api_key_here"
}
# set parameters
bank = 'FED' # required
start_date = '2000-01-01' # optional
end_date = '2025-01-01' # optional
# create the URL with parameters
url = (
f'https://api.financialdatasets.ai/macro/interest-rates'
f'?bank={bank}'
f'&start_date={start_date}'
f'&end_date={end_date}'
)
# make API request
response = requests.get(url, headers=headers)
# parse the first page from the response
interest_rates = response.json().get('interest_rates')
next_page_url = response.json().get('next_page_url') # present while more rows remain
Authorizations
API key for authentication.
Query Parameters
The central bank code, e.g. FED, ECB, BOJ. Use the /macro/interest-rates/banks endpoint to get the list of available banks.
The first date to return, inclusive, in YYYY-MM-DD format. Defaults to five years before end_date when both dates are omitted; omit it with an end_date to get all available history through that date.
The last date to return, inclusive, in YYYY-MM-DD format. Defaults to today.
Opaque pagination cursor from a previous response's next_page_url. When provided, all other query parameters are ignored: the cursor carries the original request's filters. Treat it as opaque; do not construct or modify it.