
5 Government APIs That Give You Data Worth Thousands (For Free)
Most developers know about the big public APIs — Twitter, GitHub, Google Maps. But there's a goldmine of government data APIs that almost nobody uses. These APIs provide data that consulting firms charge thousands for. Market research, economic indicators, patent filings, import/export data — all free, no API key needed. 1. FRED API — 800,000+ Economic Time Series The Federal Reserve Economic Data API gives you access to every major economic indicator: GDP, unemployment, inflation, interest rates, housing prices, stock indices. import httpx # No API key needed for basic access url = " https://api.stlouisfed.org/fred/series/observations " params = { " series_id " : " GDP " , " api_key " : " DEMO_KEY " , # Get free key at fred.stlouisfed.org " file_type " : " json " , " observation_start " : " 2020-01-01 " } data = httpx . get ( url , params = params ). json () for obs in data [ ' observations ' ][ - 5 :]: print ( f " { obs [ ' date ' ] } : $ { float ( obs [ ' value ' ]) : ,. 0 f } B " )
Continue reading on Dev.to Python
Opens in a new tab



