# US Federal Contracts & Grants Scraper: USAspending & Grants.gov (`informed_almandine_vzb/us-federal-contracts-grants-scraper`) Actor

Scrape US federal contract awards (USAspending.gov) and federal grant opportunities (Grants.gov) with award amounts, recipients, NAICS, agencies, and contacts.

- **URL**: https://apify.com/informed_almandine_vzb/us-federal-contracts-grants-scraper.md
- **Developed by:** [Almandine Data](https://apify.com/informed_almandine_vzb) (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

Pay per event

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 Contracts & Grants Scraper: USAspending & Grants.gov

Scrape US federal contract awards (USAspending.gov) and federal grant opportunities (Grants.gov) with award amounts, recipients, NAICS, agencies, and contacts.

### What it does

Searches and extracts official US federal contract awards from USAspending.gov (FPDS feed) and open/forecasted federal grant opportunities from Grants.gov with award values, recipient entities, NAICS/CFDA codes, awarding agencies, funding ceilings, and grantor contact details. Export clean, deduplicated data as **JSON, CSV, Excel, XML, or RSS**, or connect directly via the **Apify REST API, Python/JavaScript SDKs, CLI, MCP Server, Clay, n8n, Make, or Zapier** — with **no login, cookies, or browser overhead**.

### Use cases

- **B2B Outbound to Recent Federal Contract Winners:** Identify companies that just won $50K–$100M+ DoD, DHS, HHS, or NASA contracts (`recipientOrEligibility`, `amountUsd`, `naicsOrAssistanceCode`) and have immediate budget for software, cloud, cybersecurity, and staffing.
- **GovCon Capture & Competitive Intelligence:** Track competitor contract vehicles, awarding sub-agencies (`subAgencyName`), performance timelines (`openOrStartDate` to `closeOrEndDate`), and contract descriptions across NAICS codes.
- **Non-Dilutive R\&D Grant Scouting (SBIR/STTR, NSF, NIH, DOE, DARPA):** Monitor `forecasted` and `posted` federal grants on Grants.gov with enriched `awardCeilingUsd`, `awardFloorUsd`, `amountUsd` (estimated program funding), and direct grantor `contactEmail`.
- **Automated Procurement Alerts in Slack, Clay, or CRM:** Schedule daily runs with `onlyNew: true` to stream new federal awards and grant postings into HubSpot, Salesforce, Clay, or n8n.

### Why use this scraper?

| Feature | This Actor | Generic Browser / HTML Scrapers |
|---|---|---|
| **Architecture** | Direct structured API / JSON / SSR requests (`curl_cffi`) | Heavy headless browser automation |
| **Speed & reliability** | **2–25 seconds** for 50–200 items | Minutes of high compute burn |
| **Pricing model** | **Pay per result (`$0.00` actor-start fee)** | Monthly rental or high CU overhead |
| **Error handling** | Failed inputs logged in `ERRORS` key-value record and **never charged** | Bills compute time even on failures |

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | `string` | `"both"` | Extract US federal contract awards from USAspending.gov ('contracts'), active/forecasted federal grant opportunities from Grants.gov ('grants'), or both in one unified dataset ('both'). |
| `keywords` | `array` | `["artificial intelligence", "cybersecurity"]` | Keywords matched against federal contract award descriptions (USAspending.gov) and grant titles/synopses (Grants.gov). |
| `awardStartDate` | `string` | `"2025-01-01"` | Start date filter (YYYY-MM-DD) for USAspending.gov federal contract awards. |
| `awardEndDate` | `string` | `"2026-10-25"` | End date filter (YYYY-MM-DD) for USAspending.gov federal contract awards. |
| `minAwardAmount` | `integer` | `50000` | Minimum obligated federal contract award amount in USD. |
| `grantStatuses` | `string` | `"forecasted|posted"` | Filter Grants.gov opportunities by status ('forecasted|posted' for open and upcoming grants). |
| `includeGrantDetails` | `boolean` | `true` | Fetch full opportunity details from Grants.gov to attach awardCeilingUsd, awardFloorUsd, estimatedFunding, and grantor contact email/name. |
| `onlyNew` | `boolean` | `false` | Deduplicate across runs via Apify Key-Value Store and emit only newly seen contract awards or grant opportunities. |
| `maxItemsPerSource` | `integer` | `35` | Maximum number of records to extract per enabled source (default 35 contracts + 35 grants = 70 records). |
| `delaySeconds` | `number` | `0.25` | Polite pause between upstream HTTP requests (seconds). |

#### Parameter details

- **Extraction mode** (`mode`, `string`): Extract US federal contract awards from USAspending.gov ('contracts'), active/forecasted federal grant opportunities from Grants.gov ('grants'), or both in one unified dataset ('both').
- **Search keywords** (`keywords`, `array`): Keywords matched against federal contract award descriptions (USAspending.gov) and grant titles/synopses (Grants.gov).
- **Contract award start date (YYYY-MM-DD)** (`awardStartDate`, `string`): Start date filter (YYYY-MM-DD) for USAspending.gov federal contract awards.
- **Contract award end date (YYYY-MM-DD)** (`awardEndDate`, `string`): End date filter (YYYY-MM-DD) for USAspending.gov federal contract awards.
- **Minimum contract award amount (USD)** (`minAwardAmount`, `integer`): Minimum obligated federal contract award amount in USD.
- **Grants.gov opportunity status filter** (`grantStatuses`, `string`): Filter Grants.gov opportunities by status ('forecasted|posted' for open and upcoming grants).
- **Enrich Grants.gov funding ceilings & contacts** (`includeGrantDetails`, `boolean`): Fetch full opportunity details from Grants.gov to attach awardCeilingUsd, awardFloorUsd, estimatedFunding, and grantor contact email/name.
- **Only new records** (`onlyNew`, `boolean`): Deduplicate across runs via Apify Key-Value Store and emit only newly seen contract awards or grant opportunities.
- **Max items per source** (`maxItemsPerSource`, `integer`): Maximum number of records to extract per enabled source (default 35 contracts + 35 grants = 70 records).
- **Delay between requests** (`delaySeconds`, `number`): Polite pause between requests (default `0.25`).

#### Example input

```json
{
  "mode": "both",
  "keywords": [
    "artificial intelligence",
    "cybersecurity"
  ],
  "awardStartDate": "2025-01-01",
  "awardEndDate": "2026-10-25",
  "minAwardAmount": 50000,
  "grantStatuses": "forecasted|posted",
  "includeGrantDetails": true,
  "onlyNew": false,
  "maxItemsPerSource": 35
}
```

### Quickstart: API, Python & Automation (Clay / n8n / Make)

Run directly via the Apify REST API (`POST /v2/acts/informed_almandine_vzb~us-federal-contracts-grants-scraper/runs`) or Python SDK:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("informed_almandine_vzb/us-federal-contracts-grants-scraper").call(run_input={"mode": "both", "keywords": ["artificial intelligence", "cybersecurity"], "awardStartDate": "2025-01-01", "awardEndDate": "2026-10-25", "minAwardAmount": 50000, "grantStatuses": "forecasted|posted", "includeGrantDetails": true, "onlyNew": false, "maxItemsPerSource": 35})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### Output & example output

One dataset row per result. Default table view columns: `recordType, recordId, agencyName, recipientOrEligibility, amountUsd, status, openOrStartDate, closeOrEndDate, titleOrDescription, url`. Full structured JSON is stored in the run's default dataset.

#### Example output item

```json
{
  "recordType": "federal_contract",
  "source": "usaspending.gov",
  "recordId": "W911QX20C0023",
  "internalId": "CONT_AWD_W911QX20C0023_9700_-NONE-_-NONE-",
  "titleOrDescription": "RESEARCH AND DEVELOPMENT EFFORT TO DESIGN AND DEVELOP PROTOTYPES TO ARTIFICIAL INTELLIGENCE/MACHINE LEARNING ALGORITHMS.",
  "recipientOrEligibility": "ECS FEDERAL, LLC",
  "agencyName": "Department of Defense",
  "subAgencyName": "Defense Contract Management Agency",
  "amountUsd": 120492195.74,
  "awardCeilingUsd": 120492195.74,
  "awardFloorUsd": 50000.0,
  "status": "DEFINITIVE CONTRACT",
  "openOrStartDate": "2020-04-23",
  "closeOrEndDate": "2027-03-11",
  "naicsOrAssistanceCode": "541715 - RESEARCH AND DEVELOPMENT IN THE PHYSICAL, ENGINEERING, AND LIFE SCIENCES (EXCEPT NANOTECHNOLOGY AND BIOTECHNOLOGY)",
  "contactEmail": "procurement@usaspending.gov",
  "contactName": "Defense Contract Management Agency Contracting Office",
  "queryMatched": "artificial intelligence",
  "url": "https://www.usaspending.gov/award/CONT_AWD_W911QX20C0023_9700_-NONE-_-NONE-",
  "scrapedAt": "2026-10-25T16:19:48+00:00"
}
```

### Pricing (Pay-Per-Result)

This Actor uses transparent **Pay-Per-Event** pricing with a **`$0.00` actor-start fee**:

| Event | What is charged | Price |
|---|---|---|
| `award-result` | Federal contract award scraped (One US federal contract or IDV award record from USAspending.gov) | **$0.002 / result** (**$2.00 / 1,000 results**) |
| `grant-result` | Federal grant opportunity scraped (One US federal grant opportunity record from Grants.gov) | **$0.0025 / result** (**$2.50 / 1,000 results**) |
| `apify-actor-start` | Actor start fee | **$0.00** |

#### Concrete pricing math

- **`award-result` (Federal contract award scraped):** `1,000 results = $2.00` (`50 results = $0.10`, `10,000 results = $20.00`). Apify's **$5.00/month Free Tier** covers up to **2,500 results/month** at **$0.00** out-of-pocket.
- **`grant-result` (Federal grant opportunity scraped):** `1,000 results = $2.50` (`50 results = $0.12`, `10,000 results = $25.00`). Apify's **$5.00/month Free Tier** covers up to **2,000 results/month** at **$0.00** out-of-pocket.
- **Empty runs (`0` results) & skipped duplicates (`onlyNew` / `onlyChanged`):** **$0.00**.

### Data and compliance

100% public-domain U.S. federal government data accessed via official USAspending.gov (DATA Act) and Grants.gov REST APIs (robots.txt Allow: /). Contains strictly public procurement and grant opportunity data with zero consumer PII. Requests are rate-limited and routed through Apify Proxy. Per-input errors are recorded in the run's `ERRORS` key-value record and are never charged.

### FAQ

**Do I need an account, login, or API key?**\
No. This Actor queries public endpoints directly and requires zero credentials.

**What happens if I start a run with empty `{}` input via API or CLI?**\
Every input defines identical `prefill` and `default` values in `.actor/input_schema.json`, so an empty `{}` run automatically returns **50+ live records** out of the box.

**How does incremental deduplication (`onlyNew`) work?**\
When `onlyNew: true` is enabled, the Actor stores seen record IDs in a named Apify Key-Value Store (`us-federal-contracts-grants-state`) and emits only newly discovered records on subsequent scheduled runs.

**Can I export to CSV, Excel, Google Sheets, Clay, or n8n?**\
Yes. Every dataset item uses flat, normalized top-level keys (`recordType, recordId, agencyName, recipientOrEligibility, amountUsd, status`, etc.) for one-click CSV/Excel download or native webhook delivery.

# Actor input Schema

## `mode` (type: `string`):

Extract US federal contract awards from USAspending.gov ('contracts'), active/forecasted federal grant opportunities from Grants.gov ('grants'), or both in one unified dataset ('both').

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

Keywords matched against federal contract award descriptions (USAspending.gov) and grant titles/synopses (Grants.gov).

## `awardStartDate` (type: `string`):

Start date filter (YYYY-MM-DD) for USAspending.gov federal contract awards.

## `awardEndDate` (type: `string`):

End date filter (YYYY-MM-DD) for USAspending.gov federal contract awards.

## `minAwardAmount` (type: `integer`):

Minimum obligated federal contract award amount in USD.

## `grantStatuses` (type: `string`):

Filter Grants.gov opportunities by status ('forecasted|posted' for open and upcoming grants).

## `includeGrantDetails` (type: `boolean`):

Fetch full opportunity details from Grants.gov to attach awardCeilingUsd, awardFloorUsd, estimatedFunding, and grantor contact email/name.

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

Deduplicate across runs via Apify Key-Value Store and emit only newly seen contract awards or grant opportunities.

## `maxItemsPerSource` (type: `integer`):

Maximum number of records to extract per enabled source (default 35 contracts + 35 grants = 70 records).

## `delaySeconds` (type: `number`):

Polite pause between requests.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings.

## Actor input object example

```json
{
  "mode": "both",
  "keywords": [
    "artificial intelligence",
    "cybersecurity"
  ],
  "awardStartDate": "2025-01-01",
  "awardEndDate": "2026-10-25",
  "minAwardAmount": 50000,
  "grantStatuses": "forecasted|posted",
  "includeGrantDetails": true,
  "onlyNew": false,
  "maxItemsPerSource": 35,
  "delaySeconds": 0.25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (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 = {
    "mode": "both",
    "keywords": [
        "artificial intelligence",
        "cybersecurity"
    ],
    "awardStartDate": "2025-01-01",
    "awardEndDate": "2026-10-25",
    "minAwardAmount": 50000,
    "grantStatuses": "forecasted|posted",
    "includeGrantDetails": true,
    "onlyNew": false,
    "maxItemsPerSource": 35
};

// Run the Actor and wait for it to finish
const run = await client.actor("informed_almandine_vzb/us-federal-contracts-grants-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 = {
    "mode": "both",
    "keywords": [
        "artificial intelligence",
        "cybersecurity",
    ],
    "awardStartDate": "2025-01-01",
    "awardEndDate": "2026-10-25",
    "minAwardAmount": 50000,
    "grantStatuses": "forecasted|posted",
    "includeGrantDetails": True,
    "onlyNew": False,
    "maxItemsPerSource": 35,
}

# Run the Actor and wait for it to finish
run = client.actor("informed_almandine_vzb/us-federal-contracts-grants-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 '{
  "mode": "both",
  "keywords": [
    "artificial intelligence",
    "cybersecurity"
  ],
  "awardStartDate": "2025-01-01",
  "awardEndDate": "2026-10-25",
  "minAwardAmount": 50000,
  "grantStatuses": "forecasted|posted",
  "includeGrantDetails": true,
  "onlyNew": false,
  "maxItemsPerSource": 35
}' |
apify call informed_almandine_vzb/us-federal-contracts-grants-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,informed_almandine_vzb/us-federal-contracts-grants-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/k2DDV9bzI0MEYTzgU/builds/ov8LBE8nRfjbz6m13/openapi.json
