Finance
U.S. Treasury logo

U.S. Treasury API

treasury.gov

US Treasury - yield curves, TIPS yields, bill rates, national debt, and auction results.

Actions
7
Category
Finance
Login
Not required
Output
JSON

Call the U.S. Treasury API

Submit a task, then poll the job until it settles. This example runs tr_auction_results.

curl -X POST https://api.anakin.io/v1/wire/task \
  -H "X-API-Key: $ANAKIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "tr_auction_results",
    "params": {
      "security_type": "<security_type>",
      "limit": 10
    }
  }'

7 actions on treasury.gov

Read

  • Auction Results

    tr_auction_resultsread2 credits / call

    Returns Treasury security auction results for bills, notes, bonds, TIPS, and FRN with yields and bid-to-cover.

    security_type
    string
    limit
    integer
  • Average Interest Rates

    tr_avg_interest_ratesread1 credit / call

    Returns monthly average interest rates on Treasury securities by type.

    limit
    integer
  • Bill Rates

    tr_bill_ratesread2 credits / call

    Returns daily Treasury bill auction rates by maturity from 4 weeks to 52 weeks.

    year
    integer
    limit
    integer
  • Exchange Rates

    tr_exchange_ratesread1 credit / call

    Returns quarterly Treasury reporting exchange rates for over 170 countries.

    currency
    string
    limit
    integer
  • National Debt

    tr_debt_to_pennyread1 credit / call

    Returns daily total public debt, debt held by public, and intragovernmental holdings.

    limit
    integer
  • Real Yield Curve

    tr_real_yield_curveread1 credit / call

    Returns daily TIPS real yield curve rates from 5 years to 30 years.

    year
    integer
    limit
    integer
  • Yield Curve

    tr_yield_curveread1 credit / call

    Returns daily constant maturity Treasury yield curve rates with 10y-2y and 10y-3m spreads.

    year
    integer
    limit
    integer
    date
    string

U.S. Treasury API questions

Is there an API for U.S. Treasury?
U.S. Treasury does not offer a public data API for this, but Anakin Wire provides 7 maintained endpoints for treasury.gov. You call Anakin's REST API with an action ID and parameters and get structured JSON back; Anakin handles the browser, proxies, anti-bot, and parsing.
How do I scrape U.S. Treasury data?
POST to https://api.anakin.io/v1/wire/task with your API key, the action ID, and its parameters, then poll GET /v1/wire/jobs/{id} until the job settles. There is nothing to install and no scraper to maintain — when treasury.gov changes its markup, Anakin updates the action.
Do I need a U.S. Treasury account?
No. Every U.S. Treasury action listed here runs anonymously — no account and no credentials required.
What does the U.S. Treasury API cost?
Usage-based credits, charged per call and refunded automatically when a job fails. New accounts start with 300 free credits and no card. See anakin.io/pricing for the current rates.

More Finance APIs

All Finance sites