# US Federal Expiring Contracts & Recompete Finder (`zhucl1006/us-federal-expiring-contracts-recompete`) Actor

Find US federal contracts ending in the next 3-12 months - upcoming recompete opportunities. Filter by NAICS, PSC, agency, incumbent, state and value. Incumbent UEI, end dates, annualized value and pipeline summaries from the official USAspending.gov API. No API key.

- **URL**: https://apify.com/zhucl1006/us-federal-expiring-contracts-recompete.md
- **Developed by:** [leo zhu](https://apify.com/zhucl1006) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 expiring contract records

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 Expiring Contracts & Recompete Finder (USAspending.gov)

Find **US federal contracts that are about to end** – the recompete opportunities of the next 3–12 months – straight from the official **USAspending.gov API** (U.S. Department of the Treasury). Filter by NAICS, PSC, agency, incumbent contractor, state and award value, and get the incumbent's name and UEI, the current end date, days left, total and annualized contract value and direct USAspending links.

No API key, no login, no proxies. Public-domain government data.

### Who is it for?

- **GovCon business development / capture teams** – build a recompete pipeline 6–18 months before the RFP drops.
- **Small businesses & subcontractors** – find the incumbents whose contracts are ending and pitch teaming.
- **Competitive intelligence** – see which of a competitor's contracts end soon (filter by incumbent name or UEI).
- **Market research & CRM enrichment** – monthly expiring-contract calendars per agency or NAICS.

### What you get per contract

`awardId`, `currentEndDate`, `daysUntilEnd`, `urgency` bucket, `startDate`, `performanceMonths`, `incumbentName`, `incumbentUei`, `awardAmount`, `totalOutlays`, `annualizedValue`, awarding agency and sub-agency, funding agency, description, NAICS and PSC (code + description), place of performance, last modified date, `usaspendingUrl`, `incumbentProfileUrl`.

Optional **summary rows** group the expiring contracts by agency, sub-agency, incumbent, NAICS, PSC, state or **end month** (a recompete calendar), with totals, median, top incumbents and share of value.

### Example input

```json
{ "naicsCodes": ["541512"], "minAmount": 1000000, "expiringWithinDays": 180, "maxItems": 100 }
```

IT services contracts over $1M that end in the next 6 months. Runs in about 10 seconds.

More ideas: `"agencies": ["Department of Veterans Affairs"]`, `"recipients": ["Booz Allen"]`, `"placeOfPerformanceStates": ["VA","MD"]`, `"awardType": "idvs"` for GWACs/IDIQs/BPAs, `"outputMode": "summary", "summaryBy": "month"`.

### How it works

The actor queries contracts with activity in the last `activitySinceMonths` months, scans them ordered by current period-of-performance end date and keeps those ending inside your window (`expiringAfterDays` .. `expiringWithinDays` from today). Up to 30,000 contracts are scanned per run – add filters for very broad searches.

**Note:** the end date is the *current* end date reported to FPDS. Unexercised options can extend a contract, and a follow-on solicitation may appear on SAM.gov under a different number. Use the results as a pipeline and verify on SAM.gov.

### Pricing (pay per event)

- $0.005 per run start
- $0.003 per expiring-contract record ($3 per 1,000)
- $0.01 per summary row

### Related

- [US Federal Contract Awards Scraper](https://apify.com/zhucl1006/us-federal-contract-awards-usaspending) – newly awarded contracts.

Data: USAspending.gov, public domain. Not affiliated with the U.S. Government.

# Actor input Schema

## `expiringWithinDays` (type: `integer`):

Upper edge of the window: contracts whose current period of performance ends no later than today + N days. 180 = next 6 months (typical recompete planning horizon).

## `expiringAfterDays` (type: `integer`):

Lower edge of the window. 0 = from today. Use e.g. 90 to skip contracts ending in the next 3 months, or -90 to include ones that ended recently.

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

Industry codes (2-6 digits), e.g. 541512 (computer systems design), 541330 (engineering), 561210 (facilities support).

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

Product/Service codes, e.g. DA01, R425.

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

Words searched in award descriptions, e.g. 'cybersecurity', 'janitorial'.

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

Agency name, part of name or abbreviation, e.g. 'Department of Defense', 'VA', 'GSA', 'Department of the Army'.

## `recipients` (type: `array`):

Only contracts held by these companies (find a competitor's contracts that are about to end).

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

Two-letter US state codes, e.g. VA, MD, TX.

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

Skip small awards. Prefilled at $1M for faster, more valuable results.

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

Optional upper bound.

## `awardType` (type: `string`):

Contracts or indefinite-delivery vehicles.

## `activitySinceMonths` (type: `integer`):

Only scan contracts with a transaction (award or modification) in the last N months. 24 covers almost all live contracts; raise it for long multi-year vehicles.

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

Order of output records.

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

Maximum expiring-contract records to output (0 = no limit). You pay per record.

## `outputMode` (type: `string`):

Records = one row per expiring contract. Summary = totals grouped by agency/incumbent/NAICS/PSC/state/month.

## `summaryBy` (type: `string`):

Used when Output includes summary rows.

## `summaryTopN` (type: `integer`):

0 = all groups.

## Actor input object example

```json
{
  "expiringWithinDays": 180,
  "expiringAfterDays": 0,
  "naicsCodes": [
    "541512"
  ],
  "minAmount": 1000000,
  "awardType": "contracts",
  "activitySinceMonths": 24,
  "sortBy": "endDateAsc",
  "maxItems": 100,
  "outputMode": "records",
  "summaryBy": "agency",
  "summaryTopN": 50
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "expiringWithinDays": 180,
    "naicsCodes": [
        "541512"
    ],
    "minAmount": 1000000,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhucl1006/us-federal-expiring-contracts-recompete").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 = {
    "expiringWithinDays": 180,
    "naicsCodes": ["541512"],
    "minAmount": 1000000,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("zhucl1006/us-federal-expiring-contracts-recompete").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 '{
  "expiringWithinDays": 180,
  "naicsCodes": [
    "541512"
  ],
  "minAmount": 1000000,
  "maxItems": 100
}' |
apify call zhucl1006/us-federal-expiring-contracts-recompete --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zhucl1006/us-federal-expiring-contracts-recompete"
        }
    }
}
```

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/rSoKAcAb0NabhHx1O/builds/iswe9KreEDDp7tYD4/openapi.json
