~/public-data/usaspending-scraper

USAspending.gov Scraper — Federal Awards, Recipients & Aggregates

Query the official USAspending.gov API v2 for federal contracts, grants, and loans. Filter by agency, recipient, NAICS/PSC, or date, and pull recipient profiles, category totals, and state/county/district geography aggregates. No API key.

government TypeScriptREST API United States
proooxy/usaspending-scraper — spec
categorypublic-data / government
languageTypeScript
stackTypeScript, REST API
marketsUnited States
outputclean, RAG-ready JSON

key features

Official USAspending.gov API v2 — no API key required

Award search across keywords, fiscal year/date range, agency, recipient, NAICS, PSC, amount, and award type

Six modes — award search, award detail, subawards, recipient profile, category totals, and geography

18 category-aggregation dimensions (recipient, NAICS, PSC, agency, county, district, CFDA, TAS, and more)

Geography aggregates by state, county, congressional district, and country with population and per-capita fields

Automatic date slicing (monthly/quarterly) for large multi-year result sets

Automatic award-type-code batching into valid API request groups

Exact award-detail and subaward lookup by generated award ID

use cases

  • GovCon business development — find opportunities and incumbent contractors by NAICS, PSC, or agency
  • Competitive intelligence on a competitor's award history and agency relationships
  • Investigative journalism tracing federal spending to specific recipients or geographies
  • Policy and academic research on spending trends by category, award type, or time period
  • Due-diligence review of a recipient's federal award and spending history
  • BI dashboards mapping federal spend by state, county, or congressional district

input parameters

ParameterTypeRequiredDescription
modestringoptionalWorkflow: awards, awardDetail, subawards, recipient, byCategory, or geography (default: awards).
keywordsarrayoptionalFree-text USAspending keyword filters for award search.
fiscalYearnumberoptionalFederal fiscal year (maps to Oct 1 – Sep 30 date range).
awardTypesarrayoptionalUSAspending award type codes; mixed groups are split into valid requests automatically.
agencystringoptionalExact awarding or funding agency name filter.
naicsCodesarrayoptionalNAICS codes an award must match.
awardIdstringoptionalGenerated award ID — required at runtime for awardDetail and subawards modes.
maxItemsnumberoptionalMax records saved; each row is one billed event (default: 100).

Output Example

 1{
 2  "itemType": "award",
 3  "title": "HT940216C0001 — HUMANA GOVERNMENT BUSINESS INC",
 4  "date": "2016-02-01",
 5  "awardId": "HT940216C0001",
 6  "generatedId": "CONT_AWD_HT940216C0001_9700_-NONE-_-NONE-",
 7  "recipient": { "name": "HUMANA GOVERNMENT BUSINESS INC", "uei": "...", "duns": "..." },
 8  "awardingAgency": "Department of Defense",
 9  "fundingAgency": "Department of Defense",
10  "amount": 51269205263.03,
11  "awardType": "IDV_B_C",
12  "naics": { "code": "...", "description": "..." },
13  "placeOfPerformance": { "stateCode": "...", "state": "..." },
14  "awardTypeCodes": ["IDV_B_C"],
15  "url": "https://www.usaspending.gov/award/CONT_AWD_HT940216C0001_9700_-NONE-_-NONE-"
16}

Pricing

Pay-per-event: $0.001 per saved record, charged once per successfully returned row. A ~1,000-record run is ~$1.00, and maxItems caps both volume and cost.

Tips

  • Lead with NAICS or PSC codes for GovCon prospecting — they map directly to the products/services you sell and return the cleanest set of relevant awards.
  • Use byCategory mode to rank the top recipients or agencies for a market before pulling individual award detail.
  • Geography mode returns the first page (up to 100 rows) per date-range/award-type combination — narrow the filters rather than raising maxItems for state/county/district roll-ups.

faq

Do I need an API key?
No. The USAspending.gov API v2 is public and requires no key or login.
Why are mixed award-type codes split into multiple requests?
USAspending rejects a single search that mixes codes from different award-type groups (contracts, IDVs, grants, loans, other financial assistance, direct payments). The actor groups requested codes automatically and tags each output row with the matched award type codes.
What geographic breakdowns are available?
State, county, congressional district, and country — scoped to either place of performance or recipient location, with population and per-capita fields included.
How is a run priced?
Pay-per-event at $0.001 per saved row, charged once per successfully returned record. maxItems caps the number of rows and therefore the cost.

related in ~/public-data

Run USAspending.gov Scraper — Federal Awards, Recipients & Aggregates, or get a custom build

Start extracting on Apify in minutes, or hire me to build a bespoke scraper and RAG pipeline for your exact source and schema.

run on Apify get custom data