# US Federal Contract Awards & Recompete Finder (USAspending) (`groundtruth/usaspending-government-contracts`) Actor

Find US federal contracts expiring soon (recompetes) or search awarded government contracts by agency, keyword, date and amount. Official USAspending data.

- **URL**: https://apify.com/groundtruth/usaspending-government-contracts.md
- **Developed by:** [Ground Truth](https://apify.com/groundtruth) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## US Federal Government Contract Awards Search + Recompete Finder (USAspending)

**Find federal contracts coming up for re-bid, or search every awarded US federal government contract — by agency, keyword, date, and dollar amount. Built on the Treasury's official USAspending data, with every result linking back to the government record so you can verify it yourself.**

Federal contract data, government spending records, and contract award history in clean JSON. No login, no scraping, no third-party data reseller.

***

### Find recompetes: contracts coming up for re-bid

When a federal contract's period of performance ends, the work usually has to be re-competed. Those are the highest-probability opportunities in government contracting, and they are visible in public data 12–18 months before anyone issues a solicitation.

Set **`expiring_within_days`** and this becomes a recompete finder. Set **`expiring_after_days`** too, and you skip the ones ending too soon to bid on.

```
expiring_after_days: 120
expiring_within_days: 365
min_amount: 5000000
```

Returns contracts over $5M expiring between four months and a year out — with the incumbent, the agency, the dollar value, and `days_until_expiry` on every record:

```json
{
  "award_id": "47QFCA22F0021",
  "recipient": "PERATON ENTERPRISE SOLUTIONS LLC",
  "amount_usd": 682369225.00,
  "awarding_agency": "General Services Administration",
  "end_date": "2026-12-17",
  "days_until_expiry": 120,
  "verify_url": "https://www.usaspending.gov/award/..."
}
```

**One honest limit:** recompete mode searches contracts with recorded activity in the past year, because the API caps how deep results can be paged. A long-dormant contract with no recent modifications may not appear. If your search is too broad to page through, the run says so in the log rather than returning a confidently empty list.

### What you'd use this for

**Find who is winning government contracts in your market.** Search federal contract awards by keyword and see which companies the government is paying, how much, and through which agency. Useful for competitive research, market sizing, and partner identification in the govcon space.

**Track a competitor's federal contract history.** Pull every award a specific recipient has received, with dollar amounts and periods of performance.

**Size an agency's spending before you bid.** Filter federal contract awards by agency and dollar threshold to see how much a department actually spends in a category.

**Monitor federal contract awards on a schedule.** Pull awards over a rolling date range and diff them to catch new government contract activity.

**Feed an AI agent.** Returns flat JSON with stable field names, so an agent can call this as a tool and use the output without parsing prose. Every record includes a verification URL, which matters when an agent's output has to be auditable.

#### What this does not do

Stated plainly, because a mismatch here is the fastest route to a bad review:

- **It searches awarded contracts, not open opportunities.** This is money the government has already committed. If you want solicitations you can bid on, you want SAM.gov opportunity data, which this is not.
- **Federal only.** No state, county, or municipal contracts.
- **No data before fiscal year 2008.** That is where USAspending coverage begins.
- **It does not score, rank, or predict.** It returns the government's record, reformatted.

***

### Sample output

Searching Department of Energy contract awards:

```json
{
  "award_id": "DEAC0500OR22725",
  "recipient": "UT-BATTELLE LLC",
  "amount_usd": 42257183758.79,
  "awarding_agency": "Department of Energy",
  "awarding_sub_agency": "Department of Energy",
  "start_date": "1999-10-15",
  "end_date": "2030-03-31",
  "description": "MANAGEMENT AND OPERATION OF THE OAK RIDGE NATIONAL LABORATORY",
  "verify_url": "https://www.usaspending.gov/award/CONT_AWD_DEAC0500OR22725_8900_-NONE-_-NONE-"
}
```

**Check it yourself.** Open the `verify_url` on any record and compare against usaspending.gov. Every field is the US Treasury's published record — this tool reformats that data, it does not estimate, infer, or enrich any of it.

That link is not decoration. It is the reason to trust the output over a scraper that might be returning stale or mangled data, and it is on every single record.

#### When something goes wrong

```json
{ "error": "start_date is '01/15/2024', which is not a valid YYYY-MM-DD date" }
```

Errors name what was wrong and what to do about it. The run fails cleanly rather than returning a partial dataset that looks like a real answer. If your filters match nothing, the run **succeeds** and returns zero records with a log line saying so — an empty result and a broken tool should never look the same.

***

### Configuration

| Input | Type | Required | Default | Description |
|---|---|---|---|---|
| `keyword` | string | no | — | Free-text search across award descriptions and recipient names. Max 500 characters |
| `expiring_within_days` | integer | no | — | **Recompete mode.** Only contracts ending within this many days. 1–1825 |
| `expiring_after_days` | integer | no | `0` | Skip contracts ending sooner than this — bid lead time. Requires the field above |
| `agencies` | array | no | all | Awarding agency names, e.g. `["Department of Defense"]` |
| `start_date` | string | no | `2024-10-01` | ISO `YYYY-MM-DD`. No earlier than `2007-10-01` |
| `end_date` | string | no | today | ISO `YYYY-MM-DD` |
| `award_types` | array | no | `["A","B","C","D"]` | Contract type codes — see below |
| `min_amount` | number | no | — | Only awards at or above this dollar amount |
| `limit` | integer | no | `25` | Records to return, 1–100 |

Results are sorted by award amount, largest first — or by soonest expiry in recompete mode.

#### Award type codes

| Code | Meaning |
|---|---|
| `A` | BPA Call |
| `B` | Purchase Order |
| `C` | Delivery Order |
| `D` | Definitive Contract |

Grant, loan, and direct-payment codes (`02`–`11`) are also accepted if you want federal assistance awards rather than contracts.

#### Output fields

`award_id`, `recipient`, `amount_usd`, `awarding_agency`, `awarding_sub_agency`, `start_date`, `end_date`, `description`, `verify_url`.

In recompete mode, each record also carries **`days_until_expiry`**.

Every field is always present. A value the government has not published comes back as `null` — never `0` or `""`, because those would misstate the record.

#### Errors

| Error | Meaning |
|---|---|
| `Invalid input: …` | A parameter was malformed. The message names which and why |
| `USAspending API returned HTTP …` | The upstream government API failed. **Nothing is charged** |
| `Could not reach USAspending API` | Network failure. **Nothing is charged** |

***

### Pricing

**Free while this launches.** Run it as much as you like — you pay only Apify's platform compute, which is a fraction of a cent per run.

Pay-per-event pricing will be introduced later at **$0.005 per award record returned** ($5.00 per 1,000 — a 25-record run would cost $0.125). This listing will be updated before that happens, and Apify gives 14 days' notice on any pricing change.

**When it is priced, failed runs will still cost nothing.** Charging happens per record delivered, so if the government API is down or your input is rejected, you are not billed. Several tools in this category fail a large share of their runs; you should not pay for that.

***

### Frequently asked questions

**Where does this data come from?**
[USAspending.gov](https://www.usaspending.gov), the US Department of the Treasury's official open-data source for federal spending, published under the DATA Act. It is the same data the government publishes on its own website.

**Is this scraping?**
No. It calls the documented public USAspending API. No login, no browser automation, no bot evasion, no terms being worked around.

**How current is the data?**
As current as USAspending itself. Federal agencies report on their own cycles, so very recent awards may take time to appear. This tool does not add or reduce that lag.

**Can I use this to find contracts to bid on?**
Yes, indirectly, and that is the point of recompete mode. This shows contracts *ending* soon, which is where the next solicitation comes from — usually months before it reaches SAM.gov. For solicitations already published, use SAM.gov.

**What is a recompete?**
When a contract's period of performance ends, the agency generally has to re-solicit the work. The current holder is the incumbent; everyone else is trying to unseat them. Finding these early is the core of government business development.

**Does it include subcontracts?**
No. Prime awards only.

**Can I get more than 100 results?**
Not in a single run. Run again with a narrower date range or a higher `min_amount` to partition the results.

**Why is there a verification link on every record?**
Because you should not have to take a data tool's word for it. Open the link and compare. If a value ever disagrees with usaspending.gov, that is a bug and it should be reported.

**Does this work as a tool for an AI agent?**
Yes. Flat JSON, stable field names, described errors, and a verification URL per record so the agent's output stays auditable.

***

### Related

- [USAspending.gov](https://www.usaspending.gov) — the source
- [USAspending API documentation](https://api.usaspending.gov/) — the documented endpoint this calls
- [SAM.gov](https://sam.gov) — where open federal contract *opportunities* live, which this tool does not cover

# Actor input Schema

## `keyword` (type: `string`):

Free-text search across award descriptions and recipient names. Leave empty to search all awards.

## `expiring_within_days` (type: `integer`):

Only return contracts whose period of performance ends within this many days. Turns the tool into a recompete finder: contracts coming up for re-bid. Leave empty for a normal award search.

## `expiring_after_days` (type: `integer`):

Skip contracts expiring sooner than this. A contract ending next week is too late to bid on. Typical: 120. Requires 'Expiring within'.

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

Federal agency names, exactly as they appear on usaspending.gov. Leave empty for all agencies.

## `start_date` (type: `string`):

Earliest award date, YYYY-MM-DD. USAspending has no data before 2007-10-01.

## `end_date` (type: `string`):

Latest award date, YYYY-MM-DD. Defaults to today.

## `award_types` (type: `array`):

Contract type codes. D = definitive contract, C = delivery order, B = purchase order, A = BPA call.

## `min_amount` (type: `integer`):

Only return awards at or above this dollar amount.

## `limit` (type: `integer`):

How many awards to return, 1 to 100. Sorted by amount, largest first.

## Actor input object example

```json
{
  "keyword": "cybersecurity",
  "expiring_within_days": 365,
  "expiring_after_days": 120,
  "agencies": [
    "Department of Defense"
  ],
  "start_date": "2024-10-01",
  "award_types": [
    "A",
    "B",
    "C",
    "D"
  ],
  "limit": 25
}
```

# Actor output Schema

## `awards` (type: `string`):

No description

## `awardsCsv` (type: `string`):

No description

## `runDetails` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("groundtruth/usaspending-government-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("groundtruth/usaspending-government-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 '{}' |
apify call groundtruth/usaspending-government-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,groundtruth/usaspending-government-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/cHbRoyor3jaeJhooO/builds/rgfSZELpeenI07s1A/openapi.json
