
I Built a Recession Indicator Dashboard With Free APIs — What Signals Do You Track?
I've been obsessed with economic data APIs lately, and I ended up building a simple recession probability dashboard using completely free data sources. Here's what I'm tracking: The Signals 1. Yield Curve Inversion (FRED: T10Y2Y) When the 10-year Treasury yield drops below the 2-year yield, it has preceded every US recession since 1955. Currently: the curve has been inverted for months. import requests FRED_KEY = " your_key " def get_latest ( series_id ): url = " https://api.stlouisfed.org/fred/series/observations " params = { " series_id " : series_id , " api_key " : FRED_KEY , " file_type " : " json " , " sort_order " : " desc " , " limit " : 1 } data = requests . get ( url , params = params ). json () return float ( data [ " observations " ][ 0 ][ " value " ]) spread = get_latest ( " T10Y2Y " ) print ( f " Yield spread: { spread } " ) print ( " ⚠️ INVERTED " if spread < 0 else " ✅ Normal " ) 2. Unemployment Rate Trend (FRED: UNRATE) The Sahm Rule: if the 3-month moving average of un
Continue reading on Dev.to Python
Opens in a new tab




