usaspending-api icon indicating copy to clipboard operation
usaspending-api copied to clipboard

Where can I find filter parameters for an API call?

Open dhope-lab opened this issue 6 years ago • 4 comments

I would like to be able to use certain parameters for an API call to get the exact information that I want from USA Spending. For example, I would like to get, from the awards endpoint, all the contracts for a state in a certain fiscal year( also if it is possible to get this for multiple years in a single API call ). Where can I find the parameter info and instructions on how to do this?

dhope-lab avatar Aug 26 '19 21:08 dhope-lab

USAspending.gov’s API allows you to specify various parameters, depending on which endpoints you use. For your inquiry, we recommend using the Spending by Award endpoint (https://api.usaspending.gov/api/v2/search/spending_by_award/). It will let you specify the Contracts award type, Recipient’s/ Primary Place of Performance State and the Time Period for single or multiple years.

You can find more technical documentation about the endpoint here: https://github.com/fedspendingtransparency/usaspending-api/blob/master/usaspending_api/api_docs/api_documentation/advanced_award_search/spending_by_award.md, including a link to the Filter Objects, for the various filters parameters you can use.

lisaam avatar Aug 27 '19 18:08 lisaam

Looks like this is more of a Q&A situation and has been answered, so I think the issue could be closed @lisaam ?

martin-martin avatar Oct 06 '19 02:10 martin-martin

USAspending.gov’s API allows you to specify various parameters, depending on which endpoints you use. For your inquiry, we recommend using the Spending by Award endpoint (https://api.usaspending.gov/api/v2/search/spending_by_award/). It will let you specify the Contracts award type, Recipient’s/ Primary Place of Performance State and the Time Period for single or multiple years.

You can find more technical documentation about the endpoint here: https://github.com/fedspendingtransparency/usaspending-api/blob/master/usaspending_api/api_docs/api_documentation/advanced_award_search/spending_by_award.md, including a link to the Filter Objects, for the various filters parameters you can use.

It seems the link doesn't work. Too bad. Is that what happens when an issue is closed. Or is it somewhere else. Thanks.

AllanShweky avatar Jun 15 '20 17:06 AllanShweky

Allan, The link https://github.com/fedspendingtransparency/usaspending-api/blob/master/usaspending_api/api_contracts/contracts/v2/search/spending_by_award.md should work.

The documentation can also be accessed from https://api.usaspending.gov/api/v2/search/spending_by_award/ by clicking the "here" link

image

lisaam avatar Jun 15 '20 19:06 lisaam