# USAspending Federal Contracts & Re-Compete Radar (MCP-Ready) (`ferraz_michel/usaspending-federal-contracts-mcp`) Actor

Search official US federal contracts and grants via USAspending.gov without an API key. Filter by keyword, NAICS, agency, state, recipient, or expiring contracts (Re-Compete Radar) with compact 2KB MCP summaries for GovCon and AI agents.

- **URL**: https://apify.com/ferraz_michel/usaspending-federal-contracts-mcp.md
- **Developed by:** [Michel Ferraz](https://apify.com/ferraz_michel) (community)
- **Categories:** AI, Agents, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 federal award records

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

## USAspending Federal Contracts & Re-Compete Radar (MCP-Ready)

> Query official U.S. federal prime contracts and grants from **USAspending.gov** (`api.usaspending.gov/api/v2`) with zero external API keys—automatically enriching awards with **days until expiration** and **Re-Compete Radar** priority (`URGENT_RECOMPETE`, `UPCOMING_RECOMPETE`, `ACTIVE_LONG_TERM`) for GovCon teams and AI agents.

***

### Why Use This Actor?

1. **Built-In Re-Compete Radar:** Flags expiring federal contracts (`0–180 days` = `URGENT_RECOMPETE`, `181–365 days` = `UPCOMING_RECOMPETE`) so GovCon BD teams spot incumbent contracts ready for re-bid months before solicitation.
2. **Rich GovCon Filtering:** Filter by keywords, incumbent `recipientNames`, `naicsCodes`, `awardingAgency`, `placeOfPerformanceState`, `minAwardAmountUsd`, and `expiringWithinDays`.
3. **Zero API Keys Required:** Uses the official USAspending.gov REST API v2 with automatic pagination and direct `https://www.usaspending.gov/award/...` links.
4. **Token-Efficient MCP Summaries:** Choose `outputMode: "mcp_summary"` to get a compact `< 2 KB` digest with total contract volume, top incumbents, top agencies, and urgent re-compete alerts.

***

### Input Parameters

| Field | Type | Description | Example |
| :--- | :--- | :--- | :--- |
| `keywords` | Array | Search terms in award descriptions | `["cybersecurity"]` |
| `recipientNames` | Array | Filter by incumbent / contractor name | `["LOCKHEED MARTIN"]` |
| `naicsCodes` | Array | 2- to 6-digit NAICS industry codes | `["541512"]` |
| `awardingAgency` | String | Top-tier US federal agency name | `"Department of Defense"` |
| `placeOfPerformanceState` | String | Two-letter US state code | `"VA"` |
| `awardType` | String | `"contracts"`, `"grants"`, or `"all"` | `"contracts"` |
| `minAwardAmountUsd` | Number | Minimum award amount in USD | `1000000` |
| `startDateFrom` / `endDateTo` | String | Date window (`YYYY-MM-DD`) | `"2024-01-01"` / `"2027-12-31"` |
| `expiringWithinDays` | Integer | Filter & sort contracts expiring in `N` days | `180` |
| `maxRecords` | Integer | Maximum records returned (`1–200`) | `25` |
| `outputMode` | String | `"detailed"` or `"mcp_summary"` | `"detailed"` |

***

### Connect via MCP (Claude Desktop, Cursor & AI Agents)

Connect this Actor directly via Apify's official MCP server (`https://mcp.apify.com`). Always prefer `outputMode: "mcp_summary"` inside interactive chat sessions for fast responses and minimal token usage.

#### Remote HTTP (Recommended — OAuth)

```json
{
  "mcpServers": {
    "usaspending-federal-contracts": {
      "transport": "http",
      "url": "https://mcp.apify.com/?actors=ferraz_michel/usaspending-federal-contracts-mcp"
    }
  }
}
```

#### Local `npx` (`@apify/actors-mcp-server`)

```json
{
  "mcpServers": {
    "usaspending-federal-contracts": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "ferraz_michel/usaspending-federal-contracts-mcp"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

# Actor input Schema

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

Search keywords in contract/grant descriptions (e.g. \['cybersecurity', 'cloud']).

## `recipientNames` (type: `array`):

Optional list of contractor or recipient company names to filter (e.g. \['LOCKHEED MARTIN']).

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

Optional 2- to 6-digit NAICS industry codes (e.g. \['541512', '541519']).

## `awardingAgency` (type: `string`):

Optional US federal awarding agency name (e.g. 'Department of Defense', 'General Services Administration').

## `placeOfPerformanceState` (type: `string`):

Optional two-letter US state code (e.g. 'VA', 'TX', 'CA').

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

Filter by prime federal contracts (A/B/C/D), grants (02-05), or both.

## `minAwardAmountUsd` (type: `number`):

Optional minimum contract/grant dollar amount.

## `startDateFrom` (type: `string`):

Earliest award period date in YYYY-MM-DD format.

## `endDateTo` (type: `string`):

Latest award period date in YYYY-MM-DD format.

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

Optional filter returning only active contracts expiring within the next N days (1-1095), sorted by soonest expiration.

## `maxRecords` (type: `integer`):

Maximum number of federal awards to return (1-200).

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

Choose detailed dataset rows or a compact MCP Re-Compete summary.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "recipientNames": [],
  "naicsCodes": [],
  "awardType": "contracts",
  "startDateFrom": "2024-01-01",
  "endDateTo": "2027-12-31",
  "maxRecords": 25,
  "outputMode": "detailed"
}
```

# Actor output Schema

## `awards` (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 = {
    "keywords": [
        "cybersecurity"
    ],
    "maxRecords": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("ferraz_michel/usaspending-federal-contracts-mcp").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": ["cybersecurity"],
    "maxRecords": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("ferraz_michel/usaspending-federal-contracts-mcp").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": [
    "cybersecurity"
  ],
  "maxRecords": 25
}' |
apify call ferraz_michel/usaspending-federal-contracts-mcp --silent --output-dataset

```

## MCP server setup

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

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/vwTLS9eMRiRvXZEfH/builds/hg3eyw9z23VvBghM5/openapi.json
