Award Download
/api/v2/download/awards/This endpoint is used by the Advanced Search download page.
This route sends a request to the backend to begin generating a zipfile of award data in CSV form for download.
Request
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"
]
}'Request body
The filters object is shared by every search endpoint. The filter object explains each filter with examples.
columnsarray of stringfiltersobject · FiltersRequired26 fieldsagenciesarray of Agency4 fieldsnamestringRequiredtierenum (string)Requiredtoptiersubtier
typeenum (string)Requiredfundingawarding
toptier_namestringProvided when the
namebelongs to a subtier agency
award_amountsarray of AwardAmount2 fieldslower_boundnumberupper_boundnumber
award_idsarray of stringAward IDs surrounded by double quotes (e.g.
"SPE30018FLJFN") will perform exact matches as opposed to the default, fuzzier full text matches. Useful for Award IDs that contain spaces or other word delimiters.award_type_codesarray of stringcontract_pricing_type_codesarray of stringdef_codesarray of DEFCList of Disaster Emergency Fund (DEF) Codes (DEFC) defined by legislation at the time of writing. A list of current DEFC can be found here.
extent_competed_type_codesarray of stringfederal_account_idsarray of stringkeywordsarray of stringlegal_entitiesarray of stringnaics_codesobject · NAICSCodeObject2 fieldsrequirearray of stringexcludearray of string
object_class_idsarray of stringplace_of_performance_locationsarray of Location7 fieldscountrystringRequiredstatestringcountystringcitystringdistrict_originalstringA 2 character code indicating the congressional district
-
When provided, a
statemust always be provided as well. -
When provided, a
countymust never be provided. -
When provided,
countrymust always be "USA". -
When provided,
district_currentmust never be provided.
-
district_currentstringA 2 character code indicating the current congressional district
-
When provided, a
statemust always be provided as well. -
When provided, a
countymust never be provided. -
When provided,
countrymust always be "USA". -
When provided,
district_originalmust never be provided.
-
zipstring
place_of_performance_scopestringprogram_activity_idsarray of stringprogram_numbersarray of stringpsc_codesenum (PSCCodeObject)Supports new PSCCodeObject or legacy array of codes.
recipient_locationsarray of Location7 fieldscountrystringRequiredstatestringcountystringcitystringdistrict_originalstringA 2 character code indicating the congressional district
-
When provided, a
statemust always be provided as well. -
When provided, a
countymust never be provided. -
When provided,
countrymust always be "USA". -
When provided,
district_currentmust never be provided.
-
district_currentstringA 2 character code indicating the current congressional district
-
When provided, a
statemust always be provided as well. -
When provided, a
countymust never be provided. -
When provided,
countrymust always be "USA". -
When provided,
district_originalmust never be provided.
-
zipstring
recipient_scopestringrecipient_search_textstringset_aside_type_codesarray of stringrecipient_type_namesarray of stringtas_codesarray of TASCodeObject2 fieldsrequirearray of stringexcludearray of string
time_periodarray of TimePeriod3 fieldsstart_datestringRequiredend_datestringRequireddate_typeenum (string)
transaction_keyword_searchstringFilter awards by keywords in the award's transactions.
treasury_account_componentsarray of TreasuryAccountComponentsObject7 fieldsatastringNullableAllocation Transfer Agency Identifier - three characters
aidstringRequiredAgency Identifier - three characters
bpoastringNullableBeginning Period of Availability - four digits
epoastringNullableEnding Period of Availability - four digits
astringNullableAvailability Type Code - X or null
mainstringRequiredMain Account Code - four digits
substringNullableSub-Account Code - three digits
file_formatenum (string)The format of the file(s) in the zip file containing the data.
csvtsvpstxt
limitnumber
Try it
Runs against the live API. Responses are real data.
/api/v2/download/awards/Response · 200
status_urlstringRequiredThe endpoint used to get the status of a download.
file_namestringRequiredIs the name of the zipfile containing CSVs that will be generated (file_name is timestamp followed by
_transactionsor_awards).file_urlstringRequiredThe URL for the file.
download_requestobjectRequiredThe JSON object used when processing the download.
{
"status_url": "http://localhost:8000/api/v2/download/status?file_name=PrimeAwardSummariesAndSubawards_2020-01-13_H21M05S48397603.zip",
"file_name": "PrimeAwardSummariesAndSubawards_2020-01-13_H21M05S48397603.zip",
"file_url": "/csv_downloads/PrimeAwardSummariesAndSubawards_2020-01-13_H21M05S48397603.zip",
"download_request": {
"columns": [
"assistance_award_unique_key",
"award_id_fain",
"award_id_uri",
"sai_number",
"total_funding_amount"
],
"download_types": [
"awards",
"sub_awards"
],
"file_format": "csv",
"filters": {
"agencies": [
{
"type": "awarding",
"tier": "toptier",
"name": "Department of Agriculture"
}
],
"award_type_codes": [
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"A",
"B",
"C",
"D",
"IDV_A",
"IDV_B",
"IDV_B_A",
"IDV_B_B",
"IDV_B_C",
"IDV_C",
"IDV_D",
"IDV_E",
"-1"
],
"keywords": [
"Defense"
],
"time_period": [
{
"date_type": "action_date",
"end_date": "2020-01-13",
"start_date": "1000-01-01"
}
]
},
"limit": 500000,
"request_type": "award"
}
}Recent changes
- DEV-10988: Add DEFC object to Data Structures/Filter Objects
- DEV-10988: Add def_codes to filter of award download api contract
- Mentioned in the July 19, 2023 release notes
- Mentioned in the October 21, 2019 release notes
- Mentioned in the November 1, 2017 release notes
Generated from contracts/v2/download/awards.md in the USAspending API repo.