USAspending API ReferenceIndependent
Try the API

Sub-Agency Count

GET/api/v2/agency/{toptier_code}/sub_agency/count/

Returns the count of unique Sub-Agencies and Offices associated with an agency for a single fiscal year

Request

curl 'https://api.usaspending.gov/api/v2/agency/012/sub_agency/count/'

Path parameters

  • toptier_codestringRequired

    Example 012

Try it

Runs against the live API. Responses are real data.

GET/api/v2/agency/012/sub_agency/count/

Response · 200

  • toptier_codestringRequired
  • fiscal_yearnumberRequired
  • sub_agency_countnumberRequired
  • office_countnumberRequired
  • messagesarray of stringRequired

    An array of warnings or instructional directives to aid consumers of this endpoint with development and debugging.

Example response
{
  "toptier_code": "012",
  "fiscal_year": 2018,
  "sub_agency_count": 20,
  "office_count": 32,
  "messages": []
}

Recent changes

No contract changes to this endpoint since October 2024. The changelog covers every endpoint.

Contract notes

  • The contract doesn't declare toptier_code in its URL template, so it was added here from the path.

Generated from contracts/v2/agency/toptier_code/sub_agency/count.md in the USAspending API repo.

Loading…