Search Download
/api/v2/download/search/This endpoint is used to search for awards and transactions in the same file.
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/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"
]
}'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 TimePeriodWhile accepting the same format, time period filters are interpreted slightly differently between awards, transactions, and subawards.
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
limitnumberspending_levelarray of string
Try it
Runs against the live API. Responses are real data.
/api/v2/download/search/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 (
PrimeAwardsTransactionsAndSubawardsfollowed by a timestamp).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=PrimeAwardsTransactionsAndSubawards_2020-01-13_H21M05S48397603.zip",
"file_name": "PrimeAwardsTransactionsAndSubawards_2020-01-13_H21M05S48397603.zip",
"file_url": "/csv_downloads/PrimeAwardsTransactionsAndSubawards_2020-01-13_H21M05S48397603.zip",
"download_request": {
"columns": [
"assistance_award_unique_key",
"assistance_transaction_unique_key",
"award_id_fain",
"award_id_uri",
"modification_number",
"sai_number",
"total_funding_amount"
],
"download_types": [
"elasticsearch_awards",
"elasticsearch_transactions",
"elasticsearch_sub_awards"
],
"file_format": "csv",
"filters": {
"agencies": [
{
"type": "awarding",
"tier": "toptier",
"name": "Department of Agriculture"
}
],
"keywords": [
"Defense"
]
},
"limit": 0,
"request_type": "search"
}
}Recent changes
- Mentioned in the April 28, 2026 release notes
- Reformatted search download time period block
- Updated search timeperiods description
- DEV-14890: Fixed Syntax Error in Filters Fields in API Contract
- DEV-14890: Expanded Filters Fields in API Contract
Generated from contracts/v2/download/search.md in the USAspending API repo.