# USAspending Federal Contracts by Agency, NAICS and Recipient (`nightwave-owner/usaspending-federal-contracts`) Actor

US federal government contracts from USAspending.gov. Filter by date, keyword, recipient, awarding agency, NAICS and PSC code, state and amount. One row per contract with recipient, UEI, agency, amount, dates, codes, place of performance and a link to the award page.

- **URL**: https://apify.com/nightwave-owner/usaspending-federal-contracts.md
- **Developed by:** [Viktor Wiberg](https://apify.com/nightwave-owner) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 contracts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## USAspending Federal Contracts by Agency, NAICS and Recipient

US federal government contracts from USAspending.gov, the official source for federal spending data run by the U.S. Department of the Treasury. Choose a date range and any mix of keyword, recipient, awarding agency, NAICS code, PSC code, state and amount, and get one clean row per contract with the contractor, its UEI, the awarding agency and office, the amount, start and end dates, industry and product codes, place of performance and a link to the award page on usaspending.gov.

Use it to find out which companies win federal IT, construction or consulting work, to build lead lists of government contractors in a NAICS code, to follow what a specific agency buys, or to check a competitor's federal business. Schedule a daily run with the dates left empty and `onlyNew` on to get only the contract activity that is new since the day before.

### What is covered

Federal contracts (award types A, B, C and D: BPA calls, purchase orders, delivery orders and definitive contracts) from fiscal year 2008 until today, as published in USAspending's award search. A contract is returned when it has an action (a new award, a modification or an obligation) dated inside your date range. Results come largest award amount first.

### Example from a real run

Run `N6LRrYEfNyT3cq9WZ` on Apify on 4 October 2026, with this input: custom programming contracts (NAICS 541511) of at least 1 million dollars performed in Virginia, with action dates in the last 30 days (the dates were left empty).

```json
{
  "naicsCodes": ["541511"],
  "placeOfPerformanceStates": ["VA"],
  "minAmount": 1000000,
  "onlyNew": true
}
```

It returned 50 contracts (the default `maxResults`) in 3 seconds of run time, most recently modified first. The first two rows from the dataset, with some fields left out here to keep it short:

```json
[
  {
    "awardId": "CONT_AWD_36C10A25C0001_3600_-NONE-_-NONE-",
    "piid": "36C10A25C0001",
    "awardType": "DEFINITIVE CONTRACT",
    "recipientName": "MLINQS, LLC",
    "recipientUei": "FYXQSLS7MH63",
    "awardingAgency": "Department of Veterans Affairs",
    "awardingSubAgency": "Department of Veterans Affairs",
    "awardAmount": 2807669.82,
    "startDate": "2024-10-01",
    "endDate": "2027-09-30",
    "lastModifiedDate": "2026-10-01T14:19:33",
    "description": "PERMANENT CHANGE OF STATION SOFTWARE SOLUTIONS",
    "naicsCode": "541511",
    "pscCode": "DA10",
    "placeOfPerformanceState": "VA",
    "url": "https://www.usaspending.gov/award/CONT_AWD_36C10A25C0001_3600_-NONE-_-NONE-"
  },
  {
    "awardId": "CONT_AWD_70T03026F7667N113_7013_47QTCA19D00M4_4732",
    "piid": "70T03026F7667N113",
    "awardType": "DELIVERY ORDER",
    "recipientName": "DISRUPTIVE SOLUTIONS LLC",
    "recipientUei": "VMQBY7FWUPF9",
    "awardingAgency": "Department of Homeland Security",
    "awardingSubAgency": "Transportation Security Administration",
    "awardAmount": 5989823.08,
    "startDate": "2026-09-30",
    "endDate": "2027-09-29",
    "lastModifiedDate": "2026-10-01T10:15:48",
    "description": "TSA GOVERNANCE, RISK, AND COMPLIANCE SUPPORT SERVICES (GRCSS)",
    "naicsCode": "541511",
    "pscCode": "DJ01",
    "placeOfPerformanceState": "VA",
    "url": "https://www.usaspending.gov/award/CONT_AWD_70T03026F7667N113_7013_47QTCA19D00M4_4732"
  }
]
```

The search matched 190 contracts. Run again with the same input, the actor returned the next 50 (run `FVva3n6wpRNlQh7aZ`), then the remaining 90 with `maxResults` raised to 500 (run `P4mdYcUHSJaNMk6jl`), and then 0 (run `nlybu8hdfinbWxFir`), since nothing new had been published in between. See "Monitoring and scheduling".

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `dateFrom` | string | 29 days before `dateTo` | First action date, `YYYY-MM-DD`. Not before `2007-10-01`. |
| `dateTo` | string | today (Washington time) | Last action date (inclusive). The range can be at most 366 days. |
| `keywords` | array | none | Words or phrases searched in the award text, at least 3 characters each. Any of them can match. |
| `recipientName` | string | none | Contractor name, part of a name or a UEI, for example `Booz Allen` or `JCBMLGPE6Z71`. |
| `awardingAgencies` | array | none | Agency names as USAspending writes them, for example `Department of Defense` or `General Services Administration`. Sub agencies such as `Federal Acquisition Service` work too. |
| `naicsCodes` | array | none | NAICS industry codes, 2 to 6 digits. `5415` matches every code starting with 5415. |
| `pscCodes` | array | none | Product and Service Codes, for example `DA01` or `R499`. |
| `placeOfPerformanceStates` | array | none | Two letter state codes, for example `VA`, `CA` or `DC`. |
| `minAmount`, `maxAmount` | integer | none | Award amount range in US dollars. |
| `maxResults` | integer | `50` | Maximum number of contracts, 1 to 10 000. |
| `includeDetails` | boolean | `false` | Also read each award's detail record to fill `totalObligation` and `baseAndAllOptionsValue`. One extra request per contract. |
| `onlyNew` | boolean | `false` | Return only contracts that are new or have new activity since earlier runs with the same input. See "Monitoring and scheduling". |

Filters of different kinds are combined (all must match). Several values in the same list are alternatives (any can match). A run with empty input returns the 50 largest contracts with activity in the last 30 days (2 seconds of run time in a test on 4 October 2026, run `3yTkelNBqxoKPZvWf`).

Example input: custom programming contracts (NAICS 541511) over 1 million dollars performed in Virginia during September 2026.

```json
{
  "dateFrom": "2026-09-01",
  "dateTo": "2026-09-30",
  "naicsCodes": ["541511"],
  "placeOfPerformanceStates": ["VA"],
  "minAmount": 1000000,
  "maxResults": 500
}
```

### Output

| Field | Description |
|---|---|
| `awardId` | USAspending's unique award id (`generated_internal_id`), also used in the link |
| `piid` | Procurement Instrument Identifier, the contract or order number |
| `awardType` | `BPA CALL`, `PURCHASE ORDER`, `DELIVERY ORDER` or `DEFINITIVE CONTRACT` |
| `recipientName`, `recipientUei` | Contractor name and Unique Entity ID |
| `awardingAgency`, `awardingSubAgency` | Department and office that awarded the contract |
| `fundingAgency` | Department that pays for it |
| `awardAmount` | Award amount in US dollars as shown in USAspending's award search (obligated amount) |
| `totalObligation` | Total obligated amount from the award detail record. Filled only with `includeDetails` |
| `baseAndAllOptionsValue` | Potential value if all options are exercised. Filled only with `includeDetails` |
| `startDate`, `endDate` | Period of performance, `YYYY-MM-DD` |
| `lastModifiedDate` | When the award was last changed in USAspending |
| `description` | Description of the award as reported by the agency |
| `naicsCode`, `naicsDescription` | NAICS industry code and name |
| `pscCode`, `pscDescription` | Product and Service Code and name |
| `placeOfPerformanceState`, `placeOfPerformanceCountry` | Where the work is done |
| `url` | Link to the award page on usaspending.gov |
| `source`, `license` | Attribution for the data |

```json
{
  "awardId": "CONT_AWD_47QDCB22F0006_4732_47QDCB19A0001_4732",
  "piid": "47QDCB22F0006",
  "awardType": "BPA CALL",
  "recipientName": "BOOZ ALLEN HAMILTON INC",
  "recipientUei": "JCBMLGPE6Z71",
  "awardingAgency": "General Services Administration",
  "awardingSubAgency": "Federal Acquisition Service",
  "fundingAgency": "General Services Administration",
  "awardAmount": 185098941.49,
  "totalObligation": null,
  "baseAndAllOptionsValue": null,
  "startDate": "2022-04-01",
  "endDate": "2027-03-31",
  "lastModifiedDate": "2026-09-29T17:19:55",
  "description": "FAS CLOUD SERVICES SUPPORT",
  "naicsCode": "541511",
  "naicsDescription": "CUSTOM COMPUTER PROGRAMMING SERVICES",
  "pscCode": "DA01",
  "pscDescription": "IT AND TELECOM - BUSINESS APPLICATION/APPLICATION DEVELOPMENT SUPPORT SERVICES (LABOR)",
  "placeOfPerformanceState": "VA",
  "placeOfPerformanceCountry": "USA",
  "url": "https://www.usaspending.gov/award/CONT_AWD_47QDCB22F0006_4732_47QDCB19A0001_4732",
  "source": "USAspending.gov, U.S. Department of the Treasury",
  "license": "Public domain, U.S. federal government information"
}
```

### Monitoring and scheduling

Set `onlyNew` to `true` to use the actor as a daily feed of federal contract activity. The actor then remembers which award versions it has delivered for the same input, in a named key-value store in your Apify account (`nightwave-state-usaspending-federal-contracts`, one record per input). An award version is the award id together with its `lastModifiedDate`, so a contract comes again when the agency reports a new action on it, such as a modification or a new obligation. Each run returns and charges only contracts that are new or changed since earlier runs. The first run returns everything in the selection. A run without news finishes successfully with 0 rows.

With `onlyNew` the results are read most recently modified first instead of largest first, and at most 10 000 contracts are read per run. Contracts already delivered do not count toward `maxResults`, and no detail request is made for them. When there are more new contracts than `maxResults`, the rest come in the next run.

`onlyNew` and `maxResults` are not part of the remembered input, so you can change them without starting over. Changing any other field starts a fresh state. Leave `dateFrom` and `dateTo` empty for scheduled runs: the 30 day window then follows the calendar while the remembered input stays the same. To start over with the same input, delete the record in the key-value store.

Example: a run at 07:00 Swedish time every day that returns new IT contract activity of at least 1 million dollars in Virginia and Washington DC. In Apify Console, open **Schedules**, create a schedule with the cron expression `0 7 * * *` and add this actor with the input below.

```json
{
  "naicsCodes": ["541511", "541512"],
  "placeOfPerformanceStates": ["VA", "DC"],
  "minAmount": 1000000,
  "onlyNew": true,
  "maxResults": 500
}
```

The same schedule through the Apify API:

```sh
curl -X POST "https://api.apify.com/v2/schedules?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name": "daily-federal-contracts", "cronExpression": "0 7 * * *", "timezone": "Europe/Stockholm", "isEnabled": true, "isExclusive": true,
       "actions": [{"type": "RUN_ACTOR", "actorId": "nightwave-owner~usaspending-federal-contracts",
                    "runInput": {"contentType": "application/json; charset=utf-8", "body": "<the input above as a JSON string>"}}]}'
```

### Good to know

- **Contracts only.** Grants, loans, direct payments and other financial assistance are not included in this version. Those awards often go to individual people, and this actor is meant for companies and organisations that sell to the government.
- **Amounts are obligations, not payments, and they change.** An obligation is money the government has committed to the contract. Agencies modify contracts over time, and USAspending updates its data daily, so the amount of an award can go up or down between runs. The search index and the award detail record are updated at slightly different times, so `awardAmount` and `totalObligation` can differ for awards that changed recently. The award page on usaspending.gov shows the detail record.
- **The date range filters on action dates.** A large contract signed years ago is included when it had a modification inside your range. Use a short range and `lastModifiedDate` to see what is new.
- **Agencies report with a delay.** Most contract actions appear in USAspending within a few days. Department of Defense contracts are published with a delay of about 90 days.
- **Polite to the source.** The actor sends at most 2 requests per second and retries three times on network errors, rate limits (429) and server errors. A response in an unexpected format stops the run with a clear message instead of storing broken rows. An invalid filter returns USAspending's own error text.
- Results are sorted by award amount, largest first (most recently modified first with `onlyNew`). With `maxResults` at 10 000 and no details, a run takes a few minutes.

### Data source and license

The data comes from the public USAspending API v2: `POST https://api.usaspending.gov/api/v2/search/spending_by_award/` for the search and `GET https://api.usaspending.gov/api/v2/awards/<award id>/` for the details, see the [API documentation](https://api.usaspending.gov/docs/endpoints). No API key is needed. USAspending.gov is run by the U.S. Department of the Treasury under the DATA Act, and the spending data is open to the public. Information published by the federal government is not subject to copyright in the United States ([17 U.S.C. § 105](https://www.law.cornell.edu/uscode/text/17/105)). Every row carries `source` and `license` so you can credit USAspending.gov when you publish the data.

This actor is not affiliated with or endorsed by USAspending.gov or the U.S. Department of the Treasury.

### Pricing

Pay per result: 0.002 USD per contract returned (event `award`), which is 2.00 USD per 1 000 contracts. On top of that you pay Apify for the platform usage of your run, which is small since the actor only reads an API. `maxResults` caps how many contracts a run returns, and so what a run can cost.

### Contact

Built and maintained by Nightwave AB. Questions, bugs and feature requests: kontakt@nightwave.se

### På svenska

Actorn hämtar amerikanska federala kontrakt från USAspending.gov, den officiella källan för den amerikanska statens utgifter som drivs av finansdepartementet (U.S. Department of the Treasury). Välj datumintervall och valfria filter för sökord, leverantör, upphandlande myndighet, NAICS-kod, PSC-kod, delstat och belopp, och få en rad per kontrakt med leverantör, UEI, myndighet, belopp, datum, branschkoder, plats för utförandet och länk till kontraktets sida.

- Ingår: kontrakt (typ A, B, C och D) från budgetåret 2008 och framåt. Bidrag, lån och annat stöd ingår inte, eftersom de ofta går till privatpersoner.
- Datumintervallet gäller kontraktshändelser (nya kontrakt och ändringar), högst 366 dagar per körning. Standard är de senaste 30 dagarna.
- Standard är 50 kontrakt per körning, högst 10 000, största belopp först.
- Bevakning: med `onlyNew` kommer ihåg actorn vilka kontrakt den redan har levererat för samma input (key-value store `nightwave-state-usaspending-federal-contracts`). Varje körning levererar och debiterar bara kontrakt som är nya eller har fått en ny händelse sedan förra körningen. Lämna datumen tomma och lägg actorn på ett dagligt schema i Apify under Schedules, se avsnittet "Monitoring and scheduling".
- Beloppen är åtaganden (obligations), inte utbetalningar, och kan ändras när myndigheterna ändrar kontrakten. Försvarsdepartementets kontrakt publiceras med ungefär 90 dagars fördröjning.
- Actorn skickar högst 2 anrop per sekund och försöker tre gånger vid nätverksfel, 429 och 5xx.
- Källa: USAspending.gov, U.S. Department of the Treasury. Amerikansk federal myndighetsinformation är fri att använda (public domain).
- Pris: 0,002 USD per kontrakt (2,00 USD per 1 000), plus Apifys plattformsanvändning. maxResults sätter taket för hur mycket en körning kan kosta.
- Kontakt: kontakt@nightwave.se

# Actor input Schema

## `dateFrom` (type: `string`):

First action date, YYYY-MM-DD, for example "2026-09-01". Defaults to 29 days before dateTo, so 30 days in total. The range can be at most 366 days and cannot start before 2007-10-01.

## `dateTo` (type: `string`):

Last action date (inclusive), YYYY-MM-DD, for example "2026-09-30". Defaults to today in Washington time. Leave empty for scheduled runs, so the range follows the calendar.

## `keywords` (type: `array`):

Words or phrases to search for in the award text, at least 3 characters each, for example \["cloud", "cybersecurity"]. Awards matching any of them are returned. Empty means no keyword filter.

## `recipientName` (type: `string`):

Company name (or part of it) or a Unique Entity ID (UEI) of the contractor, for example "Booz Allen" or "JCBMLGPE6Z71". Empty means all contractors.

## `awardingAgencies` (type: `array`):

Agency names exactly as USAspending writes them, for example \["General Services Administration"] or a sub agency such as \["Federal Acquisition Service"]. Empty means all agencies.

## `naicsCodes` (type: `array`):

Industry codes, 2 to 6 digits, for example \["541511"] (custom computer programming). A shorter code matches every code that starts with it, so 5415 includes 541511 and 541512. Empty means all industries.

## `pscCodes` (type: `array`):

Product and Service Codes, for example \["DA01"] (business application development support) or \["R499"]. Empty means all products and services.

## `placeOfPerformanceStates` (type: `array`):

Two letter state codes where the work is done, for example \["VA", "DC"]. Empty means all states.

## `minAmount` (type: `integer`):

Only contracts with an award amount of at least this many US dollars, for example 1000000. Empty means no lower limit.

## `maxAmount` (type: `integer`):

Only contracts with an award amount of at most this many US dollars, for example 50000000. Empty means no upper limit.

## `maxResults` (type: `integer`):

Maximum number of contracts, for example 50. Largest award amount first (most recently modified first with onlyNew). Each contract is one billable result. 1 to 10 000, defaults to 50.

## `includeDetails` (type: `boolean`):

Also fetch each award's detail record to fill totalObligation and baseAndAllOptionsValue, for example true. Makes one extra request per contract, so a run takes about half a second longer per row. Defaults to false.

## `onlyNew` (type: `boolean`):

For scheduled runs. When true, contracts that an earlier run with the same input already delivered are skipped and not charged, so a daily run returns only awards that are new or have a new action (modification or obligation) since the last run. The first run returns everything in the selection. Defaults to false.

## Actor input object example

```json
{
  "dateFrom": "2026-09-01",
  "dateTo": "2026-09-30",
  "keywords": [
    "cloud",
    "cybersecurity"
  ],
  "recipientName": "Booz Allen",
  "awardingAgencies": [
    "General Services Administration",
    "Department of Veterans Affairs"
  ],
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "pscCodes": [
    "DA01",
    "R499"
  ],
  "placeOfPerformanceStates": [
    "VA",
    "DC"
  ],
  "minAmount": 1000000,
  "maxAmount": 50000000,
  "maxResults": 50,
  "includeDetails": true,
  "onlyNew": true
}
```

# Actor output Schema

## `results` (type: `string`):

All rows produced by the run, as JSON. Open in Apify Console or download via the dataset API.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [],
    "awardingAgencies": [],
    "naicsCodes": [
        "541511"
    ],
    "pscCodes": [],
    "placeOfPerformanceStates": [],
    "maxResults": 50,
    "includeDetails": false,
    "onlyNew": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("nightwave-owner/usaspending-federal-contracts").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keywords": [],
    "awardingAgencies": [],
    "naicsCodes": ["541511"],
    "pscCodes": [],
    "placeOfPerformanceStates": [],
    "maxResults": 50,
    "includeDetails": False,
    "onlyNew": False,
}

# Run the Actor and wait for it to finish
run = client.actor("nightwave-owner/usaspending-federal-contracts").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [],
  "awardingAgencies": [],
  "naicsCodes": [
    "541511"
  ],
  "pscCodes": [],
  "placeOfPerformanceStates": [],
  "maxResults": 50,
  "includeDetails": false,
  "onlyNew": false
}' |
apify call nightwave-owner/usaspending-federal-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nightwave-owner/usaspending-federal-contracts"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cFVGinReUGmRjcMuB/builds/ge91EvKSfsCWRcOfT/openapi.json
