ATTENTION: In the fall of 2017, we will release a new version of USAspending.gov. The new site will continue to provide data on federal awards as well as include data on agency expenditures. For a preview, go to beta.usaspending.gov . Please give us feedback about important features you want incorporated into the new site by emailing our servicedesk or joining the Community.

API

​​NOTE:  If you are looking to download a large amount of data, please go to the Data Download, per the Terms of Use. ​

The USAspending.gov API allows you to request data through REST API calls and create customized datasets that are returned in XML format. The API Definition document provides details on various query parameters and definitions for logical operators, and the provided XML schema documents describe the format of the returned XML data. If you are an existing user of the USAspending.gov Data API, the legacy API calls will continue to be supported.

The API consists of three methods, /api/fpds, /api/faads and /api/fsrs that allow access to federal contracts, federal assistance and federal sub-award data respectively. All data present on USAspending.gov is available through the API, except for pie charts and end-of-search totals.

Methods

NOTE: By default API calls will retrieve a maximum of 1,000 records per call, in order to save bandwidth. You can retrieve fewer number of records by specifying "max_records" parameter. If you want to retrieve all the records, you can make multiple calls by varying the value of starting record position using "records_from" parameter. Please do not attempt to retrieve large subsections of the database through repeated calls to the API.

The three links below show how to retrieve data in XML through API calls:

  • For access to federal contract data submitted on FPDS -- /api/fpds
  • For access to fede​ral assistance data submitted at the Award Submission Portal -- /api/faads
  • For access to sub-award data submitted by prime recipients at FSRS -- /api/fsrs

XML Formats

The XML format will vary by the level of detail: detail = b (Basic) will produce different output than detail = c (complete).