DEV Community

Alex Spinov
Alex Spinov

Posted on

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")
Enter fullscreen mode Exit fullscreen mode

2. Unemployment Rate Trend (FRED: UNRATE)
The Sahm Rule: if the 3-month moving average of unemployment rises 0.5% above its 12-month low, recession is imminent.

3. Initial Jobless Claims (FRED: ICSA)
Rising claims = companies starting to lay off.

4. Consumer Sentiment (FRED: UMCSENT)
When people feel pessimistic, they spend less → economy slows.

5. ISM Manufacturing (FRED: MANEMP)
Manufacturing employment declining = early warning.

The Dashboard

I combined these into a simple Python script that gives me a traffic light:

  • 🟢 0-1 signals triggered = expansion
  • 🟡 2-3 signals = caution
  • 🔴 4-5 signals = recession likely

All data from FRED API (free, 120 req/min) + World Bank API (free, no key).

My Question for You

What economic signals do you track? Do you have a different recession model?

I'm also curious:

  • Do you use FRED or some other data source?
  • Have you built any financial dashboards with free APIs?
  • What's the most underrated economic indicator you know?

I've been building tools around free APIs (150+ so far on GitHub) and FRED has been the biggest surprise — 800K+ time series, all free, going back to 1947.

What's your favorite free data API?

Top comments (0)