Skip to content
Search/
CyberMax › Answers

How to get daily US Treasury yields and macro data into pandas

Updated 2026-10-29 · Data and API builders · by CyberMax

Short answer

The Curvewire dataset mirrors public Treasury yield curve rates (nominal and real) and monthly BLS series. Load "treasury_yields", pick the 2-year and 10-year columns and subtract to get the 10y-2y spread; a negative value means the curve is inverted.

  1. pip install datasets
  2. Load "treasury_yields" (daily) or "treasury_real_yields".
  3. Compute spread = 10-year − 2-year.
  4. Load "bls_monthly" for inflation and jobs series to plot alongside.

Copy-paste code

Data: CyberMax dataset on Hugging Face; load it with the datasets library (pip install datasets)

from datasets import load_dataset

ds = load_dataset("CyberMax-tools/curvewire-us-macro-panel", "treasury_yields", split="train")
df = ds.to_pandas()
print(len(df), "rows")
print(df.head())

Good to know

Public data for information only; not financial advice.

Curvewire Brief icon

Curvewire Brief: Every Monday: US rates and macro, on one page

from $19/month

Want it read for you every Monday? The Curvewire Brief turns this data into a rates and macro brief (PDF + CSVs): $19/month, cancel any time.

Secure checkout · 14-day fix-or-refund if it doesn't work as described (terms)

Free: the Free API Starter Kit

Copy-paste calls for 4 APIs with free daily tiers (CVE priority, VIN recalls, US duty rates, email checks), then 5 short emails on KEV/EPSS, MCP and free data.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.