Scraper APIUSAspending
usaspending.awards
US federal contracts, grants and other awards from USAspending.gov by words, recipient, agency, NAICS code, state and date: amount, recipient, agency, dates, codes and description.
- Id
usaspending.awards- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/usaspending.awards/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
award_type | "contracts" | "idvs" | "grants" | "direct_payments" | "other" | The kind of award: contracts, idvs (indefinite-delivery vehicles), grants, direct_payments or other.Default: "contracts". |
query | string | Words the award's description, recipient or agency holds.Limit: at least 3 characters, at most 200 characters. |
recipient | string | Only awards to a recipient whose name holds this text.Limit: at least 2 characters, at most 200 characters. |
agency | string | Only awards made by this department, by its full name, e.g. Department of Defense.Limit: at most 120 characters. |
naics | string | Only contracts in this NAICS code, 2 to 6 digits, e.g. 541512. |
state | string | Only work done in this US state, as two letters. |
date_from | string | Only awards active on or after this day, YYYY-MM-DD. USAspending holds them from 2007-10-01. Default: a year back. |
date_to | string | Only awards active on or before this day, YYYY-MM-DD. Default: today. |
sort | "amount" | "newest" | amount (largest first) or newest (latest start first).Default: "amount". |
max_results | integer | Awards a page, at most 100.Limit: 1 to 100. Default: 25. |
page | integer | The page of results, from 1.Limit: 1 to 1000. Default: 1. |
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
award_id | string | The award's number (PIID or FAIN), e.g. FA862118F6251. |
internal_id | string | USAspending's id of the award, which usaspending.award takes, e.g. CONT_AWD_FA862118F6251_9700_FA862115D6276_9700. |
url | string | The award's page on usaspending.gov. |
award_type | string | What was searched: contracts, idvs, grants, direct_payments or other. |
recipient_name | string or null | Who received the award. |
recipient_id | string or null | USAspending's id of the recipient, which usaspending.recipient takes. |
amount | number or null | The amount of the award, in US dollars. |
awarding_agency | string or null | The department that made the award. |
awarding_sub_agency | string or null | The agency within it. |
start_date | string or null | The start of the period of performance, YYYY-MM-DD. |
end_date | string or null | Its end, YYYY-MM-DD; for an indefinite-delivery vehicle the last day to order. |
description | string or null | The award's description. |
naics_code | string or null | The NAICS industry code of a contract. |
naics_description | string or null | What that code means. |
psc_code | string or null | The product or service code of a contract. |
psc_description | string or null | What that code means. |
assistance_listing | string or null | The assistance listing number (CFDA) of a grant. |
fetched_at | string (date-time) | When USAspending was asked, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/usaspending.awards/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"query":"cybersecurity","state":"TX","naics":"541512","date_from":"2026-01-01","date_to":"2026-11-20","max_results":3}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("usaspending.awards", {
"query": "cybersecurity",
"state": "TX",
"naics": "541512",
"date_from": "2026-01-01",
"date_to": "2026-11-20",
"max_results": 3,
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("usaspending.awards", {
query: "cybersecurity",
state: "TX",
naics: "541512",
date_from: "2026-01-01",
date_to: "2026-11-20",
max_results: 3,
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "usaspending.awards", map[string]any{"query": "cybersecurity", "state": "TX", "naics": "541512", "date_from": "2026-01-01", "date_to": "2026-11-20", "max_results": 3})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("usaspending.awards", Map.of("query", "cybersecurity", "state", "TX", "naics", "541512", "date_from", "2026-01-01", "date_to", "2026-11-20", "max_results", 3));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run usaspending.awards --input-json '{"query":"cybersecurity","state":"TX","naics":"541512","date_from":"2026-01-01","date_to":"2026-11-20","max_results":3}'Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"query": "cybersecurity",
"state": "TX",
"naics": "541512",
"date_from": "2026-01-01",
"date_to": "2026-11-20",
"max_results": 3
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "usaspending.awards",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"query": "cybersecurity",
"state": "TX",
"naics": "541512",
"date_from": "2026-01-01",
"date_to": "2026-11-20",
"max_results": 3
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"award_id": "W9124J23F0073",
"internal_id": "CONT_AWD_W9124J23F0073_9700_47QTCB21D0337_4732",
"url": "https://www.usaspending.gov/award/CONT_AWD_W9124J23F0073_9700_47QTCB21D0337_4732",
"award_type": "contracts",
"recipient_name": "DIGITAL CONSULTANTS, LLC",
"recipient_id": "8dd9fc1c-e2fd-ad71-022d-944130f90dd7-C",
"amount": 11869315.85,
"awarding_agency": "Department of Defense",
"awarding_sub_agency": "Department of the Army",
"start_date": "2023-05-09",
"end_date": "2026-11-14",
"description": "HELP DESK, IT OPERATIONS, AND CYBERSECURITY SERVICES",
"naics_code": "541512",
"naics_description": "COMPUTER SYSTEMS DESIGN SERVICES",
"psc_code": "DG01",
"psc_description": "IT AND TELECOM - NETWORK SUPPORT SERVICES (LABOR)",
"assistance_listing": null,
"fetched_at": "2026-11-23T23:15:36.517838Z"
}
],
"next_cursor": null
}A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the USAspending scrapers are in their own section there.