Award Download
/api/v2/download/transactions/This endpoint is used by the Advanced Search download page.
This route sends a request to the backend to begin generating a zipfile of transaction data in CSV form for download.
Request
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"
]
}'Request body
The filters object is shared by every search endpoint. The filter object explains each filter with examples.
columnsarray of stringfiltersobject · FiltersRequired24 fieldsaward_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 stringagenciesarray of Agency4 fieldsnamestringRequiredtierenum (string)Requiredtoptiersubtier
typeenum (string)Requiredfundingawarding
toptier_namestringProvided when the
namebelongs to a subtier agency
contract_pricing_type_codesarray of stringextent_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 Location6 fieldscountrystringRequiredstatestringcountystringcitystringdistrictstringzipstring
place_of_performance_scopestringprogram_activity_idsarray of stringprogram_numbersarray of stringpsc_codesenum (PSCCodeObject)Supports new PSCCodeObject or legacy array of codes.
recipient_locationsarray of Location6 fieldscountrystringRequiredstatestringcountystringcitystringdistrictstringzipstring
recipient_search_textstringrecipient_scopestringrecipient_type_namesarray of stringset_aside_type_codesarray of stringtime_periodarray of TimePeriodThis TimePeriodObject can fall into different categories based on the request.
-
subaward files in download
See the Subaward Search category defined in SubawardSearchTimePeriodObject
-
transaction files in download
See the Transaction Search category defined in TransactionSearchTimePeriodObject
-
tas_codesarray of TASCodeObject2 fieldsrequirearray of stringexcludearray of string
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/transactions/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=PrimeTransactionsAndSubawards_2020-01-13_H21M10S12464980.zip",
"file_name": "PrimeTransactionsAndSubawards_2020-01-13_H21M10S12464980.zip",
"file_url": "/csv_downloads/PrimeTransactionsAndSubawards_2020-01-13_H21M10S12464980.zip",
"download_request": {
"agency": "all",
"columns": [
"assistance_transaction_unique_key",
"award_id_fain",
"award_id_uri",
"modification_number",
"sai_number"
],
"download_types": [
"sub_awards",
"transactions"
],
"file_format": "csv",
"filters": {
"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
Generated from contracts/v2/download/transactions.md in the USAspending API repo.