-
Notifications
You must be signed in to change notification settings - Fork 108
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What are the list of filters for api/v1/awards? #2005
Comments
First things first, is there specific functionality from v1 that you need to be using? https://github.com/fedspendingtransparency/usaspending-api/blob/master/usaspending_api/api_docs/api_documentation/advanced_award_search/spending_by_award.md is the equivalent in v2, which is better documented and actively supported. You can check the link to the filter object to find DUNS and fiscal year. |
Yes, I wasn't able to get my code to function under v2, only v1. |
Is this because of the 500 error in the issue before this? If you're seeing the problem between versions that will be valuable to add to our DEV ticket and resolve the problem faster. My assumption is that some kind of data formatting/quality check was added between versions and wasn't documented correctly. |
Yes, I get an internal server error when using v2. I also tried using recipient_unique_id as a filter and it doesn't appear to work with v1. |
Have you tried using the Advanced Search on USAspending.gov to form your query string? (Or just download the info you need?) |
Is there a way to get the query code from the Advanced Search tool on the gov site? |
Anytime you're on a website and it sends out a request, you can look at what was sent. It's a very powerful tool in a developer's utility belt https://www.google.com/search?ei=ezlpXcDzEcTQ-gT77Z_gDg&q=network+tab+chrome&oq=network+tab+on+browsers&gs_l=psy-ab.1.0.0i71l8.0.0..10624...0.2..0.0.0.......0......gws-wiz.Dj4ZWxXdkYU |
I can't find the necessary information that way. |
I'll have an example for you in a few minutes. |
I searched on FY 2019 and DUNS 152670030 The Chrome screen where I pulled the query from looks like: The query string is: {"filters":{"time_period":[{"start_date":"2018-10-01","end_date":"2019-09-30"}],"award_type_codes":["A","B","C","D"],"recipient_search_text":["152670030"]},"fields":["Award ID","Recipient Name","Start Date","End Date","Award Amount","Awarding Agency","Awarding Sub Agency","Contract Award Type"],"page":1,"limit":60,"sort":"Award Amount","order":"desc","subawards":false} Documentation for the API endpoint is at: I hope this helps. |
It looks like you may be missing some json details. Try this: import requests json_body = { |
More specifically, I am trying to filter by DUNS number and fiscal year. What are the filter names for this?
The text was updated successfully, but these errors were encountered: