# SAM.gov Contract Opportunities Scraper — Federal Contracts (`jungle_synthesizer/samgov-scraper`) Actor

Federal contract opportunities from SAM.gov: government contracts and bids (solicitations, sources sought, awards) with their bid documents, exclusion records (debarment list), wage determinations, and assistance listings. Filter by keyword, NAICS code, notice type, set-aside, agency, and state.

- **URL**: https://apify.com/jungle_synthesizer/samgov-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Lead generation, Jobs, Automation
- **Stats:** 173 total users, 9 monthly users, 17.6% runs succeeded, 7 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

from $0.80 / 1,000 record scrapeds

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 Contract Opportunities Scraper - Federal Contracts, Exclusions & Grants

Extract federal contract opportunities and government contracts from [SAM.gov](https://sam.gov) (System for Award Management), the U.S. federal government's primary procurement portal, with the bid documents attached to each notice. Covers four data indices that no other scraper combines:

- **Opportunities** -- Contract solicitations, pre-solicitations, combined synopses, sources sought, award notices, and special notices (5.5M+ records)
- **Exclusions** -- Debarment and suspension list for compliance vetting (167K+ records)
- **Wage Determinations** -- Davis-Bacon Act prevailing wage rates by location (107K+ records)
- **Assistance Listings** -- Federal grant and loan programs (7.3K+ programs)

No API key required. Uses the unauthenticated SAM.gov frontend search API.

### Features

- **Live data** -- Every run queries SAM.gov's own search API at the moment it executes; nothing is cached on our side
- **Multi-index coverage** -- Search all four SAM.gov data types from a single actor
- **Rich filtering** -- Keyword search, NAICS codes, opportunity type, set-aside category, agency, state, and active-only toggle
- **Full records** -- Complete description text, contacts, NAICS/PSC codes, place of performance and award details, not just headline fields
- **Bid documents** -- Optionally list every opportunity's attachments (RFQ, SOW, amendments) with permanent download links, or store the files themselves
- **Clean output** -- HTML stripped from descriptions, organization hierarchy flattened to department/agency/office, direct SAM.gov links for every record
- **Fast** -- 100 records in ~2 seconds, 10,000 records in ~5 minutes

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `dataType` | string | `opportunities` | Data index to search: `opportunities`, `exclusions`, `wage_determinations`, or `assistance_listings` |
| `keyword` | string | (empty) | Full-text search across titles and descriptions |
| `naicsCodes` | array | (empty) | NAICS codes; any of them matches (opportunities only) |
| `opportunityType` | string | (empty) | Notice type filter: `o` (Solicitation), `p` (Presolicitation), `k` (Combined), `r` (Sources Sought), `s` (Special Notice), `a` (Award), etc. |
| `setAsideType` | string | (empty) | Small business set-aside: `SBA`, `8A`, `HZC`, `SDVOSBC`, `WOSB`, `EDWOSB`, etc. |
| `activeOnly` | boolean | `true` | Only return active/current records |
| `agency` | string | (empty) | Federal agency name keyword, matched against the organization hierarchy; a department covers every office beneath it |
| `state` | string | (empty) | Place of performance state code(s), e.g. `VA` or `VA,MD` |
| `sortBy` | string | `-modifiedDate` | `-modifiedDate`, or `-relevance` with a keyword. SAM.gov does not order by publish or response date; those choices fall back to modified date |
| `includeAttachments` | boolean | `false` | List each opportunity's attached documents with permanent download links (one extra request per opportunity) |
| `downloadAttachments` | boolean | `false` | Also store each attached file in the run's key-value store and add a `fileUrl`. Implies `includeAttachments` |
| `maxItems` | integer | `100` | Maximum records to return (API cap: 10,000 per query) |

#### Example Input

Search for active cybersecurity solicitations set aside for small businesses:

```json
{
  "dataType": "opportunities",
  "keyword": "cybersecurity",
  "opportunityType": "o",
  "setAsideType": "SBA",
  "activeOnly": true,
  "maxItems": 100
}
```

Track construction and lease solicitations in Virginia with their bid documents:

```json
{
  "dataType": "opportunities",
  "opportunityType": "o",
  "naicsCodes": ["236220", "531120"],
  "state": "VA",
  "includeAttachments": true,
  "maxItems": 200
}
```

Search the exclusion (debarment) list:

```json
{
  "dataType": "exclusions",
  "keyword": "",
  "activeOnly": true,
  "maxItems": 50
}
```

### Output

Every record includes a consistent set of base fields plus type-specific fields.

#### Opportunity Record

```json
{
  "recordType": "opportunity",
  "recordId": "796ebc3cd3f64e858d465bfa43632202",
  "title": "Blast Machine with skid mounts",
  "description": "Procure Blast Machine with skid mounts. See attachment(s).",
  "publishDate": "2026-04-07T23:45:21+00:00",
  "modifiedDate": "2026-04-07T23:45:21+00:00",
  "isActive": true,
  "url": "https://sam.gov/opp/796ebc3cd3f64e858d465bfa43632202/view",
  "department": "DEPT OF DEFENSE",
  "agency": "DEPT OF THE NAVY",
  "office": "NAVSUP FLT LOG CTR YOKOSUKA",
  "solicitationNumber": "N6264926Q0226",
  "opportunityType": "Solicitation",
  "noticeTypeCode": "o",
  "archiveDate": "2026-05-05T00:00:00+00:00",
  "modificationCount": 1,
  "responseDate": "2026-04-20T01:00:00+00:00",
  "responseTimeZone": "Asia/Tokyo",
  "setAside": "",
  "topic_number": "",
  "topic_description": "",
  "naicsCodes": ["811310"],
  "pscCodes": ["4940"],
  "placeOfPerformance": "Yokosuka, JP-14, JPN",
  "contactName": "Yukako Hishikura",
  "contactEmail": "yukako.hishikura.ln@us.navy.mil",
  "contacts": [
    { "name": "Yukako Hishikura", "email": "yukako.hishikura.ln@us.navy.mil", "phone": "", "type": "primary", "title": "" }
  ],
  "attachments": []
}
```

#### Attachments

With `includeAttachments` on, every opportunity carries its attached documents. `url` is a permanent SAM.gov download link that serves the file directly, no login needed; it does not expire. Links to external sites come through with `type: "link"`.

```json
{
  "attachments": [
    {
      "name": "RFQ_19CB6026Q0027- Supply of Vehicle for U.S. Embassy.pdf",
      "type": "file",
      "mimeType": "pdf",
      "sizeBytes": 1545520,
      "resourceId": "eda26a2d26b54f2faaf28ae53c825f93",
      "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/eda26a2d26b54f2faaf28ae53c825f93/download?&token="
    }
  ]
}
```

With `downloadAttachments` on, each file is also stored in the run's default key-value store and the entry gains `fileUrl` (the stored copy) and `kvsKey`. Stored files expire with the run's storage retention.

#### SBIR/STTR Topic Fields

For Small Business Innovation Research (SBIR) and Small Business Technology Transfer (STTR) opportunities, the scraper extracts a topic identifier from the solicitation number or title:

- `topic_number` — The SBIR/STTR topic code (e.g. `A214-013`, `AF252-D012`) for per-topic solicitations, or the BAA cycle code (e.g. `22.4`, `23.D`) for umbrella DoD-wide announcements. Empty for non-SBIR/STTR opportunities.
- `topic_description` — The opportunity title for per-topic solicitations (where the title is the topic description). Empty for umbrella cycle BAAs and non-SBIR/STTR opportunities.

Example AFWERX/Army SBIR opportunity:

```json
{
  "title": "Behavioristic Electromagnetic Spectrum Assessment General Learning Engine (BEAGLE)",
  "solicitationNumber": "W50RAJ-20-S-0001_SBIR_BAA_A214-013",
  "topic_number": "A214-013",
  "topic_description": "Behavioristic Electromagnetic Spectrum Assessment General Learning Engine (BEAGLE)"
}
```

To filter results to only SBIR/STTR opportunities, search with `keyword: "SBIR"` or `keyword: "STTR"` and post-filter on a non-empty `topic_number`.

#### Exclusion Record

```json
{
  "recordType": "exclusion",
  "recordId": "50e916de-6242-4f0c-b7a5-07356c6e8cd5",
  "title": "Jose Aleman-Sandoval",
  "isActive": true,
  "url": "https://sam.gov/exclusions-new?id=50e916de-6242-4f0c-b7a5-07356c6e8cd5",
  "excludingAgency": "JUSTICE, DEPARTMENT OF",
  "exclusionProgram": "Reciprocal",
  "exclusionType": "Ineligible (Proceedings Complete)",
  "classification": "Individual",
  "activationDate": "2026-03-31",
  "terminationDate": "2027-03-30",
  "address": "Houston, TX, 77081, USA"
}
```

#### Wage Determination Record

```json
{
  "recordType": "wage_determination",
  "recordId": "AZ20260022",
  "title": "AZ20260022",
  "referenceNumber": "AZ20260022",
  "revisionNumber": 1,
  "constructionTypes": ["Building"],
  "location": "Arizona - Apache",
  "isActive": true,
  "url": "https://sam.gov/wage-determination/AZ20260022/view"
}
```

#### Assistance Listing Record

```json
{
  "recordType": "assistance_listing",
  "recordId": "4339444d695d45d68142db2bddcf93fd",
  "title": "Tenant Education and Outreach Program",
  "programNumber": "14.322",
  "objective": "The purpose of the TEO Program is to support tenant capacity building...",
  "assistanceTypes": ["Grant"],
  "department": "HOUSING AND URBAN DEVELOPMENT, DEPARTMENT OF",
  "agency": "ASST SECRETARY FOR HOUSING--FEDERAL HOUSING COMMISSIONER",
  "isFunded": false,
  "url": "https://sam.gov/fal/4339444d695d45d68142db2bddcf93fd/view"
}
```

### Limitations

- The SAM.gov API caps results at **10,000 records per query**. For larger datasets, use narrower keyword or date filters and run multiple times.
- Entity registration data (the `ent` index) requires session authentication and is not supported.
- SAM.gov orders results by modified date (or relevance with a keyword) only. To keep a feed current, run on a schedule with `activeOnly` on and de-duplicate on `recordId`.
- Attachments exist for opportunities only; exclusions, wage determinations and assistance listings have none.

### Use Cases

- **Government contractors** monitoring new opportunities matching their NAICS codes
- **Compliance teams** checking the exclusion list before awarding subcontracts
- **Business development** teams tracking agency spending patterns
- **Construction firms** looking up prevailing wage rates by location
- **Grant seekers** finding federal assistance programs in their domain

***

**Further reading:** [How to Get Government Tender Data From 14 Procurement Portals](https://orbtop.com/articles/government-tender-data-portals/)

# Actor input Schema

## `sp_intended_usage` (type: `string`):

What will this data feed? E.g. lead lists, KYB checks, price tracking.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

We'll personally help with your use case. No spam.

## `dataType` (type: `string`):

Type of SAM.gov data to search. Opportunities = contract solicitations. Exclusions = debarment/suspension list. Wage Determinations = Davis-Bacon prevailing wages. Assistance Listings = federal grant programs.

## `keyword` (type: `string`):

Search term to find in titles and descriptions (e.g., 'cybersecurity', 'construction', 'IT services'). Leave empty to return all records.

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

NAICS industry codes to filter by (opportunities only, any of them matches). Common: 541511 (Custom Programming), 541512 (Systems Design), 236220 (Commercial Construction), 531120 (Lessors of Nonresidential Buildings).

## `opportunityType` (type: `string`):

Filter by notice type (opportunities only). Leave empty for all types.

## `setAsideType` (type: `string`):

Filter by small business set-aside category (opportunities only). Leave empty for all.

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

Only return active/current records. Disable to include archived and expired records.

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

Filter by agency name keyword (e.g., 'DEFENSE', 'HEALTH AND HUMAN SERVICES'). Matched against the federal organization hierarchy; a department keyword covers every office beneath it. Opportunities only.

## `state` (type: `string`):

Filter by place of performance state code (e.g., 'VA', 'CA', 'TX'). Opportunities only.

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

How to sort results. SAM.gov only orders by modified date, or by relevance when a keyword is set; the other choices fall back to modified date.

## `includeAttachments` (type: `boolean`):

List each opportunity's attached documents (RFQ, SOW, amendments): file name, type, size and a permanent SAM.gov download link. One extra request per opportunity. An opportunity that carries attachments is billed as one premium record instead of a standard record.

## `downloadAttachments` (type: `boolean`):

Also store each attached file in the run's key-value store and add a fileUrl for it. Implies Include Attachments. Each stored file is billed as one premium record.

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

Maximum number of records to return. The SAM.gov API caps at 10,000 per query. For larger datasets, use narrower keyword/date filters.

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "dataType": "opportunities",
  "activeOnly": true,
  "sortBy": "-modifiedDate",
  "includeAttachments": false,
  "downloadAttachments": false,
  "maxItems": 100
}
```

# 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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "dataType": "opportunities",
    "keyword": "",
    "opportunityType": "",
    "setAsideType": "",
    "agency": "",
    "state": "",
    "sortBy": "-modifiedDate",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/samgov-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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "dataType": "opportunities",
    "keyword": "",
    "opportunityType": "",
    "setAsideType": "",
    "agency": "",
    "state": "",
    "sortBy": "-modifiedDate",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/samgov-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 '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "dataType": "opportunities",
  "keyword": "",
  "opportunityType": "",
  "setAsideType": "",
  "agency": "",
  "state": "",
  "sortBy": "-modifiedDate",
  "maxItems": 100
}' |
apify call jungle_synthesizer/samgov-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jungle_synthesizer/samgov-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/TLFaWLTXTVgf9kAUV/builds/0rziOGDcg3rbVPMnZ/openapi.json
