Twinkle HubTwinkle Hub

美國聯邦機關年度預算 / 支出

us_get_agency_spending

🇺🇸 États-Unislecture seule

關鍵字 / Keywords: 美國聯邦 機關 部會 預算 支出 obligation outlay budget budgetary_resources FY toptier_code agency DOD DOE NASA GSA Treasury USASpending federal spending rollup

Scope: one federal agency's per-FY budgetary rollup — total budgetary resources · obligated · outlayed · by-period breakdown.

Endpoint: GET https://api.usaspending.gov/api/v2/agency/{toptier_code}/budgetary_resources/ (with fallback resolution via GET https://api.usaspending.gov/api/v2/references/toptier_agencies/ when the caller passes an agency name substring)

Args: toptier_code: 3-4-digit federal toptier_code (e.g. "097" DOD, "089" Energy, "075" HHS, "1500" Justice sub). Also accepts an agency name substring or abbreviation ("Department of Defense", "DOD", "NASA") — resolved via the toptier reference list on first use. fiscal_year: restrict to a single FY (default: all FYs since data started ~FY17).

Returns dict {toptier_code, agency_name, fiscal_year_filter, agency_data_by_year: [{fiscal_year, agency_budgetary_resources, agency_total_obligated, agency_total_outlayed, total_budgetary_resources, agency_obligation_by_period: [{period, obligated}, ...]}, ...]}. License: "Creative Commons Zero v1.0 Universal (CC0-1.0)". Rate-limited to ~5 req/sec.

Paramètres

NomTypeDescription
toptier_code *string
fiscal_yearinteger
Schéma JSON brut
{
  "properties": {
    "toptier_code": {
      "title": "Toptier Code",
      "type": "string"
    },
    "fiscal_year": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fiscal Year"
    }
  },
  "required": [
    "toptier_code"
  ],
  "title": "us_get_agency_spendingArguments",
  "type": "object"
}

Comment appeler

Amorce — paramètres dans le tableau
us_get_agency_spending({ toptier_code: "…" })