# SAM.gov Federal Contract Opportunities Tracker (`straightforward_hydra/sam-gov-opportunities-tracker`) Actor

Find US federal contract opportunities to bid on, from SAM.gov. Filter by keywords, NAICS, agency, state and set-aside; get clean structured results with deadlines and contacts.

- **URL**: https://apify.com/straightforward\_hydra/sam-gov-opportunities-tracker.md
- **Developed by:** [Dev D](https://apify.com/straightforward_hydra) (community)
- **Categories:** Developer tools, Lead generation, SEO tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Tracker 🇺🇸

**Find US federal contracts to bid on — straight from SAM.gov, filtered to exactly what your business does.**

Every federal contract opportunity — solicitations, presolicitations, sources-sought notices — is posted on **SAM.gov**. This Actor searches them by keyword, NAICS industry code, agency, state and set-aside, and returns clean, structured records with deadlines and contacts. Point it at what you sell, run it on a schedule, and never miss a bid.

> Data comes from SAM.gov's official public API. Public procurement data — clean liability profile.

---

### What you can do with it

- 🎯 **Never miss a bid** — monitor new opportunities in your industry the day they post.
- 🏢 **Feed a GovCon CRM / pipeline** — structured opportunities with agency, deadline, contact.
- 🔔 **Set-aside alerts** — track 8(a), WOSB, SDVOSB, HUBZone, Total Small Business set-asides.
- 📊 **Market research** — what agencies are buying, in which NAICS, in which states.
- 🤝 **Teaming & capture** — spot sources-sought early to position before the solicitation drops.

### Features

- ✅ **Powerful filtering** — keywords, NAICS codes, agency, state, set-aside, notice type.
- ✅ **Clean structured output** — title, agency, deadline, NAICS, set-aside, place of performance, point of contact, direct SAM.gov link.
- ✅ **Active-only by default** — focus on opportunities still open for response.
- ✅ **Schedule-friendly** — small lookback window for a daily new-opportunities feed.
- ✅ **Low-maintenance** — official REST/JSON API, no scraping, no browser.

---

### 🔑 Getting your free SAM.gov API key (required)

SAM.gov requires a free API key tied to your account:

1. Go to **sam.gov** and sign in (create a free account if needed).
2. Open **Account Details** (top-right profile menu).
3. Scroll to **API Key** and generate / copy it.
4. Paste it into the **SAM.gov API key** field of this Actor.

Your key is only ever sent to `api.sam.gov`. Note: SAM.gov rate-limits keys by account role (personal keys have a daily request quota).

### Input

| Field | Description |
|---|---|
| **SAM.gov API key** | Your free key (required). |
| **Keywords** | Title search, e.g. `cybersecurity`, `janitorial services`. |
| **Notice types** | Solicitation, Combined, Presolicitation, Sources Sought, etc. |
| **NAICS codes** | Industry codes, e.g. `541512`. |
| **Place of performance state** | Two-letter state code, e.g. `VA`. |
| **Set-aside code** | e.g. `SBA`, `8A`, `WOSB`, `SDVOSBC`, `HZC`. |
| **Agency / organization name** | e.g. `General Services Administration`. |
| **Lookback days** | Days back by posted date (1–365). |
| **Active opportunities only** | Only currently-open notices. |
| **Max results** | Cap the number of results. |

#### Example — open small-business IT solicitations, last 14 days

```json
{
  "apiKey": "YOUR_SAM_GOV_KEY",
  "keywords": "information technology",
  "noticeTypes": ["o", "k", "p"],
  "naicsCodes": ["541512", "541519"],
  "setAsideCode": "SBA",
  "daysBack": 14,
  "activeOnly": true
}
````

### Output

Each row is one opportunity:

```json
{
  "notice_id": "abcdef1234567890",
  "title": "Enterprise Cybersecurity Support Services",
  "solicitation_number": "W1234-26-R-0001",
  "notice_type": "Solicitation",
  "base_type": "Combined Synopsis/Solicitation",
  "department": "DEPT OF DEFENSE / DEPT OF THE ARMY",
  "organization_type": "OFFICE",
  "posted_date": "2026-07-10",
  "response_deadline": "2026-08-01T17:00:00-04:00",
  "archive_date": "2026-08-16",
  "naics_code": "541512",
  "classification_code": "D310",
  "set_aside": "Total Small Business Set-Aside",
  "set_aside_code": "SBA",
  "active": "Yes",
  "pop_city": "Fort Belvoir",
  "pop_state": "Virginia",
  "pop_country": "United States",
  "pop_zip": "22060",
  "contact_name": "Jane Smith",
  "contact_email": "jane.smith@army.mil",
  "contact_phone": "703-555-0100",
  "award_number": "",
  "award_amount": "",
  "award_date": "",
  "awardee_name": "",
  "description_link": "https://api.sam.gov/opportunities/v1/noticedesc?noticeid=abcdef1234567890",
  "ui_link": "https://sam.gov/opp/abcdef1234567890/view"
}
```

### Run it on a schedule

Set the Actor to run **daily** with a short lookback (`daysBack` = 2) to get a feed of newly posted opportunities in your industry. Connect a **Slack / email / webhook / Google Sheets** integration to route new bids straight to your capture team.

### Notes & limitations

- Requires a free SAM.gov API key (each user supplies their own).
- The posted-date range is limited to **1 year** per SAM.gov's API.
- `description_link` points to the full notice description (also requires an API key to fetch); `ui_link` opens the opportunity on SAM.gov.
- Award fields are only populated for award notices.
- This is **factual public procurement data**.

***

#### Keywords

SAM.gov scraper, federal contract opportunities, government contracts, GovCon, RFP scraper, solicitation tracker, sources sought, federal bids, contract opportunities API, SAM.gov API, government RFPs, NAICS, set-aside contracts, 8a WOSB SDVOSB HUBZone, small business contracts, federal procurement, bid opportunities, government tenders, contract alerts, capture management, federal marketplace.

# Actor input Schema

## `apiKey` (type: `string`):

Your free SAM.gov API key. Get it at sam.gov: sign in -> Account Details -> API Key (or via api.data.gov). Required. Only sent to api.sam.gov.

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

Search opportunity titles for these keywords, e.g. "cybersecurity" or "janitorial services". Leave empty to match all titles.

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

Which types of notices to include. Default is the bid-relevant set. Choose ALL for every type.

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

Filter by NAICS industry codes (up to 6 digits), e.g. 541512 (computer systems design). Leave empty for all industries.

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

Two-letter US state code where the work is performed, e.g. CA, TX, VA. Leave empty for all.

## `setAsideCode` (type: `string`):

Filter by set-aside, e.g. SBA (Total Small Business), 8A, WOSB, SDVOSBC, HZC. Leave empty for all.

## `organizationName` (type: `string`):

Filter by department or sub-tier agency name, e.g. "General Services Administration". Leave empty for all.

## `daysBack` (type: `integer`):

How many days back (by posted date) to search, 1-365. Ignored if you set explicit dates below. For a scheduled monitor, use a small value (e.g. 2).

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

Explicit start date, format MM/DD/YYYY. Overrides Lookback days. Range with Posted to must be <= 1 year.

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

Explicit end date, format MM/DD/YYYY. Overrides Lookback days.

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

Only return opportunities still marked active (open). Turn off to include inactive/archived ones.

## `maxResults` (type: `integer`):

Stop after pushing this many opportunities. Leave empty for no limit.

## Actor input object example

```json
{
  "keywords": "cybersecurity",
  "noticeTypes": [
    "o",
    "k",
    "p",
    "r"
  ],
  "daysBack": 30,
  "activeOnly": true
}
```

# 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": "cybersecurity"
};

// Run the Actor and wait for it to finish
const run = await client.actor("straightforward_hydra/sam-gov-opportunities-tracker").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": "cybersecurity" }

# Run the Actor and wait for it to finish
run = client.actor("straightforward_hydra/sam-gov-opportunities-tracker").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 '{
  "keywords": "cybersecurity"
}' |
apify call straightforward_hydra/sam-gov-opportunities-tracker --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SAM.gov Federal Contract Opportunities Tracker",
        "description": "Find US federal contract opportunities to bid on, from SAM.gov. Filter by keywords, NAICS, agency, state and set-aside; get clean structured results with deadlines and contacts.",
        "version": "0.1",
        "x-build-id": "NKoHtEce6RHqInHjJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/straightforward_hydra~sam-gov-opportunities-tracker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-straightforward_hydra-sam-gov-opportunities-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/straightforward_hydra~sam-gov-opportunities-tracker/runs": {
            "post": {
                "operationId": "runs-sync-straightforward_hydra-sam-gov-opportunities-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/straightforward_hydra~sam-gov-opportunities-tracker/run-sync": {
            "post": {
                "operationId": "run-sync-straightforward_hydra-sam-gov-opportunities-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "apiKey"
                ],
                "properties": {
                    "apiKey": {
                        "title": "SAM.gov API key",
                        "type": "string",
                        "description": "Your free SAM.gov API key. Get it at sam.gov: sign in -> Account Details -> API Key (or via api.data.gov). Required. Only sent to api.sam.gov."
                    },
                    "keywords": {
                        "title": "Keywords (title search)",
                        "type": "string",
                        "description": "Search opportunity titles for these keywords, e.g. \"cybersecurity\" or \"janitorial services\". Leave empty to match all titles."
                    },
                    "noticeTypes": {
                        "title": "Notice types",
                        "type": "array",
                        "description": "Which types of notices to include. Default is the bid-relevant set. Choose ALL for every type.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "ALL",
                                "o",
                                "k",
                                "p",
                                "r",
                                "s",
                                "a",
                                "u",
                                "g",
                                "i"
                            ],
                            "enumTitles": [
                                "ALL - Every notice type",
                                "o - Solicitation",
                                "k - Combined Synopsis/Solicitation",
                                "p - Presolicitation",
                                "r - Sources Sought",
                                "s - Special Notice",
                                "a - Award Notice",
                                "u - Justification (J&A)",
                                "g - Sale of Surplus Property",
                                "i - Intent to Bundle (DoD)"
                            ]
                        },
                        "default": [
                            "o",
                            "k",
                            "p",
                            "r"
                        ]
                    },
                    "naicsCodes": {
                        "title": "NAICS codes",
                        "type": "array",
                        "description": "Filter by NAICS industry codes (up to 6 digits), e.g. 541512 (computer systems design). Leave empty for all industries.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "state": {
                        "title": "Place of performance state",
                        "type": "string",
                        "description": "Two-letter US state code where the work is performed, e.g. CA, TX, VA. Leave empty for all."
                    },
                    "setAsideCode": {
                        "title": "Set-aside code",
                        "type": "string",
                        "description": "Filter by set-aside, e.g. SBA (Total Small Business), 8A, WOSB, SDVOSBC, HZC. Leave empty for all."
                    },
                    "organizationName": {
                        "title": "Agency / organization name",
                        "type": "string",
                        "description": "Filter by department or sub-tier agency name, e.g. \"General Services Administration\". Leave empty for all."
                    },
                    "daysBack": {
                        "title": "Lookback days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "How many days back (by posted date) to search, 1-365. Ignored if you set explicit dates below. For a scheduled monitor, use a small value (e.g. 2).",
                        "default": 30
                    },
                    "postedFrom": {
                        "title": "Posted from (advanced)",
                        "type": "string",
                        "description": "Explicit start date, format MM/DD/YYYY. Overrides Lookback days. Range with Posted to must be <= 1 year."
                    },
                    "postedTo": {
                        "title": "Posted to (advanced)",
                        "type": "string",
                        "description": "Explicit end date, format MM/DD/YYYY. Overrides Lookback days."
                    },
                    "activeOnly": {
                        "title": "Active opportunities only",
                        "type": "boolean",
                        "description": "Only return opportunities still marked active (open). Turn off to include inactive/archived ones.",
                        "default": true
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Stop after pushing this many opportunities. Leave empty for no limit."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
