Masthead: Home Link

 Home
 Frequently Asked Questions
 About the Data
 Glossary
 API Documentation
 Downloads
 Related Resources

USAspending.gov was last updated on May 1, 2009..

Contracts data is up-to-date as of April 17, 2009 for all 24 CFO Act agencies.

Assistance (Grants/Other & Loans) data is up-to-date as of April 24, 2009 for 20 of 22 CFO Act agencies. Updates are currently pending for the following agencies:DOJ, USTREAS

For more details, please click here

Printer friendly display link PRINTER-FRIENDLY



API Documentation

General Information

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

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

Summary for contracts for the state of Alabama:
//www.usaspending.gov/fpds/fpds.php?datype=X&detail=-1&state=AL

List of assistance transactions to entities with "Smith" in their name for FY 2006:
//www.usaspending.gov/faads/faads.php?datype=X&detail=2&recipient_name=Smith&fiscal_year=2006


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 two links below show how to retrieve data in XML through API calls:

fpds.php

faads.php

XML Formats

The XML format will vary by the level of detail: detail = -1 (summary) will produce different output than detail = 4 (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.