# SAM.gov Scraper: Federal Contracts, RFPs & USAspending Awards (`actorfactory/us-federal-contracts`) Actor

SAM.gov scraper for open US federal contract opportunities (RFPs, solicitations, Sources Sought) from SAM.gov's official public data extract, plus past contract awards from the USAspending API. Filter by keyword, NAICS, PSC, agency, set-aside and dates. No login, no API key.

- **URL**: https://apify.com/actorfactory/us-federal-contracts.md
- **Developed by:** [Actor Factory](https://apify.com/actorfactory) (community)
- **Categories:** Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 opportunities

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

## SAM.gov Scraper: Federal Contracts, RFPs & USAspending Awards

This **SAM.gov scraper** searches **open US federal contract opportunities** (solicitations, **RFPs**, **Sources Sought**, presolicitations) from **SAM.gov** and **past federal contract awards** from **USAspending.gov**, in one actor. Filter by keyword, NAICS, PSC, agency, set-aside, notice type, deadlines, recipient and amount. No login and no API key needed.

**Official public endpoints, no page scraping:** opportunities come from SAM.gov's official public data extract (the daily Contract Opportunities file linked from sam.gov/data-services) or, optionally, from the official SAM.gov Get Opportunities Public API with your own key. Awards come from the official USAspending.gov API. The actor does not scrape sam.gov web pages or its internal search. Get clean JSON, CSV or Excel for GovCon bid pipelines, competitor tracking and market research.

### What federal contract data you get

**Opportunities (`mode: opportunities`)**

| Field | Description |
|---|---|
| `notice_id`, `solicitation_number`, `title`, `notice_type` | Identifiers and type of the notice |
| `department`, `sub_tier`, `office` | Issuing agency hierarchy |
| `naics_code`, `naics_codes`, `psc_code`, `set_aside` | Classification and small-business set-aside |
| `posted_date`, `modified_date`, `response_deadline` | Key dates |
| `place_of_performance` | Where the work is done |
| `award_amount`, `awardee`, `award_date` | Filled on award notices |
| `description` | Notice text, capped at 5,000 characters (empty in API-key mode) |
| `contacts` | Contracting office contacts as published (name, email, phone) |

Fields the source does not provide are `null`: `modified_date` is always null (neither the extract nor the API has it), `naics_codes` holds only the single primary NAICS code, and the place of performance is a short "city, state, zip, country" string. `posted_date` from the extract has no time zone. In API-key mode, `description` is null.
| `url`, `scraped_at` | Link to the notice and collection time |

**Awards (`mode: awards`)**

| Field | Description |
|---|---|
| `award_id`, `contract_award_type` | Award/PIID number and type |
| `recipient_name`, `recipient_uei` | Winning company |
| `amount`, `start_date`, `end_date` | Value and period |
| `awarding_agency`, `awarding_sub_agency`, `funding_agency` | Agencies |
| `naics_code`, `naics_description`, `psc_code`, `psc_description` | Classification |
| `place_of_performance_state`, `description`, `last_modified` | Details |
| `url`, `scraped_at` | Link to the award on USAspending and collection time |

Every item has a `record_type` of `opportunity` or `award`.

### How to search SAM.gov opportunities and awards

| Input | Description |
|---|---|
| `mode` | `opportunities` or `awards` |
| `keywords` | Words to search; each is searched separately and results are merged |
| `naicsCodes`, `pscCodes` | Industry and product/service codes |
| `agency` | Opportunities: part of an agency name (for example `NAVY`). Awards: exact top-tier name (for example `Department of Defense`) |
| `noticeTypes`, `setAsides`, `postedWithinDays`, `responseDeadlineFrom`, `responseDeadlineTo`, `includeArchived` | Opportunity filters (active notices only unless `includeArchived`) |
| `recipient`, `awardTypes`, `awardStartDate`, `awardEndDate`, `minAmount`, `maxAmount`, `sortBy` | Award filters |
| `samApiKey` | Optional, secret. Your own SAM.gov API key switches opportunities to the official Get Opportunities Public API |
| `maxItems` | Result cap (you are charged per result saved) |

```json
{
  "mode": "opportunities",
  "keywords": ["cybersecurity"],
  "naicsCodes": ["541512"],
  "setAsides": ["SBA"],
  "responseDeadlineFrom": "2026-12-01",
  "maxItems": 50
}
```

### Output example

```json
{
  "record_type": "opportunity",
  "notice_id": "63148e71a2124bec9e4fa5bc594d0b22",
  "title": "Brand Name Only for AMD/XILINX Full and Open Competition",
  "solicitation_number": "N0017327Q1301424824a",
  "notice_type": "Combined Synopsis/Solicitation",
  "department": "DEPT OF DEFENSE",
  "sub_tier": "DEPT OF THE NAVY",
  "office": "NAVAL RESEARCH LABORATORY",
  "naics_code": "513210",
  "psc_code": "7A20",
  "set_aside": null,
  "posted_date": "2026-11-13T15:55:59",
  "response_deadline": "2026-11-19T15:00:00-05:00",
  "place_of_performance": "Washington, DC, 20375, USA",
  "contacts": [{ "type": "primary", "name": "Carrie Cawley", "email": "carrie.a.cawley.civ@us.navy.mil", "phone": null, "title": null }],
  "url": "https://sam.gov/opp/63148e71a2124bec9e4fa5bc594d0b22/view",
  "scraped_at": "2026-11-14T16:37:20.398Z"
}
```

### How much does it cost to search federal contracts?

Pay per result: **$3.00 per 1,000 opportunities** and **$2.00 per 1,000 awards**, plus a tiny start fee. Reading the daily extract costs us well under one cent per run even when the whole 222 MB file is scanned, so there is no extra scan fee. Volume tiers on the Apify platform lower the price by 10%, 20% and 30%. Example: 500 open bids for a NAICS code cost about $1.50.

### Use cases

- Build a daily bid pipeline for a government contracting business.
- Find incumbents and contract values before writing a proposal.
- Track competitors' wins by recipient name.
- Market sizing by NAICS, agency and year.

### Limits & notes

- Opportunities come from SAM.gov's official public data extract, refreshed daily around 04:30 UTC, so new notices appear with up to a day's delay. The file (about 222 MB, newest notices first) is streamed and filtered on the fly; a run with `postedWithinDays` or a small `maxItems` stops early, and a full scan takes a few seconds to a minute. The extract has no modified date and no multiple NAICS codes. Attachments are not downloaded.
- Keywords match the title and description, case-insensitively. NAICS codes match by prefix.
- With your own `samApiKey` the actor calls the official Get Opportunities Public API (api.sam.gov) instead, within the last `postedWithinDays` days (default 30, max 364). Non-federal API keys have low daily request limits (check your SAM.gov account), so keep searches narrow. The key is only sent to api.sam.gov.
- Awards cover contracts (definitive contracts, purchase orders, delivery orders, BPA calls) from 2007-10-01 on.
- `postedWithinDays` is the efficient way to get fresh notices.
- Contacts are the contracting officers' published business contacts only.
- Requests are paced to stay polite to the sources. The data is public federal data.

### Integrations and API

Run it from your own code with the [Apify API](https://docs.apify.com/api/v2) or the official Python and JavaScript clients:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("actorfactory/us-federal-contracts").call(run_input={'mode': 'opportunities', 'keywords': ['software'], 'maxItems': 10})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

- **Schedule it** (hourly, daily, weekly) in Apify Console and send results to Google Sheets, Slack, email or a webhook, or connect it to Make, Zapier or n8n.
- **Use it from AI agents** (Claude, ChatGPT, Cursor) through the [Apify MCP server](https://mcp.apify.com).
- **Export** results as JSON, CSV, Excel or HTML from the Output tab, or read them from the dataset API.

### Related Actors

- [EU & UK Tenders Scraper](https://apify.com/actorfactory/public-tenders): EU (TED) and UK public tenders in one format
- [UK Companies House Scraper](https://apify.com/actorfactory/companies-house): UK company register: new companies, search, filings

### FAQ

**Is this a SAM.gov scraper?** It does the job of one, but it does not scrape sam.gov web pages: opportunities (RFPs, Sources Sought and other notice types) come from SAM.gov's official public data extract or the official Get Opportunities Public API, and awards from the USAspending API.

**Do I need a SAM.gov API key?** No. The default reads SAM.gov's official public data extract. A key is optional and only sent to api.sam.gov; the description text is not included in that mode.

**Why no results?** Check spelling, remove filters, or widen the date range.

**Can I get new SAM.gov opportunities every day?** Yes. In opportunities mode set `postedWithinDays` to 1, add your NAICS codes or keywords, and schedule a daily run.

**Can I see who won a federal contract?** Yes. Awards mode returns past awards from USAspending.gov with the winning company (`recipient_name`, `recipient_uei`), amount and agency. Filter by `recipient` to track a competitor's wins.

# Actor input Schema

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

"opportunities" = open federal solicitations from SAM.gov's official public data extract (bids, RFPs, sources sought). "awards" = past contract awards from USAspending.gov (who won what, for how much).

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

Search words or phrases, matched in the title and description (extract) or title (API key mode). Each keyword is OR-matched; results have no duplicates. Example: \["cybersecurity", "cloud migration"]. Leave empty to use only the other filters.

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

Industry codes (2-6 digits). Example: \["541512", "541519"].

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

Federal product/service codes. Example: \["D302", "R499"].

## `agency` (type: `string`):

Opportunities: part of the department, sub-tier or office name, e.g. "NAVY" or "VETERANS". Awards: the exact top-tier agency name, e.g. "Department of Defense".

## `noticeTypes` (type: `array`):

Only these notice types. Empty = all active notices.

## `setAsides` (type: `array`):

Small-business set-aside codes. SBA = Small Business, 8A = 8(a), HZC = HUBZone, SDVOSBC = Service-Disabled Veteran-Owned, WOSB = Women-Owned, EDWOSB = Economically Disadvantaged WOSB, VSA = Veteran-Owned.

## `responseDeadlineFrom` (type: `string`):

Earliest response deadline, YYYY-MM-DD. Use today's date to skip expired notices.

## `responseDeadlineTo` (type: `string`):

Latest response deadline, YYYY-MM-DD.

## `postedWithinDays` (type: `integer`):

Only notices posted in the last N days. Example: 7. Makes the run much faster because the extract is sorted newest first and the scan stops early.

## `includeArchived` (type: `boolean`):

By default only active notices are returned. Turn on to include archived (closed) notices too.

## `samApiKey` (type: `string`):

Optional. Your own SAM.gov API key. Without it the actor reads SAM.gov's official public data extract (no key needed). With a key it uses the official Get Opportunities Public API instead (no description text; non-federal keys have low daily request limits). Never shared or logged.

## `recipient` (type: `string`):

Company name to search among award recipients. Example: "Booz Allen Hamilton".

## `awardTypes` (type: `array`):

Contract award types. Empty = all four.

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

YYYY-MM-DD. Default: one year ago. Earliest possible: 2007-10-01.

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

YYYY-MM-DD. Default: today.

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

Only awards of at least this many US dollars.

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

Only awards of at most this many US dollars.

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

Order of awards: largest amount first, or newest start date first.

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

Stop after this many results. You are charged per result saved.

## Actor input object example

```json
{
  "mode": "opportunities",
  "keywords": [
    "software"
  ],
  "includeArchived": false,
  "sortBy": "amount",
  "maxItems": 10
}
```

# Actor output Schema

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

The scraped items in the default dataset.

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

Dataset items shown in the 'Awards' view.

## `summary` (type: `string`):

Counts, stop reason and non-fatal errors for this run (OUTPUT record).

# 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": "opportunities",
    "keywords": [
        "software"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("actorfactory/us-federal-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 = {
    "mode": "opportunities",
    "keywords": ["software"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("actorfactory/us-federal-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 '{
  "mode": "opportunities",
  "keywords": [
    "software"
  ],
  "maxItems": 10
}' |
apify call actorfactory/us-federal-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actorfactory/us-federal-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/89NMG8LgjfPUT6ahQ/builds/dWsk2OGLG4TTqP9du/openapi.json
