# US Federal Contracts & Grants Scraper — SAM.gov & Grants.gov (`memo23/us-sam-grants-scraper`) Actor

Scrape US federal government contracting opportunities and federal funding grants from SAM.gov and Grants.gov. Search by keyword, agency, opportunity type, and date — get clean, structured JSON/CSV with award values, ceilings, deadlines, and direct links.

- **URL**: https://apify.com/memo23/us-sam-grants-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Features:** Limited permissions
- **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/actors/running/actors-in-store.md#pay-per-usage

## 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 — SAM.gov & Grants.gov

Scrape US federal contracting opportunities and federal grants in one unified pipeline from **SAM.gov** and **Grants.gov**.

Search by keywords across government agencies, solicitations, contract awards, and research grants. Extract clean, structured JSON, CSV, and Excel datasets with contract values, NAICS / CFDA codes, point-of-contact emails, deadlines, and direct links.

***

### What does this scraper cover?

1. **SAM.gov (System for Award Management):**
   - Federal contract opportunities, pre-solicitations, solicitations (RFPs/RFIs/RFQs), sources sought, and contract awards across all US federal departments (DoD, GSA, DHS, VA, HHS, etc.).
2. **Grants.gov (Federal Financial Assistance):**
   - Federal grant opportunities, notices of funding opportunity (NOFO), and discretionary funding across 26 federal grant-making agencies.

***

### Key Features

- **Unified Schema:** Contracts and grants normalized into a single standardized schema.
- **Source Selection:** Choose between `all` (contracts + grants), `contracts_sam` only, or `grants_gov` only.
- **Contact Details:** Automatically extracts buyer and contracting officer names, emails, and phone numbers.
- **Funding & Deadlines:** Response dates, estimated values, award ceilings/floors, and performance locations.
- **Direct Notice URLs:** One-click links directly into SAM.gov and Grants.gov detail pages.
- **Official Open APIs:** Ultra-fast, lightweight HTTP requests with no browser overhead.

***

### Input Options

| Field | Type | Description | Default |
| :--- | :--- | :--- | :--- |
| `keywords` | String | Keyword(s) matching title, solicitation, or description. | `""` |
| `source` | Select | `all`, `contracts_sam`, or `grants_gov`. | `"all"` |
| `activeOnly` | Boolean | Only retrieve active / currently open opportunities. | `true` |
| `maxItems` | Integer | Max items to scrape (0 for unlimited). | `500` |
| `flatten` | Boolean | Flatten nested objects for spreadsheet export. | `true` |

***

### Sample Output

```json
{
  "id": "692acb24d2bfdcabbf99433838defec5",
  "source": "sam_gov",
  "type": "contract",
  "title": "Cloud Computing Infrastructure Support",
  "solicitationNumber": "SOL-2026-001",
  "description": "The agency requires secure cloud hosting services and professional migration...",
  "status": "active",
  "agency": "GENERAL SERVICES ADMINISTRATION",
  "subAgency": "FEDERAL ACQUISITION SERVICE",
  "postedDate": "2026-11-20T10:00:00Z",
  "responseDate": "2026-12-20T17:00:00Z",
  "archiveDate": null,
  "estimatedFunding": 1500000,
  "awardCeiling": null,
  "awardFloor": null,
  "currency": "USD",
  "contactName": "Dennis D. Harrison",
  "contactEmail": "dennis.harrison@gsa.gov",
  "contactPhone": "2022159767",
  "naicsCode": "541519",
  "naicsDescription": "Other Computer Related Services",
  "cfdaList": [],
  "noticeUrl": "https://sam.gov/opp/692acb24d2bfdcabbf99433838defec5/view",
  "placeOfPerformance": "Washington, DC, USA"
}
```

***

### Use Cases

- **US Federal Contracting Lead Gen:** Find contracts fitting your NAICS code before competitors.
- **Grant Discovery:** Search for active federal funding for non-profits, academic institutions, and businesses.
- **Sales & GovCon Intelligence:** Track buyer agencies and contracting officer contacts.
- **CRM Integration:** Stream federal leads automatically into HubSpot, Salesforce, or Slack channels via Webhooks.

# Actor input Schema

## `keywords` (type: `string`):

Keyword(s) to match title, description, or requirements. Example: "artificial intelligence", "cybersecurity", "medical research".

## `source` (type: `string`):

Choose which federal database to scrape: Contracts (SAM.gov), Grants (Grants.gov), or both.

## `activeOnly` (type: `boolean`):

If enabled, only fetches opportunities currently open for responses/proposals.

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

Maximum number of opportunities to return. Set to 0 for unlimited.

## `flatten` (type: `boolean`):

Flatten nested objects into top-level columns for spreadsheet and table export.

## Actor input object example

```json
{
  "keywords": "",
  "source": "all",
  "activeOnly": true,
  "maxItems": 500,
  "flatten": true
}
```

# Actor output Schema

## `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 = {
    "keywords": "",
    "source": "all"
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/us-sam-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 = {
    "keywords": "",
    "source": "all",
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/us-sam-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 '{
  "keywords": "",
  "source": "all"
}' |
apify call memo23/us-sam-grants-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/us-sam-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/Y68c5rp4QoEZtZZCQ/builds/ggKC1Ydh6d1W1BXI7/openapi.json
