# SAM.gov Opportunity Matcher — Contracts Ranked by Fit (`adaptationapps/samgov-matcher`) Actor

Finds open federal contract opportunities on SAM.gov and ranks them by fit to your NAICS codes, keywords, set-asides and states, with the reason each matched.

- **URL**: https://apify.com/adaptationapps/samgov-matcher.md
- **Developed by:** [Jim Kim](https://apify.com/adaptationapps) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 matched 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/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 Opportunity Matcher — federal contracts ranked for your business

Stop scrolling SAM.gov. Tell this tool what your business does and get back **open federal contract opportunities ranked by fit**, with the **reason each one matched** and **how many days you have to respond**.

### What you get

For each opportunity:

- **Fit score (0–100)** and **why it matches**: your NAICS code, your keywords in the title, a set-aside you qualify for, a state you work in
- **Days to respond** and the deadline, so urgent ones stand out
- Title, agency, notice type, NAICS and PSC codes, set-aside, place of performance
- **Contracting officer name, email and phone** when listed
- Direct link to the notice on SAM.gov

Results are sorted by fit, then by soonest deadline.

**Monitor mode:** schedule it daily and turn on *Only output opportunities that are new since the last run* to get just the fresh ones.

### Who it's for

- **Small businesses and contractors** bidding on federal work
- **8(a), HUBZone, veteran-owned and women-owned businesses** looking for set-asides
- **Proposal writers and BD consultants** watching opportunities for several clients

### How to use

1. Get your **free SAM.gov API key**: sign in at sam.gov, open your **Profile**, and copy your **Public API Key**. It's stored as a secret input.
2. Add your **NAICS codes** and a few **keywords** that describe your work.
3. Optional: set-asides you qualify for, states you work in, words to skip, and how far back to look.
4. Click **Start**. Open the **Matches** view.

### Good to know

- Data comes from SAM.gov's official Opportunities API, the same data as the SAM.gov website.
- Each NAICS code and each keyword is one request. SAM.gov limits how many requests a key can make per day, and personal keys have the lowest limit. If you hit it, the run keeps everything found so far.
- The fit score uses clear rules, so every match explains itself.

### Pricing

You pay per matching opportunity returned. Opportunities that don't match your profile are free.

This tool is independent and not affiliated with the U.S. General Services Administration or SAM.gov.

# Actor input Schema

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

Free. Sign in at sam.gov, open your Profile, and copy your Public API Key. Required for results; without it the run only returns a note on how to get one (no charge).

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

The industry codes your business works in, for example 541511 (custom software) or 238220 (plumbing and HVAC).

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

Words that describe your work, matched against opportunity titles. Each keyword also runs its own search.

## `excludeKeywords` (type: `array`):

For example: construction, janitorial.

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

Opportunities set aside for these get a higher score.

## `states` (type: `array`):

Two-letter codes, for example VA, MD, TX. Matching places of performance get a higher score.

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

Only look at opportunities posted in this many recent days.

## `minDaysToRespond` (type: `integer`):

Skip opportunities whose response deadline is closer than this many days.

## `minFitScore` (type: `integer`):

Only return opportunities scoring at least this much (0-100) against your NAICS codes, keywords, set-asides and state.

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

Which notice types to include, such as solicitations, presolicitations or sources sought.

## `maxResultsPerSearch` (type: `integer`):

Most results to pull from SAM.gov for each NAICS code or keyword search.

## `onlyNewSinceLastRun` (type: `boolean`):

Only return opportunities this tool has not shown you before. Good for daily scheduled runs.

## Actor input object example

```json
{
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "keywords": [
    "software",
    "cloud"
  ],
  "postedWithinDays": 14,
  "minDaysToRespond": 3,
  "minFitScore": 20,
  "noticeTypes": [
    "o",
    "k",
    "p"
  ],
  "maxResultsPerSearch": 1000,
  "onlyNewSinceLastRun": false
}
```

# Actor output Schema

## `matches` (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 = {
    "naicsCodes": [
        "541511",
        "541512"
    ],
    "keywords": [
        "software",
        "cloud"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adaptationapps/samgov-matcher").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 = {
    "naicsCodes": [
        "541511",
        "541512",
    ],
    "keywords": [
        "software",
        "cloud",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("adaptationapps/samgov-matcher").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 '{
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "keywords": [
    "software",
    "cloud"
  ]
}' |
apify call adaptationapps/samgov-matcher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adaptationapps/samgov-matcher"
        }
    }
}
```

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/fZvmlZeVd2S6Ef9If/builds/VMhePtJUurETStBxA/openapi.json
