USAspending API ReferenceIndependent
Try the API

Federal Accounts Landing Page

POST/api/v2/federal_accounts/

This endpoint supports the federal account landing page, which provides a list of all federal accounts for which individual federal accounts pages are available on USAspending.gov.

This endpoint returns a list of federal accounts, their number, name, managing agency, and budgetary resources.

Request

curl -X POST 'https://api.usaspending.gov/api/v2/federal_accounts/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "agency_identifier": "339",
    "fy": "2018"
  },
  "sort": {
    "direction": "asc",
    "field": "account_name"
  }
}'

Request body

The filters object is shared by every search endpoint. The filter object explains each filter with examples.

  • filtersobject · AdvancedFilterObject2 fields

    The filter takes a fiscal year, but if one is not provided, it defaults to the last certified fiscal year.

    • fystring

      Providing fy does not change the rows that are returned, instead, it limits the budgetary_resources value to the fiscal year indicated. Federal accounts with no submissions for that fiscal year will return null.

      Default previous fiscal year

    • agency_identifierstring
  • sortobject · SortObject2 fields
    • directionenum (string)

      The direction results are sorted by. asc for ascending, desc for descending.

      Allowed values
      • asc
      • desc

      Default desc

    • fieldstring

      The field that you want to sort on.

      Default budgetary_resources + Members + `budgetary_resources` + `account_name` + `account_number` + `managing_agency`

  • limitnumber

    The number of results to include per page.

    Default 50

  • pagenumber

    The page of results to return based on the limit.

    Default 1

  • keywordstring

    The keyword that you want to search on. Can be used to search by name, number, managing agency, and budgetary resources.

Try it

Runs against the live API. Responses are real data.

POST/api/v2/federal_accounts/

Response · 200

  • previousnumberNullable
  • countnumberRequired
  • limitnumberRequired
  • hasNextbooleanRequired
  • pagenumberRequired
  • hasPreviousbooleanRequired
  • nextnumberRequiredNullable
  • fystringRequired
  • resultsarray of FederalAccountListing7 fields
    • account_namestringRequiredNullable

      Name of the federal account. null when the name is not provided.

    • account_numberstringRequiredNullable

      The number for the federal account. null when no account number is provided.

    • account_idnumberRequired

      A unique identifier for the federal account

    • managing_agency_acronymstringRequired
    • agency_identifierstringRequired
    • budgetary_resourcesnumberRequiredNullable
    • managing_agencystringRequired
Example response
{
  "count": 0,
  "limit": 0,
  "hasNext": false,
  "page": 0,
  "hasPrevious": false,
  "next": null,
  "fy": "",
  "results": [
    {
      "account_name": null,
      "account_number": null,
      "account_id": 0,
      "managing_agency_acronym": "",
      "agency_identifier": "",
      "budgetary_resources": null,
      "managing_agency": ""
    }
  ]
}

Recent changes

Generated from contracts/v2/federal_accounts.md in the USAspending API repo.

Loading…