Open jowg opened 3 years ago
If you are using the USAspending API web page to run your query, the 500 error is a known issue.
We were able to send a successful request through a third-party application, Postman, with the following JSON query:
{
"filters": {
"prime_award_types": ["A", "B", "C", "D"],
"agency": "all",
"date_type": "action_date",
"date_range":
{ "start_date": "2019-10-01", "end_date": "2020-09-30" } } }
I have figured this out. Evidently the payload needs to be passed to requests as json and not as data:
r = requests.post(url = myurl,json = mydata)
The following gives me a 500 error. No idea why. I don't think I'm missing any essentials...