Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Federal contract, grant, loan, and other award records for building recipient research, agency-spending, and public-market analysis tools.
From source to product signal
USAspending links federal awards, recipients, agencies, and transactions. Start with one awarding agency, one fiscal period, and a small award result page. Award amounts and transactions can represent obligations or outlays, and records can be amended after their initial publication.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
payload = {
"filters": {
"time_period": [{"start_date": "2025-10-01", "end_date": "2026-09-30"}],
"award_type_codes": ["A", "B", "C", "D"],
"agencies": [{
"type": "awarding",
"tier": "toptier",
"name": "Department of Energy",
}],
},
"fields": [
"Award ID",
"Recipient Name",
"Award Amount",
"Start Date",
"End Date",
"Awarding Agency",
],
"page": 1,
"limit": 100,
"subawards": False,
}
response = requests.post(
"https://api.usaspending.gov/api/v2/search/spending_by_award/",
json=payload,
timeout=30,
)
response.raise_for_status()
awards = pd.DataFrame(response.json()["results"])
awards["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(awards.head(20))Test a useful signal
Find which recipients account for the largest returned award amounts for one agency and fiscal period.
U.S. Department of the Treasury is a government source. Last verified 2026-08-11. Temporal coverage: fiscal year 2001-present, with endpoint-specific limits.