A US federal top-tier agency's profile and budget overview: name, abbreviation, mission, website, congressional justification link, number of sub-agencies, the agency's award totals for the fiscal year (obligations, transaction count, latest action date), and its budgetary resources, obligations and outlays by fiscal year (with obligations by reporting period), plus the disaster and emergency funding laws that apply. Pick the agency by toptier_code (from /usaspending/v1/agencies) or by name or abbreviation.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
toptier_code
string
Agency top-tier code, e.g. 097 (Department of Defense). Example: 097
name
string
Agency name, abbreviation or slug instead of the code, e.g. Department of Defense or DOD.
fiscal_year
integer
Fiscal year for the profile and award totals (2008 onward; default the agency's current year). Example: 2024
import os, requests
res = requests.get(
"https://api.api.sh/usaspending/v1/agency",
params={"toptier_code": "097"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/usaspending/v1/agency");
url.searchParams.set("toptier_code", "097");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.