USAspending API ReferenceIndependent
Try the API

Custom award and account data

Request a file for any filter, then poll until it is ready.

Open a row for parameters and ready-to-run samples. The full reference has every field and a live console.

GETList Budget Functions/api/v2/budget_functions/list_budget_functions/

This route sends a request to the backend to retrieve a list of all Budget Functions ordered by their title.

curl 'https://api.usaspending.gov/api/v2/budget_functions/list_budget_functions/'
POSTList Budget Subfunctions/api/v2/budget_functions/list_budget_subfunctions/

This route sends a request to the backend to retrieve a list of all Budget Subfunctions that can be filtered by Budget Function, ordered by their title.

budget_function
curl -X POST 'https://api.usaspending.gov/api/v2/budget_functions/list_budget_subfunctions/' \
  -H 'Content-Type: application/json' \
  -d '{
  "budget_function": "800"
}'
POSTCustom Account Data/api/v2/download/accounts/

These endpoints are used to power USAspending.gov's download center.

account_levelfile_formatfilterscolumns
curl -X POST 'https://api.usaspending.gov/api/v2/download/accounts/' \
  -H 'Content-Type: application/json' \
  -d '{
  "account_level": "treasury_account",
  "file_format": "csv",
  "filters": {
    "fy": "2018",
    "quarter": "1",
    "submission_types": [
      "account_balances",
      "award_financial"
    ],
    "def_codes": [
      "L",
      "M",
      "O"
    ]
  }
}'
POSTAssistance Download/api/v2/download/assistance/

Creates a new download job for the requested award and returns a link to a zipped file containing contract award data

award_idfile_format
curl -X POST 'https://api.usaspending.gov/api/v2/download/assistance/' \
  -H 'Content-Type: application/json' \
  -d '{
  "award_id": "ASST_NON_H79TI081692_7522"
}'
POSTAward Download/api/v2/download/awards/

This endpoint is used by the Advanced Search download page.

columnsfiltersfile_formatlimit
curl -X POST 'https://api.usaspending.gov/api/v2/download/awards/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "agencies": [
      {
        "type": "awarding",
        "tier": "toptier",
        "name": "Department of Agriculture"
      }
    ],
    "keywords": [
      "Defense"
    ]
  },
  "columns": [
    "assistance_award_unique_key",
    "award_id_fain",
    "award_id_uri",
    "sai_number",
    "total_funding_amount"
  ]
}'
POSTContract Download/api/v2/download/contract/

Creates a new download job for the requested award and returns a link to a zipped file containing contract award data

award_idfile_format
curl -X POST 'https://api.usaspending.gov/api/v2/download/contract/' \
  -H 'Content-Type: application/json' \
  -d '{
  "award_id": "CONT_AWD_N0002404C2105_9700_-NONE-_-NONE-"
}'
POSTDownload Count/api/v2/download/count/

These endpoints support the advanced search page and allow for complex filtering for specific subsets of spending data.

filtersspending_level
curl -X POST 'https://api.usaspending.gov/api/v2/download/count/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "keywords": [
      "cheese"
    ],
    "time_period": [
      {
        "start_date": "2019-10-01",
        "end_date": "2020-09-30"
      },
      {
        "start_date": "2010-10-01",
        "end_date": "2011-09-30"
      }
    ],
    "recipient_type_names": [
      "higher_education"
    ],
    "place_of_performance_locations": [
      {
        "country": "USA",
        "state": "WI"
      }
    ],
    "psc_codes": {
      "require": [
        [
          "Product",
          "10",
          "1035"
        ]
      ]
    }
  },
  "spending_level": "awards"
}'
POSTDisaster Funding and Spending Download/api/v2/download/disaster/

Creates a new download job for the requested COVID-19 related account and award.

filtersfile_format
curl -X POST 'https://api.usaspending.gov/api/v2/download/disaster/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "def_codes": [
      "L",
      "M",
      "N",
      "O",
      "P",
      "U"
    ]
  }
}'
POSTDisaster Recipient Download/api/v2/download/disaster/recipients/

Creates a new download job for the requested filters.

filtersfile_format
curl -X POST 'https://api.usaspending.gov/api/v2/download/disaster/recipients/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "def_codes": [
      "L",
      "M",
      "N",
      "O",
      "P",
      "U"
    ],
    "award_type_codes": [
      "A",
      "B",
      "C",
      "D"
    ]
  }
}'
POSTIDV Download/api/v2/download/idv/

Creates a new download job for the requested award and returns a link to a zipped file containing IDV data

award_idfile_format
curl -X POST 'https://api.usaspending.gov/api/v2/download/idv/' \
  -H 'Content-Type: application/json' \
  -d '{
  "award_id": "CONT_IDV_BBGBPA08452513_9568"
}'
POSTSearch Download/api/v2/download/search/

This endpoint is used to search for awards and transactions in the same file.

columnsfiltersfile_formatlimitspending_level
curl -X POST 'https://api.usaspending.gov/api/v2/download/search/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "agencies": [
      {
        "type": "awarding",
        "tier": "toptier",
        "name": "Department of Agriculture"
      }
    ],
    "keywords": [
      "Defense"
    ]
  },
  "columns": [
    "assistance_award_unique_key",
    "assistance_transaction_unique_key",
    "award_id_fain",
    "award_id_uri",
    "modification_number",
    "sai_number",
    "total_funding_amount"
  ],
  "spending_level": [
    "awards",
    "transactions",
    "subawards"
  ]
}'
GETDownload Status/api/v2/download/status

This route gets the current status of a download job.

curl 'https://api.usaspending.gov/api/v2/download/status'
POSTAward Download/api/v2/download/transactions/

This endpoint is used by the Advanced Search download page.

columnsfiltersfile_formatlimit
curl -X POST 'https://api.usaspending.gov/api/v2/download/transactions/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "keywords": [
      "Defense"
    ]
  },
  "columns": [
    "assistance_transaction_unique_key",
    "award_id_fain",
    "modification_number",
    "award_id_uri",
    "sai_number"
  ]
}'

Loading…