The Interest Rates Snapshot API lets you pull the latest published interest rate data for all major central banks in the world.We source our data directly from global central banks like the Federal Reserve, Peopleβs Bank of China, European Central Bank, Bank of Japan, and other major monetary authorities. The real-time interest rate data comes from official monetary policy announcements.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.
import requests# add your API key to the headersheaders = { "X-API-KEY": "your_api_key_here"}# create the URLurl = 'https://api.financialdatasets.ai/macro/interest-rates/snapshot'# make API requestresponse = requests.get(url, headers=headers)# parse snapshot from the responseinterest_rates = response.json().get('interest_rates')