# US Federal Contract Awards API (USAspending) (`digital_influx/us-federal-contracts`) Actor

New US federal contracts from USAspending.gov, the day they are signed: winning company with address and UEI, amount, agency, NAICS, PSC, description and place of performance. Filter by state, NAICS, agency, amount and keywords.

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

## Pricing

from $5.00 / 1,000 contract saveds

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

## US Federal Contract Awards API (USAspending)

**Every new US federal contract the day it is signed**, from USAspending.gov, the official source of federal spending data:

- the winning company with its address, UEI and a link to its USAspending profile;
- the amount, signing date, start and end dates;
- the awarding agency and sub agency;
- NAICS and PSC codes with their descriptions, and the contract description;
- where the work is done.

No account, no API key, no proxies: the data comes from the USAspending API of the U.S. Department of the Treasury.

### Who uses it

- **Subcontractors and suppliers:** companies that just won a contract in your industry and state need staff, materials and partners now.
- **B2B sales, lending and factoring:** government contractors with a fresh award, by size and agency.
- **Competitive intelligence:** who wins what, from which agency, for how much.

### What you get

One record per contract:

| Field | Example |
|---|---|
| `awardId`, `contractType` | 86615426F00011, DELIVERY ORDER |
| `recipientName`, `recipientUei` | IMPRES TECHNOLOGY SOLUTIONS, INC, MSSQQ551LG41 |
| `recipientStreet`, `recipientCity`, `recipientState`, `recipientZip`, `recipientCounty`, `recipientCountry` | 810 HESTERS CROSSING RD, APT 100, ROUND ROCK, TX, 78681 |
| `amount`, `outlays` | 5830000 |
| `signedDate`, `startDate`, `endDate`, `lastModified` | 2026-09-29, 2026-09-30, 2027-12-31 |
| `awardingAgency`, `awardingSubAgency`, `fundingAgency` | Department of Housing and Urban Development |
| `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription` | 541519, OTHER COMPUTER RELATED SERVICES, DA01 |
| `description` | MICROSTRATEGY SOFTWARE LICENSES AND SOFTWARE LICENSE SUPPORT SERVICES |
| `performanceCity`, `performanceState`, `performanceZip`, `performanceCounty`, `congressionalDistrict` | Where the work is done |
| `awardUrl`, `recipientUrl`, `retrievedAt` | The award and the company on USAspending.gov |
| `change` | With *Only new*: `new` |

The **OUTPUT** record has the window, the totals and the count by agency and by state.

### Input

New contracts performed in Texas this week:

```json
{
  "postedWithinDays": 7,
  "states": ["TX"],
  "maxResults": 50
}
```

New commercial construction contracts in Virginia this month:

```json
{
  "postedWithinDays": 30,
  "states": ["VA"],
  "naicsCodes": ["236220"]
}
```

New IT contracts of the Department of Veterans Affairs this month:

```json
{
  "postedWithinDays": 30,
  "agencies": ["Department of Veterans Affairs"],
  "pscCodes": ["D"]
}
```

| Field | What it does |
|---|---|
| `postedWithinDays` | Contracts signed in the last N days (7 by default, up to 365). |
| `states` | Where the work is done (2-letter codes). |
| `naicsCodes`, `pscCodes` | Industry and product/service codes; a shorter code covers the longer ones (PSC `D` = IT services). |
| `agencies` | Awarding agencies as USAspending names them. |
| `keywords` | Words to search in the contract text. |
| `minAmount`, `maxAmount` | Contract amount in USD. |
| `maxResults` | Contracts saved, newest signed first (1,000 by default, up to 10,000). |
| `onlyNew` + `memoryName` | For daily runs: only the contracts earlier runs of the same search did not save. The memory lives in a key-value store named `us-federal-contracts-state`. |

### How much it costs

Pay per event: **only for the contracts saved**. Measured on 2026-10-02: 2,662 new contracts were performed in Texas in September 2026; a week of Texas reads in one request of 100 contracts, about 2 seconds.

### Use it from AI agents (MCP)

Claude, ChatGPT, Cursor and any other MCP client can run this Actor as a tool: add `https://mcp.apify.com?tools=digital_influx/us-federal-contracts` as a remote MCP server and sign in with your Apify account. It is also one of the tools of US & UK Public Records MCP (`digital_influx/public-records-mcp`), by the same author, made for agents.

### Good to know

- **Contracts only** (types A to D: BPA calls, purchase orders, delivery orders and definitive contracts), and only **new awards**: a decades-old contract with a recent modification is not new.
- **Reporting delays:** agencies report within days to weeks, so the last days of a window fill in over time. **The Department of Defense publishes its contracts with a 90-day delay** (21 new DoD contracts in the 30 days before 2026-10-02, against 290,457 since June).
- **Agency names** must be written as USAspending writes them ("Department of Veterans Affairs"); an unknown name matches nothing, and the OUTPUT says so.
- **Requests:** one a second. The API answers 100 contracts a request, so a run stops after 10,000.

### Source and attribution

USAspending.gov, U.S. Department of the Treasury. Federal spending data is public domain. USAspending.gov does not endorse this Actor.

# Actor input Schema

## `postedWithinDays` (type: `integer`):

Contracts signed in the last N days. Agencies report within days to weeks, so the last days fill in over time.

## `states` (type: `array`):

2-letter codes of where the work is done, e.g. TX, VA. Empty = everywhere.

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

Industry codes of 2 to 6 digits, e.g. 236220 (commercial building construction) or 5415 (computer systems design).

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

Product and service codes, e.g. D (IT services) or Y1AZ.

## `agencies` (type: `array`):

Top-tier agency names as USAspending writes them, e.g. Department of Defense, Department of Veterans Affairs.

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

Words to search in the contract description and other text, e.g. cybersecurity, roofing.

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

Only contracts of at least this amount in US dollars.

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

Only contracts of at most this amount in US dollars.

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

Contracts saved in this run, newest signed first (up to 10,000). You also never pay more than the spending limit you set for the run.

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

Save only contracts that earlier runs of this same search did not save. Schedule it daily. The memory lives in a key-value store named "us-federal-contracts-state" in your account.

## `memoryName` (type: `string`):

By default each search has its own memory. Give a name to share one memory between tasks, or a new name to start over.

## Actor input object example

```json
{
  "postedWithinDays": 7,
  "states": [
    "TX"
  ],
  "maxResults": 50,
  "onlyNew": false
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "postedWithinDays": 7,
    "states": [
        "TX"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("digital_influx/us-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 = {
    "postedWithinDays": 7,
    "states": ["TX"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("digital_influx/us-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 '{
  "postedWithinDays": 7,
  "states": [
    "TX"
  ],
  "maxResults": 50
}' |
apify call digital_influx/us-federal-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,digital_influx/us-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/EoFCl2s8YYRu0ErVR/builds/c6Ntu3YRsLs9XfRhg/openapi.json
