Sign-up for API Updates:

Subscribe to receive e-mail updates about our API from the What's New section on the Home page.

API for Spending Data

General Information

USAspending.gov is pleased to announce the availability of its data in an Application Programming Interface (API).

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

Basic details for contracts for the state of Alabama:

/fpds/fpds.php?state=AL&detail=b

Basic details for assistance for the state of Texas:

/faads/faads.php?detail=b&principal_place_state_code=48&fiscal_year=2006&max_records=20

Sub-award summary data for fiscal year 2010:

/fsrs/fsrs.php?fiscal_year=2010&detail=s

Methods

NEW! Important: By default API calls will retrieve a maximum of 1000 records per call, in order to save bandwidth. You can retrieve a 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 don't 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:

Prime Award data:

Allows access to FPDS data on Federal contracts.

fpds.php

Assistance data:

Allows access to FAADS and FAADS PLUS data on Federal assistance.

faads.php

Sub-award data:

Allows access to FSRS data on Sub-awards.

fsrs.php

XML Formats

The XML format will vary by the level of detail: detail = b (Basic) will produce different output than detail = c (complete). The XML formats will hopefully be fairly self explanatory; for meanings of specific data fields, consult the data dictionary. There are also format examples within the two methods pages linked above.