A GPT to Assist with USAspending.gov — an experiment

Leif Ulstrup
2 min readNov 10


Embracing AI — revisiting my earlier blog posts on working with USAspending.gov and the API

It’s been awhile since I last posted a blog on using USAspending.gov. My series on the topic starts here: https://lulstrup.medium.com/gaining-an-analytics-edge-using-federal-spending-open-data-7cc69a063c68

OpenAI GPT Store Screen Shot

And ends here: https://lulstrup.medium.com/blog-11-the-kipps-curve-undertanding-federal-agency-buying-preferences-74f897308baf

I’m experimenting with the new OpenAI GPT feature.

I’ve assembled a prompt and some documents to make it easier to write code to access the USAspending.gov API’s.

Here is the link to this AI assist GPT tool: https://chat.openai.com/g/g-VUKAHV22R-usaspending-gov-api-expert-experimental

It does not include any custom functions nor any special error checking or factual validation at this point. It’s just an experiment. It does produce working Python code that uses the API interface.

TODO: add GPT Actions via OpenAI yaml specification to enable calls directly to the USAspending.gov API to enabled testing of the interface and exploration of data. Two completed as of 11/15/2023. Try:

  • Call the api.usaspending.gov API with the pscAutocompletePost operation
  • Call the api.usaspending.gov API with the fundingAgencyAutocompletePost operation

It will also create training aids and answer questions about using USAspending.gov.

I welcome any comments on how well it works and what issues arose when you used it.