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.
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 federal assistance data submitted at the Award Submission Portal -- /api/faads
- For access to sub-award data submitted by prime recipients at FSRS -- /api/fsrs
The XML format will vary by the level of detail: detail = b (Basic) will produce different output than detail = c (complete).