probe-gate
Demonstrates fetching the Monthly Treasury Statement summary showing receipts, outlays, and deficit/surplus.
curl 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_1?page%5Bsize%5D=3&sort=-record_date'
import requests
resp = requests.get(
"https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_1",
params={
'page[size]': '3',
'sort': '-record_date',
},
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("treasury")
result = api.fetch("v1/accounting/mts/mts_table_1", page[size]=3, sort="-record_date")
for item in result:
print(item)
const resp = await fetch("https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_1?page%5Bsize%5D=3&sort=-record_date");
const data = await resp.json();