# SAM.gov Federal Contract Opportunities Scraper (`scrapers_lat/sam-gov-opportunities-scraper`) Actor

Scrape US federal contract opportunities from SAM.gov across all agencies. Extract title, notice type, NAICS code, set-aside, solicitation number, response deadline, place of performance, award and point of contact. Export JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers\_lat/sam-gov-opportunities-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** Business, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 93.1% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $9.23 / 1,000 results

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/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 Federal Contract Opportunities Scraper](https://scrapers.lat/banners/sam-gov-opportunities-scraper.png)](https://console.apify.com/actors/gofbmUlpirrL9uB5k/input)

## SAM.gov Federal Contract Opportunities Scraper

> Extract US federal contract opportunities and solicitations from SAM.gov (the system that replaced FedBizOpps), across all federal agencies and 47,000+ active notices.

**📥 [Input](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-US%20Federal-blue)
![Maintained](https://img.shields.io/badge/Maintained-Yes-brightgreen)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)

<table><tr>
<td align="center"><strong>24 fields</strong><br>+ document links</td>
<td align="center"><strong>US Federal</strong><br>all agencies</td>
<td align="center"><strong>JSON / CSV / Excel</strong><br>output formats</td>
</tr></table>

<br>

### Who is it for

| Use case | Who benefits |
|---|---|
| Find open bids to respond to | Government contractors and bid teams |
| Build a pipeline of agency requirements | Business development and capture managers |
| Monitor competitors and award winners | Market intelligence and pricing analysts |
| Source set-aside opportunities | Small, 8(a), HUBZone, SDVOSB and WOSB firms |
| Feed a CRM or alerting workflow | GovCon software and data vendors |

### Frequently Asked Questions

**What does the SAM.gov opportunities scraper cover?**\
It covers US federal contract opportunities posted on SAM.gov, the official system that replaced FedBizOpps. That includes solicitations, combined synopsis/solicitations, presolicitations, sources sought, special notices and award notices from every federal department and agency, with more than 47,000 active notices at any time.

**Do I need a SAM.gov API key?**\
No. The scraper reads the same public data service that powers the SAM.gov search interface, so no API key, account or registration is required.

**How many opportunities can I scrape in one run?**\
Set the Max Items input to whatever you need. You can pull a handful of recent notices or thousands across a date range. Use the search term, NAICS, set-aside, notice type and posted date filters to target exactly the opportunities you want.

**Can I filter by NAICS code, set-aside or agency?**\
Yes. You can filter by free-text keyword, six-digit NAICS code, set-aside program, notice type and a posted/updated date window. Leave filters blank to get the most recently updated notices across all agencies.

**Why are NAICS, place of performance or description sometimes empty?**\
Some notice types, especially award notices and simplified repair notices, do not carry a NAICS code, place of performance or full description on SAM.gov. The scraper returns every field the notice actually has and leaves the rest null rather than inventing data. Enable Fetch opportunity details to pull the richest possible record for each notice, including the point-of-contact emails and phone numbers, place of performance, full description and direct links to every downloadable solicitation document (statement of work, RFQ/RFP, drawings, amendments and Q\&A).

### Example use cases

Ready-to-run example tasks, each preconfigured for a common scenario. Open one and press run, or use it as a template:

- [SAM.gov Aircraft Parts Contract Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-aircraft-parts-contracts): Scrape federal aircraft and aviation parts contract opportunities from SAM.gov with NAICS, set-aside, deadlines, award and contact data.
- [SAM.gov Cloud Computing Contract Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-cloud-computing-contracts): Scrape federal cloud computing contract opportunities from SAM.gov with NAICS codes, set-aside, response deadlines and points of contact.
- [SAM.gov HVAC Maintenance Contract Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-hvac-maintenance-contracts): Scrape federal HVAC maintenance and repair contract opportunities from SAM.gov with NAICS, set-aside, deadlines and points of contact.
- [SAM.gov IT Staffing Contract Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-it-staffing-contracts): Scrape federal IT staffing contract opportunities from SAM.gov with NAICS codes, set-aside, response deadlines and points of contact.
- [SAM.gov Janitorial Services Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-janitorial-services-opportunities): Scrape federal janitorial and custodial services opportunities from SAM.gov with set-aside, deadlines, place of performance and contacts.
- [SAM.gov Medical Supplies Contract Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-medical-supplies-contracts): Scrape federal medical supplies contract opportunities from SAM.gov with NAICS, set-aside, deadlines, award data and contacts.
- [SAM.gov Security Guard Services Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-security-guard-services-contracts): Scrape federal security guard and protective services opportunities from SAM.gov with set-aside, deadlines, place of performance and contacts.
- [SAM.gov Construction Opportunities](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-construction-opportunities): SAM.gov Construction Opportunities
- [SAM.gov Cybersecurity Contracts](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-cybersecurity-contracts): SAM.gov Cybersecurity Contracts
- [SAM.gov Software Contracts](https://apify.com/scrapers_lat/sam-gov-opportunities-scraper/examples/sam-gov-software-contracts): SAM.gov Software Contracts

### Export, API and AI agents (x402 + MCP)

Export the scraped data to **JSON, CSV or Excel**, pull it as a **dataset** through the Apify **API**, or wire it into your app with **no code**. This web scraper and data extractor also works for bulk data extraction and scheduled runs.

For AI agents: this Actor is available on **x402**, Apify's agentic payment standard built with Coinbase. An AI agent can discover, pay for and run it on its own with a funded wallet and a single HTTP request: no account, no subscription, no API key and no human in the loop. It also runs as an **MCP** tool inside Claude, Cursor and other AI clients out of the box. Learn more about [x402 agentic payments on Apify](https://docs.apify.com/platform/integrations/x402).

### Related scrapers

Need data from the same space? Here are other scrapers we build and maintain:

- [USAspending Federal Award Scraper](https://apify.com/scrapers_lat/usaspending-awards-scraper): every US federal prime award with recipient, amount and agency.
- [USAspending Sub-Award Scraper](https://apify.com/scrapers_lat/usaspending-subawards-scraper): federal sub-awards and the subcontractors behind prime contracts.
- [Grants.gov Opportunity Scraper](https://apify.com/scrapers_lat/grants-gov-scraper): federal grant funding opportunities by agency, CFDA and status.
- [SEC EDGAR Company Filings Scraper](https://apify.com/scrapers_lat/sec-edgar-filings-scraper): SEC filings and documents for any US public company.
- [New York Business Entity Scraper](https://apify.com/scrapers_lat/ny-dos-business-scraper): New York company registrations, status, type and registered agent.
- [OFAC Sanctions List Scraper](https://apify.com/scrapers_lat/ofac-sanctions-scraper): US Treasury OFAC sanctioned individuals and entities for vendor screening.

### More scrapers at scrapers.lat

This actor is built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for Latin American and US public platforms: real estate, jobs, e-commerce, company registries and government data. Browse the full catalog, see live sample output for each one, or ask us for a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> This actor is an independent tool and has no affiliation with SAM.gov or the US General Services Administration. It only accesses data that is publicly available on the platform. Use it in accordance with SAM.gov's terms of service.

# Actor input Schema

## `maxOpportunities` (type: `integer`):

Maximum number of opportunities to collect. Optional.

## `withDetails` (type: `boolean`):

When enabled, the scraper opens each notice to add NAICS, classification code, set-aside, response deadline, archive date, award amount, point of contact, place of performance, the full description and downloadable solicitation documents (SOW, RFQ/RFP, drawings, Q\&A) with direct file links.

## `searchTerm` (type: `string`):

Free-text keyword searched across notice title and content (for example: cybersecurity, janitorial, ambulance, software).

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

Types of notice to include. Leave empty to include every type.

## `naics` (type: `string`):

Six-digit NAICS industry code to filter by (for example: 541511 for custom computer programming).

## `setAside` (type: `string`):

Restrict to a small-business or socio-economic set-aside program.

## `postedFrom` (type: `string`):

Earliest updated/posted date (MM/DD/YYYY or YYYY-MM-DD). Filters by the date a notice was last published or updated on SAM.gov.

## `postedTo` (type: `string`):

Latest updated/posted date (MM/DD/YYYY or YYYY-MM-DD).

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

When enabled, only currently active (not archived) notices are returned. Disable to include archived and award notices.

## Actor input object example

```json
{
  "maxOpportunities": 10,
  "withDetails": true,
  "searchTerm": "software",
  "setAside": "",
  "activeOnly": 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 = {
    "maxOpportunities": 10,
    "searchTerm": "software"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/sam-gov-opportunities-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 = {
    "maxOpportunities": 10,
    "searchTerm": "software",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/sam-gov-opportunities-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 '{
  "maxOpportunities": 10,
  "searchTerm": "software"
}' |
apify call scrapers_lat/sam-gov-opportunities-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapers_lat/sam-gov-opportunities-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/gofbmUlpirrL9uB5k/builds/tcgBqVtZhlgkdd9ep/openapi.json
