Skip to main content
U.S. Treasury fiscal data API providing national debt levels, federal spending, revenue, and exchange rate data. Best for fiscal policy analysis, tracking government debt trends, or retrieving official U.S. exchange rates. Covers the federal government’s financial position — complementary to BEA (economic output) and BLS (labor/prices). 2 example endpoints available through Lava’s AI Gateway. See the U.S. Treasury API docs for full documentation.
This provider is managed — no additional setup required.
This is a catch-all provider — any valid URL under https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2 is supported. US Treasury fiscal data API. Construct URL as https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/{endpoint}. Common endpoints: /accounting/od/debt_to_penny, /accounting/od/rates_of_exchange, /revenue/mts/mts_table_1. Supports ?fields=, ?filter=, ?sort=, ?page[size]= query params. The endpoints below are curated examples.

Endpoints

Get US national debt (debt to the penny)

GET https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?fields=record_date,tot_pub_debt_out_amt&sort=-record_date&page[size]=5 — Free
const data = await lava.gateway('https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?fields=record_date,tot_pub_debt_out_amt&sort=-record_date&page[size]=5', { method: 'GET' });

Get Treasury exchange rates

GET https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/rates_of_exchange?fields=record_date,country_currency_desc,exchange_rate&sort=-record_date&page[size]=5 — Free
const data = await lava.gateway('https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/rates_of_exchange?fields=record_date,country_currency_desc,exchange_rate&sort=-record_date&page[size]=5', { method: 'GET' });

Next Steps

All Providers

Browse all supported AI providers

Forward Proxy

Learn how to construct proxy URLs and authenticate requests