
FRED API: Access 800,000+ Economic Datasets for Free (Inflation, GDP, Unemployment)
I was arguing with a coworker about whether inflation was actually going down. Instead of googling random charts, I pulled real Federal Reserve data in 30 seconds. Here's how you can do the same. What is FRED? FRED (Federal Reserve Economic Data) is maintained by the St. Louis Fed. It has 816,000+ time series covering: Inflation (CPI, PCE) GDP and economic growth Unemployment rates Interest rates Housing prices And basically every economic indicator you can think of Free API key — takes 30 seconds to get one at fred.stlouisfed.org . Setup import requests from datetime import datetime API_KEY = " your_free_api_key_here " # Get at fred.stlouisfed.org/docs/api/api_key.html BASE = " https://api.stlouisfed.org/fred " def fred_get ( endpoint , ** params ): params [ " api_key " ] = API_KEY params [ " file_type " ] = " json " return requests . get ( f " { BASE } / { endpoint } " , params = params ). json () Get Inflation Data (CPI) # CPIAUCSL = Consumer Price Index for All Urban Consumers data
Continue reading on Dev.to Python
Opens in a new tab




