# USAspending Scraper - Federal Contracts and Expiring Contracts (`publicrecords101/usaspending-contracts-scraper`) Actor

Extract federal contract awards from USAspending.gov with recipient, agency, NAICS, PSC, amounts, end dates and option ceilings. Find contracts ending soon for recompete leads. Official data, no API key needed.

- **URL**: https://apify.com/publicrecords101/usaspending-contracts-scraper.md
- **Developed by:** [Public Records Data Tools](https://apify.com/publicrecords101) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What does the USAspending Scraper do?

The **USAspending Scraper** extracts **federal contract awards** from [USAspending.gov](https://www.usaspending.gov), the
official source of US federal spending data. For each contract you get the **contractor (recipient)**, the **awarding
agency**, **NAICS and PSC codes**, **obligated amount**, **start and end dates**, and, with award details, the **option
ceiling**, **potential end date**, **set-aside**, **competition**, **number of offers** and the **parent contract vehicle**
(GSA schedule, GWAC or IDIQ), as clean JSON, CSV or Excel.

Its **"Ending within" filter finds contracts that are about to expire**, earliest first: recompete leads for your
industry. It reads USAspending's official public API, so there is **no login and no API key**. The easiest way to try it:
enter your NAICS code, set "Ending within" to 180 days and press **Start**.

### What data can you extract from USAspending?

| Field | Example |
|---|---|
| `awardId`, `contractType`, `description` | HR001121F0006, DELIVERY ORDER, MULTI-NETWORK SUPPORT SERVICES |
| `recipientName`, `recipientUei`, `parentRecipientName` | SECURIGENCE LLC, Q56SJRTSJSE4, THE CHENEGA CORPORATION |
| `recipientCity`, `recipientState`, `recipientBusinessCategories` | LEESBURG, VA, Small Business, Veteran Owned Business |
| `awardingAgency`, `awardingSubAgency`, `awardingOffice`, `fundingAgency` | Department of Defense, DARPA |
| `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription` | 541511 Custom Computer Programming Services, D301 |
| `placeOfPerformanceState`, `placeOfPerformanceCity` | VA, ARLINGTON |
| `startDate`, `endDate`, `potentialEndDate`, `daysUntilEnd` | 2021-02-03, 2027-06-30, 2030-06-30, 260 |
| `obligatedAmount`, `outlays` | 664457198.25 (USD) |
| `currentValueWithExercisedOptions`, `potentialValueWithAllOptions` | 816412873.82, 1207608560.54 (USD) |
| `parentAwardId`, `parentAwardAgency`, `parentAwardType` | GS35F626GA, General Services Administration, FSS |
| `solicitationId`, `setAside`, `extentCompeted`, `numberOfOffers`, `pricingType` | HR001120Q0002, SMALL BUSINESS SET ASIDE - TOTAL, 3 |
| `subawardCount` | 10 |
| `url` | Link to the award on USAspending.gov |

Fields marked "with award details" in the output schema are filled when **Include award details** is on (the default).
Dates are `YYYY-MM-DD`, amounts are numbers in USD.

### Who uses federal contract data?

- **Government contractors and BD teams** looking for contracts in their NAICS code that end soon and will be recompeted.
- **Capture managers** checking the incumbent, the ceiling, the contract vehicle and how competitive the last award was.
- **Subcontractors and teaming partners** finding primes that hold work in their area.
- **Market and policy researchers** analysing who wins federal work.
- **AI agents and assistants** answering "which federal IT contracts in Virginia expire in the next six months?"

### How to use the USAspending Scraper

1. Enter one or more **NAICS codes**, or other filters: **PSC codes**, **keywords**, **awarding agencies**,
   **place of performance states**, **recipient** or **minimum amount**.
2. To find expiring contracts, set **Ending within (days)**, e.g. 180. Leave it empty to list all matching contracts,
   sorted by amount or last change.
3. Set **Maximum results** and press **Start**.
4. Download the results as JSON, CSV, Excel or HTML, or read them through the API.

Turn off **Include award details** for a faster list without ceilings, set-asides and contract vehicles.

### How much does it cost to scrape USAspending?

This Actor uses **pay-per-result pricing**: you pay only for contracts saved to your dataset. There is no monthly fee
and no separate charge for platform usage.

| Apify plan | Price per 1,000 contracts |
|---|---|
| Free | $3.00 |
| Bronze | $2.70 |
| Silver | $2.40 |
| Gold | $2.00 |

**Example:** 1,000 contracts with award details cost **$3.00** on the free plan and **$2.00** on Gold. A test run with
20 results costs $0.06. Each run also has Apify's standard start fee of $0.00005.

In our test runs, 20 contracts took about 15 seconds and 1,000 contracts with award details took about 11 minutes,
because the Actor reads each award's detail record at a polite rate. Turning off **Include award details** makes large
runs much faster.

### Input example

```json
{
    "endingWithinDays": 180,
    "naicsCodes": ["541511", "541512"],
    "placeOfPerformanceStates": ["VA", "MD"],
    "minAmount": 1000000,
    "includeDetails": true,
    "maxItems": 100
}
```

### Output example

```json
{
    "awardId": "HR001121F0006",
    "awardKey": "CONT_AWD_HR001121F0006_9700_GS35F626GA_4732",
    "contractType": "DELIVERY ORDER",
    "description": "MULTI-NETWORK SUPPORT SERVICES",
    "recipientName": "SECURIGENCE LLC",
    "recipientUei": "Q56SJRTSJSE4",
    "recipientId": "fe569147-ec14-c7b1-0396-b9c5fa2d212f-C",
    "parentRecipientName": "THE CHENEGA CORPORATION",
    "recipientCity": "LEESBURG",
    "recipientState": "VA",
    "recipientBusinessCategories": [
        "Asian Pacific American Owned Business",
        "Category Business",
        "Corporate Entity Not Tax Exempt",
        "HUBZone Firm",
        "Limited Liability Corporation",
        "Minority Owned Business",
        "Small Business",
        "Special Designations",
        "U.S.-Owned Business",
        "Veteran Owned Business"
    ],
    "awardingAgency": "Department of Defense",
    "awardingSubAgency": "Defense Advanced Research Projects Agency",
    "awardingOffice": "DEF ADVANCED RESEARCH PROJECTS AGCY",
    "fundingAgency": "Department of Defense",
    "naicsCode": "541511",
    "naicsDescription": "CUSTOM COMPUTER PROGRAMMING SERVICES",
    "pscCode": "D301",
    "pscDescription": "IT AND TELECOM- FACILITY OPERATION AND MAINTENANCE",
    "placeOfPerformanceState": "VA",
    "placeOfPerformanceCity": "ARLINGTON",
    "startDate": "2021-02-03",
    "endDate": "2027-06-30",
    "potentialEndDate": "2030-06-30",
    "daysUntilEnd": 260,
    "dateSigned": "2020-10-14",
    "lastModifiedDate": "2026-06-16",
    "obligatedAmount": 664457198.25,
    "outlays": 0,
    "currentValueWithExercisedOptions": 816412873.82,
    "potentialValueWithAllOptions": 1207608560.54,
    "parentAwardId": "GS35F626GA",
    "parentAwardAgency": "General Services Administration",
    "parentAwardType": "FSS",
    "solicitationId": "HR001120Q0002",
    "setAside": "SMALL BUSINESS SET ASIDE - TOTAL",
    "extentCompeted": "FULL AND OPEN COMPETITION",
    "numberOfOffers": 3,
    "pricingType": "FIXED PRICE AWARD FEE",
    "subawardCount": 10,
    "detailsIncluded": true,
    "url": "https://www.usaspending.gov/award/CONT_AWD_HR001121F0006_9700_GS35F626GA_4732",
    "sourceUrl": "https://api.usaspending.gov/api/v2/awards/CONT_AWD_HR001121F0006_9700_GS35F626GA_4732/",
    "scrapedAt": "2026-10-13T00:00:00.000Z"
}
```

### Get new and changed contracts on a schedule

Turn on **Only new or updated** and schedule the Actor daily or weekly. Each run returns only contracts that your
earlier runs with the same filters have not returned, plus contracts USAspending has recorded a change to since.
Connect the run to email, Slack or Google Sheets to get alerts.

### Integrations and API

Run the Actor from the Apify API, the JavaScript or Python client, or connect it to **Make**, **Zapier**,
**Google Sheets**, **Slack** and webhooks. Results can be exported as JSON, CSV, Excel, XML or RSS.

### Use with AI assistants (MCP)

The Actor works as a tool for AI agents through Apify's MCP server: the input fields have plain names and
descriptions, and every field is optional.

### Other public-records scrapers

| Actor | Data |
|---|---|
| [Grants.gov Scraper](https://apify.com/publicrecords101/grants-gov-scraper) | Federal grant opportunities with deadlines, amounts and eligibility |
| [SEC EDGAR Filings Scraper](https://apify.com/publicrecords101/sec-edgar-scraper) | 8-K, 10-K, 10-Q and Form 4 filings for any list of tickers |
| [FDA Recalls Scraper](https://apify.com/publicrecords101/fda-recalls-scraper) | FDA food, drug and medical device recalls in one feed |
| [NIH RePORTER Scraper](https://apify.com/publicrecords101/nih-reporter-scraper) | NIH-funded research projects: newly funded labs, PIs and amounts |
| [Federal Register Scraper](https://apify.com/publicrecords101/federal-register-scraper) | US rules, proposed rules and notices with comment deadlines |

### FAQ

**Is it legal to scrape USAspending.gov?** USAspending data is public US government information published under the
DATA Act through an official, keyless API. This Actor reads only that API, at a polite rate. It never outputs data about
private individuals: recipients USAspending marks as individuals have their name and address removed, and executive
compensation names are not included. You are responsible for how you use the data.

**Which contracts are included?** Prime contract awards (definitive contracts, purchase orders, delivery orders and BPA
calls) with actions since 2007-10-01, the range USAspending's search covers. Contract vehicles themselves (IDVs) and
grants are not included; for grants, see the Grants.gov Scraper.

**Why is a contract's end date in the past or missing?** USAspending shows the end date from the latest action the agency
reported. Agencies sometimes extend contracts late, so treat "ending soon" as a lead to check, not a final date.

**How fresh is the data?** Each run reads USAspending live, so results are as current as USAspending itself.

**Something is wrong or missing?** Open an issue on the Actor's Issues tab and we'll reply within 48 hours. Custom
filters or data joins are welcome too.

# Changelog

This Actor's version history is a separate document: https://apify.com/publicrecords101/usaspending-contracts-scraper/changelog.md

# Actor input Schema

## `endingWithinDays` (type: `integer`):

Only contracts whose current period of performance ends between today and this many days from now, earliest first. Use it to find contracts coming up for recompete. Leave empty for all contracts.

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

Only contracts under these NAICS industry codes (2 to 6 digits; shorter codes include everything below them), e.g. 541511 custom programming, 5415 computer systems design. Leave empty for all industries.

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

Only contracts with these product and service codes, e.g. D301 or R425. Leave empty for all.

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

Words searched across award descriptions and other text fields, e.g. cybersecurity, janitorial. Leave empty for all.

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

Only contracts awarded by these departments, written exactly as USAspending names them, e.g. Department of Defense, Department of Veterans Affairs, General Services Administration. Leave empty for all.

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

Only contracts performed in these US states, as two-letter codes, e.g. VA, TX. Leave empty for all.

## `recipientSearch` (type: `string`):

Only contracts whose recipient name, UEI or DUNS matches this text, e.g. Booz Allen.

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

Only contracts with at least this much obligated.

## `actionDateFrom` (type: `string`):

Only contracts with an award or modification on or after this date (YYYY-MM-DD). USAspending search covers 2007-10-01 onwards.

## `sortBy` (type: `string`):

Order of results when 'Ending within' is empty. 'Ending within' always sorts by end date, earliest first.

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

Fetch each contract's full record: value with all options (ceiling), potential end date, set-aside, competition, number of offers, solicitation id, parent contract vehicle and recipient UEI. Turn off for a faster list.

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

Skip contracts your earlier runs with the same filters already returned, unless USAspending recorded a change since. Use with a schedule for alerts.

## `maxItems` (type: `integer`):

Stop after this many contracts.

## Actor input object example

```json
{
  "endingWithinDays": 365,
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "pscCodes": [
    "D301"
  ],
  "keywords": [
    "cybersecurity"
  ],
  "awardingAgencies": [
    "Department of Veterans Affairs"
  ],
  "placeOfPerformanceStates": [
    "VA",
    "MD"
  ],
  "recipientSearch": "Booz Allen",
  "minAmount": 1000000,
  "actionDateFrom": "2024-10-01",
  "sortBy": "lastModified",
  "includeDetails": true,
  "onlyNew": true,
  "maxItems": 500
}
```

# Actor output Schema

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

Federal contract awards found by this run, one per row.

# 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 = {
    "endingWithinDays": 180,
    "naicsCodes": [
        "541511"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords101/usaspending-contracts-scraper").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 = {
    "endingWithinDays": 180,
    "naicsCodes": ["541511"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords101/usaspending-contracts-scraper").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 '{
  "endingWithinDays": 180,
  "naicsCodes": [
    "541511"
  ],
  "maxItems": 20
}' |
apify call publicrecords101/usaspending-contracts-scraper --silent --output-dataset

```

## MCP server setup

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

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/rlKSn1eswRTNGtWnf/builds/8O2gk1khFgpUVZq53/openapi.json
