# Government Contract Data & Federal Bids — SAM.gov Scraper (`jungle_synthesizer/samgov-scraper`) Actor

Government contract data from SAM.gov: federal contract opportunities and bids, exclusion records (debarment list), wage determinations, and assistance listings. Filter by keyword, NAICS code, opportunity type, set-aside category, 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:** 155 total users, 6 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: 1.00 out of 5 stars

## 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## SAM.gov Scraper - Federal Contracts, Exclusions & Grants

Extract data from [SAM.gov](https://sam.gov) (System for Award Management), the U.S. federal government's primary procurement portal. 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

- **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
- **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` | string | (empty) | Comma-separated NAICS codes (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) | Filter by federal agency name keyword |
| `state` | string | (empty) | Filter by place of performance state code (e.g., `VA`, `CA`) |
| `sortBy` | string | `-modifiedDate` | Sort order: `-modifiedDate`, `-publishDate`, `-responseDate`, `-relevance` |
| `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
}
```

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",
  "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"
}
```

#### 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.
- The `sfm` filters (opportunity type, set-aside, state) affect result ordering but may not reduce the `totalElements` count in the API response metadata.

### 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). Common: 541511 (Custom Programming), 541512 (Systems Design), 236220 (Commercial Construction), 541330 (Engineering Services).

## `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'). Searches the organization hierarchy.

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

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

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

How to sort results.

## `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",
  "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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/samgov-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TLFaWLTXTVgf9kAUV/builds/EK0tgbzwI2c2k273i/openapi.json
