USAspending API: Get agency spending
Gets a federal agency's fiscal-year budgetary resources, obligations, share of federal obligations, new award count, top recipients and spending classes from USAspending.
Unofficial. Not affiliated with or endorsed by USAspending.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Agency, required
agency Federal agency name or common abbreviation, for example NASA or Department of Defense.
EPA
- Fiscal Year optional
fiscal_year Federal fiscal year, for example 2025. Defaults to the latest year with agency data.
Not set
Whole number.
Input as JSON
{ "agency": "EPA"}Output
{ "as_of_date": "2026-10-23", "agency_code": "068", "agency_link": "https://www.usaspending.gov/agency/environmental-protection-agency" , "agency_name": "Environmental Protection Agency", "fiscal_year": 2026, "top_recipients": [ { "name": "FLORIDA DEPARTMENT OF ENVIRONMENTAL PROTECTION", "page_link": "https://www.usaspending.gov/recipient/ae3e08de-48a4-ddbd-7a58-53e1fb14742f-C/latest" , "amount_usd": 2007463505 }, { "name": "THE STATE OF OHIO OFFICE OF BUDGET AND MANAGEMENT", "page_link": "https://www.usaspending.gov/recipient/615ca93b-904d-c303-bd34-715393928147-C/latest" , "amount_usd": 813141191 }, { "name": "ILLINOIS ENVIRONMENTAL PROTECTION AGENCY", "page_link": "https://www.usaspending.gov/recipient/fc0efc9e-c129-b96b-fa39-cfefcb2eb204-C/latest" , "amount_usd": 705470519 } ], "number_of_awards": 3579, "total_obligations_usd": 21215321918.57, "top_spending_categories": [ { "name": "Grants, subsidies, and contributions", "page_link": "https://www.usaspending.gov/agency/environmental-protection-agency" , "amount_usd": 14628663614.36 }, { "name": "Other services from non-Federal sources", "page_link": "https://www.usaspending.gov/agency/environmental-protection-agency" , "amount_usd": 2267884750.52 }, { "name": "Full-time permanent", "page_link": "https://www.usaspending.gov/agency/environmental-protection-agency" , "amount_usd": 1652459740.32 } ], "total_budgetary_resources_usd": 56866106074.7, "share_of_federal_obligations_percent": 0.2139}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"usaspending.gov/get_agency_spending","input":{"agency":"EPA"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "usaspending.gov/get_agency_spending" , "input": { "agency": "EPA" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "usaspending.gov/get_agency_spending" , "input": { "agency": "EPA" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run usaspending.gov/get_agency_spending# with {"agency":"EPA"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "agency" ], "properties": { "agency": { "type": "string", "description": "Federal agency name or common abbreviation, for example NASA or Department of Defense." }, "fiscal_year": { "type": "integer", "description": "Federal fiscal year, for example 2025. Defaults to the latest year with agency data." } }}Output schema
{ "type": "object", "required": [ "agency_name", "fiscal_year", "total_budgetary_resources_usd", "total_obligations_usd", "number_of_awards", "top_recipients", "top_spending_categories", "as_of_date", "agency_link", "agency_code" ], "properties": { "as_of_date": { "type": "string" }, "agency_code": { "type": "string" }, "agency_link": { "type": "string" }, "agency_name": { "type": "string" }, "fiscal_year": { "type": "integer" }, "top_recipients": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "page_link": { "type": [ "string", "null" ] }, "amount_usd": { "type": "number" } } } }, "number_of_awards": { "type": "integer" }, "total_obligations_usd": { "type": "number" }, "top_spending_categories": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "page_link": { "type": [ "string", "null" ] }, "amount_usd": { "type": "number" } } } }, "total_budgetary_resources_usd": { "type": "number" }, "share_of_federal_obligations_percent": { "type": "number" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
usaspending.gov/get_agency_spending- Returns
- budgetary resources, obligations, share of federal obligations, award count, top recipients, top spending categories, data date
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method usaspending.gov/get_agency_spending with the inputs above.
Ask your agent
- How much budget did NASA have available and how much did it obligate in fiscal year 2025?
- What share of total federal obligations went to the Department of Defense in FY 2024, and who were its top recipients?
- Show me the number of new awards the VA made last fiscal year along with its biggest spending categories on usaspending.gov.
- Pull up the Department of Energy's budgetary resources and obligations for fiscal 2023, including the data date.
- Which companies received the most money from the Department of Health and Human Services in 2025, and what were the main spending classes?
See more
All USAspending methodsReturns federal obligations and distinct awards for a company or organization, including its parent and child recipient records. Covers the selected fiscal year or the last five fiscal years.
usaspending.gov/get_company_federal_awardsSearches USAspending federal awards by keywords, awarding agency, state of performance and date across contracts, grants, loans and direct payments. Searches from October 1, 2007 onward.
usaspending.gov/search_federal_awardsFinds U.S. federal grant opportunities by topic, agency, applicant type and status, with funding and eligibility details. Open results exclude opportunities whose closing date has passed.
grants.gov/search_grantsSearches USAJOBS federal jobs by keywords, location, salary threshold and applicant group, in website relevance order. Salary ranges may start below the threshold; annual pay or remote status is null when the announcement does not state it.
usajobs.gov/search_jobsFinds NIH research grants by topic, organisation, or researcher name. Searches the last five fiscal years by default.
reporter.nih.gov/search_grantsReturns US national debt (Debt to the Penny) for a given date, or the latest published day. Dates without a record use the previous published day.
home.treasury.gov/get_national_debtFinds active federal contract notices on SAM.gov that match keywords, agency, place of performance, set-aside, notice type and posting period.
sam.gov/search_contract_opportunitiesFind Federal Register rules, proposed rules, notices, and presidential documents by topic, agency, publication dates, and comment status. Significant means designated significant by the source; documents without that designation show no.
federalregister.gov/search_rules