Download Tool Question....
I am trying to test a connection to USASpending to retrieve award data -- link to award search page here.
I watched the tutorial video on YouTube here
I am trying to do a POST request to this API endpoint.
https://api.usaspending.gov/api/v2/search/spending_by_award/
Documentation for this endpoint is here.
My SEARCH CRITERIA is pretty straightforward:
- KEYWORD = 'ZHEGXL9HYV43' This is a unique entity identifier but as it refers to a parent company I found it produces the desired result when using KEYWORD and NOT recipient.
- TIME PERIOD = Fiscal Years FY2024 thru 2014 but it could be any range in theory.
- I only care about contracts. The result should be 2,161
From Firefox, I from Network/Request the following request. Note: It should be in line with API documentation (as it was generated by the USASpending search page).
{"filters":{"keywords":["ZHEGXL9HYV43"],"time_period":[{"start_date":"2023-10-01","end_date":"2024-09-30"},{"start_date":"2013-10-01","end_date":"2014-09-30"},{"start_date":"2014-10-01","end_date":"2015-09-30"},{"start_date":"2015-10-01","end_date":"2016-09-30"},{"start_date":"2016-10-01","end_date":"2017-09-30"},{"start_date":"2017-10-01","end_date":"2018-09-30"},{"start_date":"2018-10-01","end_date":"2019-09-30"},{"start_date":"2019-10-01","end_date":"2020-09-30"},{"start_date":"2020-10-01","end_date":"2021-09-30"},{"start_date":"2021-10-01","end_date":"2022-09-30"},{"start_date":"2022-10-01","end_date":"2023-09-30"}],"award_type_codes":["A","B","C","D"]},"fields":["Award ID","Recipient Name","Start Date","End Date","Award Amount","Total Outlays","Description","def_codes","COVID-19 Obligations","COVID-19 Outlays","Infrastructure Obligations","Infrastructure Outlays","Awarding Agency","Awarding Sub Agency","Contract Award Type","recipient_id","prime_award_recipient_id"],"page":1,"limit":60,"sort":"Award Amount","order":"desc","subawards":false}??? QUESTIONS ????
Basic
- How do I replicate this using the Download Tool?
- Does the API allow you to download only the results table (which I believe the payload requests) OR
Advanced:
- Does the API allow you to download the full results at the AWARD level of detail OR
- Does the API allow you to download TRANSACTION level of detail with all 290+ fields OR will it only allow you to download as a .csv or zipped collection of .csv
I tried to replicate the results using an Input Tool with the URL to the endpoint connected to a Download Tool. I did not get the desired results.
The Download Tool was configured as follows:
BASIC took the URL from the Input Tool's URL field. The URL was the same as above.
HEADERS - nothing - This is probably where I messed up.
PAYLOAD
- HTTP Action set to POST
- Use Following for Query String/Body checked and request from Firefox Inspector used here.
- I also tried using the request payload in a field from my Input Tool.

