# SAM.gov Scraper - Federal Contracts & RFP Monitor (No API Key) (`omarchydev/government-contract-monitor`) Actor

Scrape SAM.gov + USASpending for federal RFPs, solicitations, and contract awards. No API key required. AI-ranked by
relevance to your business. Filter by NAICS, set-aside, agency, state, value. Attachment URLs included. For govcon BD
teams, proposal writers, and competitive intelligence.

- **URL**: https://apify.com/omarchydev/government-contract-monitor.md
- **Developed by:** [Omarchy Dev](https://apify.com/omarchydev) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 18 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 contract 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

## Government Contract Finder - SAM.gov RFP & Federal Bid Tracker

Scrape SAM.gov and USASpending.gov for federal contract opportunities, RFPs, solicitations, and award history. No API key required to start. AI-ranked by relevance to your business. Attachment URLs included. Webhook output for Zapier, Make, n8n. $0.02 per contract.

**Works immediately.** USASpending.gov needs no key. Add a free SAM.gov API key for richer opportunity details.

### Who This Is For

- **BD / Capture teams** tracking federal contract opportunities
- **Proposal writers** who need SOWs and Section L/M documents in one place
- **Small business contractors** (8(a), WOSB, HUBZone, SDVOSB) filtering for set-aside bids
- **Competitive intel analysts** tracking who's winning what at which agencies
- **Automation builders** wiring govcon signals into CRMs, Slack, or Airtable

### What Makes This Different

1. **Two sources in one call.** SAM.gov for open opportunities + USASpending.gov for award history. Most actors give you one or the other.
2. **No SAM.gov API key required to start.** USASpending data works out of the box.
3. **AI semantic ranking.** Describe your business in plain English ("cloud migration for federal agencies") and every contract is scored on actual relevance. Uses FastText-compatible TF-IDF locally. No LLM calls, no per-query costs.
4. **Rich attachment metadata.** URL, filename, and MIME type parsed from every attachment. Optional `fetch_attachment_metadata: true` fetches real byte sizes via parallel HEAD requests. Direct download paths for RFPs, SOWs, Section L/M instructions, past performance questionnaires. Other scrapers give you URLs only.
5. **Change detection.** Scheduled runs tag each opportunity as `new`, `modified`, or `unchanged` so you can alert only on changes.
6. **Webhook output.** POST up to 50 opportunities per run to Zapier, Make, n8n, or any HTTP endpoint. Non-blocking so a bad webhook URL doesn't crash the run.
7. **Dry-run mode.** Test configuration and webhooks with 2 sample opportunities. Zero API calls, zero charges.
8. **Opt-in enrichments (v1.5).** Recompete detection, set-aside eligibility check, amendment detection, SAM.gov exclusion screening. Each enrichment is independent. You pay only for signals you opted into.

### How We Compare

| Feature | This Actor | fortuitous_pirate/sam-gov-scraper | topaz_lunar/us-government-contracts |
|---|:---:|:---:|:---:|
| Last updated | This week | 3 months ago | 7 months ago |
| SAM.gov opportunities | Yes | Yes | Yes |
| USASpending award history | Yes | No | Optional |
| State contracts (CA/TX/NY/FL/IL/PA) | No | No | Yes |
| Attachment download URLs | Yes | Yes | Links only |
| AI semantic ranking | Yes (FastText) | No | No |
| Webhook output | Yes | No | Yes |
| Change detection (new/modified) | Yes | No | Partial |
| Dry-run mode | Yes | No | No |
| Recompete detection | Yes ($0.25) | No | No |
| Set-aside eligibility check | Yes ($0.10) | No | No |
| Amendment detection | Yes ($0.08) | No | No |
| SAM.gov exclusion screening | Yes ($0.05) | No | No |
| Base price | $0.02 / contract | $0.007 / result | $0.001–$0.003 / contract |

**When to pick us:** you're a BD or capture team that needs signals (recompete, eligibility, amendments) more than you need bulk volume. The enrichments are the moat. **When to pick fortuitous_pirate:** you want the cheapest possible per-record price and only need SAM.gov attachment URLs. **When to pick topaz_lunar:** you need state-level procurement coverage alongside federal.

### Enrichments (Opt-in, Default Off)

Four extra signals, each with its own pay-per-event price. Turn them on only when you need them.

#### `detect_recompetes` - $0.25 per hit

Flags awards whose period of performance ends within `recompete_lookahead_months` (default 18). Recompetes are the single most valuable BD signal in govcon: bidders win them 38% of the time vs 12% on net-new pursuits. Output fields: `is_recompete`, `months_until_recompete`, `incumbent_contractor`, `pop_end_date`.

#### `check_eligibility` - $0.10 per opportunity

For every opportunity with a known NAICS code, checks whether your company is under the SBA size cap (revenue or employee based) and whether you hold the required set-aside certification. Ship your profile:

```json
"company_profile": {
  "annual_revenue_usd": 5000000,
  "employee_count": 25,
  "certifications": ["small_business", "wosb", "8a"]
}
````

Charged only when a definitive eligible/ineligible answer is produced. Null answers cost nothing.

#### `detect_amendments` - $0.08 per amendment

Diff against the prior run. Flags deadline changes, value changes, and new attachments. GAO treats Q\&A responses as binding solicitation amendments under FAR 15.206. Missing them is a top-five proposal rejection reason. Output fields: `amendment_detected`, `amendment_type`, `previous_deadline`, `previous_value`.

#### `identify_incumbents` - $0.15 per opportunity (NEW in v1.6)

For every opportunity, query USASpending for the top 5 contractors who won similar work (same agency + NAICS) over the last 5 years. Returns contractor\_name, UEI, total won, contract count, and latest PoP end date per winner. Uses USASpending (no SAM.gov rate limit impact). Output field: `prior_winners` array on each opportunity.

#### `score_pwin` - $0.20 per opportunity (NEW in v1.6)

Compute a Probability-of-Win score (0-100) based on NAICS fit, past performance (via your `company_profile.past_awards`), agency history, set-aside fit, competition count, and value range. Output: `pwin_score` (0-100), `pwin_breakdown` (component points), `pwin_verdict` (bid / conditional / no\_bid). Industry thresholds: bid >= 70, conditional 50-69, no\_bid < 50.

#### `extract_rfp_requirements` - $0.35 per opportunity (NEW in v1.6)

Download RFP attachment files (PDF, DOCX, or ZIP bundles) and extract every shall/must/will requirement via Gemini 2.5 Flash. Output: `requirements_matrix` array with section, requirement\_id, text, shall\_type, source\_file per requirement. Requires a free `gemini_api_key` from https://aistudio.google.com/apikey (users pay Google for LLM calls directly, typically $0.01-$0.02 per RFP).

#### `check_exclusions` - $0.05 per entity

Screens every incumbent contractor against the SAM.gov Exclusions list (debarred or suspended vendors). Use before teaming: teaming with an excluded vendor disqualifies your bid and can trigger False Claims Act scrutiny. Requires a free `sam_api_key`. Output fields: `incumbent_excluded`, `exclusion_reason`, `exclusion_agency`, `exclusion_date`.

### Input Configuration

#### Search

| Field | Type | Default | Description |
|-------|------|--------:|-------------|
| `business_description` | string | | Plain-English profile. Enables AI semantic ranking and NAICS auto-suggestions |
| `keywords` | string\[] | `[]` | Keywords matched in title and description |
| `naics_codes` | string\[] | `[]` | NAICS codes (e.g. `541512` for IT services) |
| `psc_codes` | string\[] | `[]` | Product Service Codes |
| `agencies` | string\[] | `[]` | Federal agency names |
| `states` | string\[] | `[]` | 2-letter state codes for place of performance |

#### Filters

| Field | Type | Default | Description |
|-------|------|--------:|-------------|
| `opportunity_types` | string\[] | `["solicitation"]` | presolicitation, solicitation, combined\_synopsis, sources\_sought, special\_notice, award\_notice |
| `set_aside_types` | string\[] | `[]` | small\_business, 8a, hubzone, sdvosb, wosb, edwosb |
| `min_value` | int | 0 | Minimum estimated contract value in USD |
| `max_value` | int | 0 | Maximum value (0 = no limit) |
| `posted_within_days` | int | 30 | Only opportunities posted within N days |
| `deadline_within_days` | int | 60 | Only opportunities with deadlines within N days |
| `max_results` | int | 100 | Maximum returned per run |

#### Enrichments (Opt-in)

| Field | Type | Default | Description |
|-------|------|--------:|-------------|
| `detect_recompetes` | bool | false | Flag contracts with PoP ending soon. $0.25 per hit |
| `recompete_lookahead_months` | int | 18 | Window for recompete detection (1 to 36) |
| `check_eligibility` | bool | false | SBA size + cert check vs your profile. $0.10 per opportunity |
| `company_profile` | object | `{}` | `{annual_revenue_usd, employee_count, certifications}` |
| `detect_amendments` | bool | false | Diff against prior run. $0.08 per amendment |
| `check_exclusions` | bool | false | Screen incumbents against SAM.gov Exclusions. $0.05 per entity |
| `entities_to_check` | string\[] | `[]` | Extra UEIs to screen |

#### Other

| Field | Type | Default | Description |
|-------|------|--------:|-------------|
| `include_awards` | bool | true | Include recent contract awards for competitive intelligence |
| `include_full_description` | bool | true | Include full opportunity description text |
| `sam_api_key` | string | | Optional SAM.gov API key. Required for exclusion screening |
| `webhook_url` | string | | POST results to this URL (Zapier, Make, n8n, custom) |
| `dry_run` | bool | false | Return 2 sample opportunities without API calls or charges |
| `fetch_attachment_metadata` | bool | false | For each attachment, HEAD-request to fetch size and MIME. Adds ~0.5s per attachment. Free |

### Sample Output Record

```json
{
  "opportunity_id": "sam_abc123",
  "source": "sam.gov",
  "type": "solicitation",
  "title": "Cloud Migration Services for Federal Agency",
  "description": "Full solicitation text...",
  "url": "https://sam.gov/opp/abc123/view",
  "agency": "General Services Administration",
  "naics_code": "541512",
  "naics_description": "Computer Systems Design Services",
  "set_aside_type": "Total Small Business",
  "small_business_eligible": true,
  "estimated_value": 2500000.0,
  "place_state": "VA",
  "posted_date": "2026-04-15T00:00:00",
  "response_deadline": "2026-05-15T00:00:00",
  "contact_email": "contracting.officer@gsa.gov",
  "attachments": [
    {
      "url": "https://sam.gov/api/prod/opps/.../rfp.pdf",
      "filename": "rfp.pdf",
      "mime_type": "application/pdf",
      "size_bytes": null
    },
    {
      "url": "https://sam.gov/api/prod/opps/.../sow.pdf",
      "filename": "sow.pdf",
      "mime_type": "application/pdf",
      "size_bytes": null
    }
  ],
  "attachment_urls": [
    "https://sam.gov/api/prod/opps/.../rfp.pdf",
    "https://sam.gov/api/prod/opps/.../sow.pdf"
  ],
  "attachments_count": 2,
  "awarded_to": null,
  "incumbent_contractor": "Accenture Federal Services LLC",
  "pop_start_date": "2017-09-19T00:00:00",
  "pop_end_date": "2027-05-31T00:00:00",
  "is_recompete": true,
  "months_until_recompete": 14,
  "incumbent_excluded": false,
  "is_eligible": true,
  "eligibility_reason": "Revenue $5,000,000 <= $34,000,000 cap; Company holds required cert for Total Small Business",
  "naics_size_cap": "$34M avg receipts",
  "amendment_detected": false,
  "relevance_score": 0.87,
  "semantic_score": 0.954,
  "matched_keywords": ["cloud", "semantic:95%"],
  "change_status": "new",
  "scraped_at": "2026-04-18T10:00:00Z"
}
```

The `change_status` field tells you what changed since the last run: `new`, `modified`, or `unchanged`.

### Market Insights (KV Store)

Stored as `INSIGHTS` alongside each run. Useful for dashboards.

```json
{
  "total_opportunities": 150,
  "total_estimated_value": 500000000,
  "opportunities_by_type": {"solicitation": 80, "award_notice": 45},
  "top_agencies": [
    {"agency": "Department of Defense", "opportunities_count": 45, "total_estimated_value": 200000000}
  ],
  "small_business_opportunities": 65,
  "set_aside_breakdown": {"Total Small Business": 30, "8(a)": 15, "SDVOSB": 10, "WOSB": 10},
  "opportunities_expiring_7d": 12,
  "opportunities_expiring_30d": 45
}
```

### Example Inputs

#### Bid / No-Bid Screening With Eligibility Check

```json
{
  "business_description": "Cloud migration and cybersecurity services for federal agencies. SBA-certified small business and WOSB.",
  "naics_codes": ["541512", "541519"],
  "opportunity_types": ["solicitation", "combined_synopsis"],
  "min_value": 500000,
  "check_eligibility": true,
  "company_profile": {
    "annual_revenue_usd": 5000000,
    "employee_count": 25,
    "certifications": ["small_business", "wosb"]
  }
}
```

#### Recompete Tracker for BD Pipeline

```json
{
  "naics_codes": ["541512"],
  "opportunity_types": ["award_notice"],
  "include_awards": true,
  "posted_within_days": 365,
  "detect_recompetes": true,
  "recompete_lookahead_months": 18
}
```

#### Competitive Intelligence

```json
{
  "keywords": ["cybersecurity", "zero trust", "FedRAMP"],
  "agencies": ["Department of Defense", "Department of Homeland Security"],
  "opportunity_types": ["award_notice"],
  "include_awards": true
}
```

#### Small Business Set-Aside Focus

```json
{
  "naics_codes": ["541511"],
  "set_aside_types": ["8a", "hubzone", "sdvosb", "wosb"],
  "max_value": 5000000,
  "deadline_within_days": 30,
  "check_eligibility": true,
  "company_profile": {
    "annual_revenue_usd": 2000000,
    "certifications": ["small_business", "8a"]
  }
}
```

#### Dry Run (Test Without Charges)

```json
{
  "dry_run": true,
  "business_description": "IT services"
}
```

### Common NAICS Codes

| Code | Description | SBA Size Cap |
|------|-------------|--------------|
| 541511 | Custom Computer Programming | $34M avg receipts |
| 541512 | Computer Systems Design | $34M avg receipts |
| 541513 | Computer Facilities Management | $34M avg receipts |
| 541519 | Other Computer Related Services | $34M avg receipts |
| 541611 | Administrative Management Consulting | $24.5M avg receipts |
| 541618 | Other Management Consulting | $19M avg receipts |
| 541715 | R\&D Engineering | 1,000 employees |
| 541330 | Engineering Services | $25.5M avg receipts |
| 518210 | Data Processing, Hosting | $47M avg receipts |
| 561110 | Office Administrative Services | $13M avg receipts |

### Pricing

Pay-per-event. No monthly fee. You pay only for what you opted into.

| Event | Price | Fires |
|-------|------:|-------|
| Actor start | $0.01 | Once per run (first 5 seconds waived) |
| Contract | $0.02 | Per opportunity returned |
| Recompete Detected | $0.25 | Per incumbent contract flagged for rebid |
| Eligibility Check | $0.10 | Per opportunity with a definitive eligible answer |
| Amendment Detected | $0.08 | Per material change vs prior run |
| Exclusion Screen | $0.05 | Per incumbent entity checked against SAM.gov Exclusions |
| Incumbent Identified | $0.15 | Per opportunity enriched with prior winners via USASpending |
| PWin Scored | $0.20 | Per opportunity assigned a Probability-of-Win score |
| RFP Requirements Extracted | $0.35 | Per opportunity with LLM-extracted compliance matrix |

**Cost examples (enrichments off, default):**

| Use case | Contracts / run | Cost / run |
|----------|----------------:|-----------:|
| Quick keyword check | 25 | ~$0.51 |
| Daily BD monitoring | 100 | ~$2.01 |
| Full NAICS sweep | 500 | ~$10.01 |

**Cost example with all enrichments on** (100 contracts, 15 recompete hits, 100 eligibility checks, 2 amendments, 20 incumbent screens):

- Base: 100 x $0.02 = $2.00
- Recompetes: 15 x $0.25 = $3.75
- Eligibility: 100 x $0.10 = $10.00
- Amendments: 2 x $0.08 = $0.16
- Exclusions: 20 x $0.05 = $1.00
- **Total: $16.91 per run**

Compared to alternatives: GovWin IQ runs $13K to $119K per year, Bloomberg Government $6K+, GovTribe $2.4K, EZGovOpps $2.7K, SamSearch $99/month.

### SAM.gov API Key (Optional)

For richer opportunity details and exclusion screening:

1. Register at [SAM.gov](https://sam.gov)
2. Request a free API key at [api.sam.gov](https://api.sam.gov/)
3. Wait ~10 business days for approval
4. Add your key to the `sam_api_key` input field

Without a key, the actor uses USASpending.gov. Exclusion screening requires a key.

### Integrations

- **Webhooks**: POST up to 50 opportunities to Zapier, Make.com, n8n, or any HTTP endpoint. Non-blocking.
- **Google Sheets**: export via Apify's native integration
- **CSV / JSON / Excel**: download from any run
- **API**: programmatic access via Apify API
- **Schedules**: daily runs land fresh data in your dataset and fire webhooks automatically

### FAQ

**Do I need a SAM.gov API key?** No, USASpending data works immediately. A free SAM.gov key unlocks richer opportunity details and enables exclusion screening.

**How does the recompete detector work?** Every USASpending award includes a `period_of_performance_current_end_date`. We flag any award whose PoP ends within `recompete_lookahead_months` (default 18). Output includes months until recompete and incumbent contractor name.

**How does eligibility checking work?** We ship the SBA size standards table (NAICS -> revenue or employee cap). For every opportunity with a known NAICS, we compare your `company_profile` against the cap and check your certifications against the set-aside restriction. Null answers cost nothing.

**How does amendment detection work on the first run?** First run: no prior snapshot, so nothing fires. Your snapshot is persisted to KV and becomes the baseline for the next run. Schedule daily or weekly to benefit.

**Is exclusion screening free?** No. It requires a SAM.gov API key and charges $0.05 per entity checked. Without a key it logs a warning and skips.

**Can I enable only one enrichment?** Yes, every enrichment is an independent boolean. Leave the others off.

**Are attachment URLs direct download links?** Yes. They come from SAM.gov's `resourceLinks` field. Pipe into a downloader or archive.

**Is this ToS-compliant?** All data sources are public government data explicitly intended for programmatic access. No scraping workarounds, no credentials, no ToS violations.

**Can I run this on a schedule?** Yes. Use Apify's Schedules. Daily at 6am ET is a common pattern for BD teams. Change detection and amendment detection only work meaningfully with scheduled runs.

**What if I hit the SAM.gov rate limit?** Built-in exponential backoff kicks in automatically. SAM.gov 429s get a longer backoff (5s, 15s, 30s) than other endpoints because SAM's burst window takes ~30-60s to clear. If the whole run gets rate-limited, you still get your USASpending results and **no extra charges fire for the blocked SAM calls**. See "SAM.gov Rate Limits & Pricing" section below.

### SAM.gov Rate Limits & Pricing

**Your API key, your quota.** Every user provides their own `sam_api_key`. Limits:

| Key type | Requests per day | Burst (short-window) |
|---|---:|---|
| Non-federal (individual) | 1,000 | ~10-15 calls in rapid succession triggers 429 |
| Federal | 10,000 | Same burst behavior |

Daily quota resets at midnight UTC.

**Which actor operations count against your quota:**

| Operation | SAM calls per run | Notes |
|---|:---:|---|
| SAM.gov opportunity fetch | 1 | Paged if > 1000 results |
| `check_exclusions` | 1 per unique incumbent | Cached; same entity only counted once |
| Everything else (USASpending, enrichments, attachments) | 0 | Doesn't touch SAM |

**Pricing protection:** our pay-per-event charges only fire on successful signals. A 429 response means no opportunity, no charge. You never pay for failed SAM calls.

**Tips to stay under the quota:**

1. Schedule runs with `max_results` sized to your needs, not the maximum
2. Use `check_exclusions` selectively (each unique incumbent = 1 call)
3. If running multiple times per day, budget across runs (1,000 / 24h = ~40/hr)
4. For federal users, request a federal API key for 10x the quota

**How fresh is the data?** Real-time. Every run hits the APIs directly. No cache.

### Changelog

#### v1.5.1 (April 2026)

- Attachment output upgraded from flat URL list to structured objects with URL, filename, MIME type (always), and size in bytes (when `fetch_attachment_metadata` is enabled)
- `attachment_urls` still emitted alongside for backward compatibility
- Added How We Compare section vs fortuitous\_pirate and topaz\_lunar

#### v1.5 (April 2026)

- Four opt-in enrichment events: recompete\_detected, set\_aside\_eligibility\_checked, amendment\_detected, exclusion\_checked
- Parallel SAM.gov + USASpending fetch via asyncio.gather (typical 50% runtime cut)
- New output fields: pop\_start\_date, pop\_end\_date, incumbent\_contractor, incumbent\_uei, is\_recompete, months\_until\_recompete, is\_eligible, eligibility\_reason, amendment\_detected, incumbent\_excluded

#### v1.4 (April 2026)

- Fixed USASpending silent-fail when any keyword is under 3 characters

#### v1.3 (April 2026)

- Added `attachments` and `attachments_count` (SAM.gov resourceLinks passthrough)
- Added `webhook_url` input for Zapier, Make, n8n, custom endpoints
- Added `dry_run` mode

#### v1.2 (March 2026)

- FastText-compatible semantic ranking via business\_description
- NAICS auto-suggestions
- Pricing set to $0.02 per contract

#### v1.1 (December 2025)

- Change detection (new / modified / unchanged)
- USASpending.gov integration
- Pay-per-event billing

#### v1.0 (October 2025)

- Initial release with SAM.gov API integration

### Support

- [SAM.gov Help](https://sam.gov/help)
- [USASpending API](https://api.usaspending.gov)
- [Apify Documentation](https://docs.apify.com)
- Contact digital\_troubadour on Apify

# Actor input Schema

## `business_description` (type: `string`):

Describe what your company does (e.g., 'We provide cloud migration and IT modernization services for federal agencies'). Enables AI-powered semantic matching that finds relevant contracts even without exact keyword matches. Also auto-suggests NAICS codes.

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

Keywords to search for in opportunity titles and descriptions

## `naics_codes` (type: `array`):

NAICS codes to filter opportunities (e.g., 541512 for IT services)

## `psc_codes` (type: `array`):

Product Service Codes to filter by

## `set_aside_types` (type: `array`):

Small business set-aside types (small\_business, 8a, hubzone, sdvosb, wosb, edwosb)

## `opportunity_types` (type: `array`):

Types of opportunities to include (presolicitation, solicitation, combined\_synopsis, sources\_sought, special\_notice, award\_notice)

## `agencies` (type: `array`):

Federal agencies to filter by

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

State codes for place of performance (e.g., VA, MD, DC)

## `min_value` (type: `integer`):

Minimum estimated contract value in USD

## `max_value` (type: `integer`):

Maximum estimated contract value in USD (0 = no limit)

## `posted_within_days` (type: `integer`):

Only show opportunities posted within this many days

## `deadline_within_days` (type: `integer`):

Only show opportunities with deadlines within this many days

## `include_awards` (type: `boolean`):

Include recent contract awards for competitive intelligence

## `include_full_description` (type: `boolean`):

Include full opportunity description in output

## `max_results` (type: `integer`):

Maximum number of opportunities to return

## `sam_api_key` (type: `string`):

SAM.gov API key for richer opportunity data (optional, free at https://api.sam.gov). Without a key, the actor uses USASpending.gov which provides award data but fewer opportunity details.

## `webhook_url` (type: `string`):

POST contracts to this URL after each run. Works with Zapier, Make, n8n, or any custom HTTP endpoint. Payload includes up to 50 opportunities with full details.

## `dry_run` (type: `boolean`):

Return 2 sample opportunities without calling SAM.gov or USASpending APIs. Useful for testing input configuration, webhooks, or integrations. No charges incurred.

## `check_exclusions` (type: `boolean`):

Look up every incumbent contractor in the SAM.gov Exclusions list (debarred/suspended vendors). Returns exclusion reason, agency, and date. Charges $0.05 per entity checked.

## `entities_to_check` (type: `array`):

Optional list of SAM.gov UEIs to screen against the Exclusions list in addition to incumbents found in results.

## `detect_recompetes` (type: `boolean`):

Flag awards whose period of performance ends within recompete\_lookahead\_months. Shows incumbent contractor, months until recompete. Single biggest BD signal (~38% win rate vs 12% on net-new). Charges $0.25 per recompete flagged.

## `recompete_lookahead_months` (type: `integer`):

Flag contracts whose PoP ends within this many months. 18 is the industry standard for BD lead time.

## `check_eligibility` (type: `boolean`):

For every opportunity, check whether your company qualifies based on SBA size standards (NAICS revenue/employee cap) and your certifications. Charges $0.10 per opportunity checked. Requires company\_profile below.

## `company_profile` (type: `object`):

Your annual revenue, employee count, and certifications. Used to determine set-aside eligibility. Example: {"annual\_revenue\_usd": 5000000, "employee\_count": 25, "certifications": \["small\_business", "wosb"]}

## `detect_amendments` (type: `boolean`):

Compare current run against prior runs. Flags deadline changes, value changes, and new attachments. GAO treats Q\&A and amendments as binding. Missing them often means proposal rejection. Charges $0.08 per amendment detected.

## `fetch_attachment_metadata` (type: `boolean`):

For each attachment URL, do a HEAD request to fetch Content-Length (size) and Content-Type (MIME). Adds ~0.5s per attachment. Free (no additional charge). When off, you still get filename parsed from the URL.

## `identify_incumbents` (type: `boolean`):

For each opportunity, query USASpending for top 5 contractors who won similar work (same agency + NAICS) over the last 5 years. Output includes total won, contract count, and latest PoP end date per winner. No SAM.gov API calls; uses USASpending which has generous rate limits. Charges $0.15 per opportunity enriched.

## `score_pwin` (type: `boolean`):

Compute a Probability-of-Win score (0-100) per opportunity based on NAICS fit, past performance, agency history, set-aside fit, competition count, and value range. Verdict: bid (>=70), conditional (50-69), no\_bid (<50). Requires company\_profile.past\_awards for full scoring.

## `extract_rfp_requirements` (type: `boolean`):

Download RFP attachment PDFs, extract every shall/must/will requirement via Gemini 2.5 Flash, and organize by section (L, M, SOW). Outputs a compliance matrix. Requires gemini\_api\_key. Charges $0.35 per opportunity where extraction succeeded.

## `gemini_api_key` (type: `string`):

Required if extract\_rfp\_requirements is enabled. Get a free key at https://aistudio.google.com/apikey. You pay Google for the LLM calls directly (typically $0.01-$0.02 per RFP).

## Actor input object example

```json
{
  "business_description": "IT consulting and cloud migration services for federal agencies",
  "keywords": [
    "software development",
    "IT services"
  ],
  "naics_codes": [
    "541512"
  ],
  "opportunity_types": [
    "solicitation"
  ],
  "min_value": 0,
  "max_value": 0,
  "posted_within_days": 30,
  "deadline_within_days": 60,
  "include_awards": true,
  "include_full_description": true,
  "max_results": 100,
  "dry_run": false,
  "check_exclusions": false,
  "detect_recompetes": false,
  "recompete_lookahead_months": 18,
  "check_eligibility": false,
  "detect_amendments": false,
  "fetch_attachment_metadata": false,
  "identify_incumbents": false,
  "score_pwin": false,
  "extract_rfp_requirements": false
}
```

# 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 = {
    "business_description": "IT consulting and cloud migration services for federal agencies",
    "keywords": [
        "software development",
        "IT services"
    ],
    "naics_codes": [
        "541512"
    ],
    "opportunity_types": [
        "solicitation"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("omarchydev/government-contract-monitor").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 = {
    "business_description": "IT consulting and cloud migration services for federal agencies",
    "keywords": [
        "software development",
        "IT services",
    ],
    "naics_codes": ["541512"],
    "opportunity_types": ["solicitation"],
}

# Run the Actor and wait for it to finish
run = client.actor("omarchydev/government-contract-monitor").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 '{
  "business_description": "IT consulting and cloud migration services for federal agencies",
  "keywords": [
    "software development",
    "IT services"
  ],
  "naics_codes": [
    "541512"
  ],
  "opportunity_types": [
    "solicitation"
  ]
}' |
apify call omarchydev/government-contract-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=omarchydev/government-contract-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SAM.gov Scraper - Federal Contracts & RFP Monitor (No API Key)",
        "description": "Scrape SAM.gov + USASpending for federal RFPs, solicitations, and contract awards. No API key required. AI-ranked by\nrelevance to your business. Filter by NAICS, set-aside, agency, state, value. Attachment URLs included. For govcon BD\nteams, proposal writers, and competitive intelligence.",
        "version": "1.5",
        "x-build-id": "fEEeYIgzLh21JSL0e"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/omarchydev~government-contract-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-omarchydev-government-contract-monitor",
                "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/omarchydev~government-contract-monitor/runs": {
            "post": {
                "operationId": "runs-sync-omarchydev-government-contract-monitor",
                "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/omarchydev~government-contract-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-omarchydev-government-contract-monitor",
                "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",
                "properties": {
                    "business_description": {
                        "title": "Your Business Description",
                        "type": "string",
                        "description": "Describe what your company does (e.g., 'We provide cloud migration and IT modernization services for federal agencies'). Enables AI-powered semantic matching that finds relevant contracts even without exact keyword matches. Also auto-suggests NAICS codes."
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Keywords to search for in opportunity titles and descriptions",
                        "items": {
                            "type": "string"
                        }
                    },
                    "naics_codes": {
                        "title": "NAICS Codes",
                        "type": "array",
                        "description": "NAICS codes to filter opportunities (e.g., 541512 for IT services)",
                        "items": {
                            "type": "string"
                        }
                    },
                    "psc_codes": {
                        "title": "PSC Codes",
                        "type": "array",
                        "description": "Product Service Codes to filter by",
                        "items": {
                            "type": "string"
                        }
                    },
                    "set_aside_types": {
                        "title": "Set-Aside Types",
                        "type": "array",
                        "description": "Small business set-aside types (small_business, 8a, hubzone, sdvosb, wosb, edwosb)",
                        "items": {
                            "type": "string"
                        }
                    },
                    "opportunity_types": {
                        "title": "Opportunity Types",
                        "type": "array",
                        "description": "Types of opportunities to include (presolicitation, solicitation, combined_synopsis, sources_sought, special_notice, award_notice)",
                        "items": {
                            "type": "string"
                        }
                    },
                    "agencies": {
                        "title": "Agencies",
                        "type": "array",
                        "description": "Federal agencies to filter by",
                        "items": {
                            "type": "string"
                        }
                    },
                    "states": {
                        "title": "States",
                        "type": "array",
                        "description": "State codes for place of performance (e.g., VA, MD, DC)",
                        "items": {
                            "type": "string"
                        }
                    },
                    "min_value": {
                        "title": "Minimum Contract Value ($)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum estimated contract value in USD",
                        "default": 0
                    },
                    "max_value": {
                        "title": "Maximum Contract Value ($)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum estimated contract value in USD (0 = no limit)",
                        "default": 0
                    },
                    "posted_within_days": {
                        "title": "Posted Within Days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Only show opportunities posted within this many days",
                        "default": 30
                    },
                    "deadline_within_days": {
                        "title": "Deadline Within Days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Only show opportunities with deadlines within this many days",
                        "default": 60
                    },
                    "include_awards": {
                        "title": "Include Contract Awards",
                        "type": "boolean",
                        "description": "Include recent contract awards for competitive intelligence",
                        "default": true
                    },
                    "include_full_description": {
                        "title": "Include Full Description",
                        "type": "boolean",
                        "description": "Include full opportunity description in output",
                        "default": true
                    },
                    "max_results": {
                        "title": "Maximum Results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of opportunities to return",
                        "default": 100
                    },
                    "sam_api_key": {
                        "title": "SAM.gov API Key",
                        "type": "string",
                        "description": "SAM.gov API key for richer opportunity data (optional, free at https://api.sam.gov). Without a key, the actor uses USASpending.gov which provides award data but fewer opportunity details."
                    },
                    "webhook_url": {
                        "title": "Webhook URL (Optional)",
                        "type": "string",
                        "description": "POST contracts to this URL after each run. Works with Zapier, Make, n8n, or any custom HTTP endpoint. Payload includes up to 50 opportunities with full details."
                    },
                    "dry_run": {
                        "title": "Dry Run (Sample Data)",
                        "type": "boolean",
                        "description": "Return 2 sample opportunities without calling SAM.gov or USASpending APIs. Useful for testing input configuration, webhooks, or integrations. No charges incurred.",
                        "default": false
                    },
                    "check_exclusions": {
                        "title": "Screen Incumbents Against SAM.gov Exclusions ($0.05/entity)",
                        "type": "boolean",
                        "description": "Look up every incumbent contractor in the SAM.gov Exclusions list (debarred/suspended vendors). Returns exclusion reason, agency, and date. Charges $0.05 per entity checked.",
                        "default": false
                    },
                    "entities_to_check": {
                        "title": "Additional Entities to Screen (UEIs)",
                        "type": "array",
                        "description": "Optional list of SAM.gov UEIs to screen against the Exclusions list in addition to incumbents found in results.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "detect_recompetes": {
                        "title": "Flag Recompetes / Expiring Contracts ($0.25/hit)",
                        "type": "boolean",
                        "description": "Flag awards whose period of performance ends within recompete_lookahead_months. Shows incumbent contractor, months until recompete. Single biggest BD signal (~38% win rate vs 12% on net-new). Charges $0.25 per recompete flagged.",
                        "default": false
                    },
                    "recompete_lookahead_months": {
                        "title": "Recompete Lookahead (Months)",
                        "minimum": 1,
                        "maximum": 36,
                        "type": "integer",
                        "description": "Flag contracts whose PoP ends within this many months. 18 is the industry standard for BD lead time.",
                        "default": 18
                    },
                    "check_eligibility": {
                        "title": "Check Set-Aside Eligibility for Your Company ($0.10/opp)",
                        "type": "boolean",
                        "description": "For every opportunity, check whether your company qualifies based on SBA size standards (NAICS revenue/employee cap) and your certifications. Charges $0.10 per opportunity checked. Requires company_profile below.",
                        "default": false
                    },
                    "company_profile": {
                        "title": "Your Company Profile (for Eligibility Check)",
                        "type": "object",
                        "description": "Your annual revenue, employee count, and certifications. Used to determine set-aside eligibility. Example: {\"annual_revenue_usd\": 5000000, \"employee_count\": 25, \"certifications\": [\"small_business\", \"wosb\"]}"
                    },
                    "detect_amendments": {
                        "title": "Detect Solicitation Amendments ($0.08/amendment)",
                        "type": "boolean",
                        "description": "Compare current run against prior runs. Flags deadline changes, value changes, and new attachments. GAO treats Q&A and amendments as binding. Missing them often means proposal rejection. Charges $0.08 per amendment detected.",
                        "default": false
                    },
                    "fetch_attachment_metadata": {
                        "title": "Fetch Attachment Size & MIME Type",
                        "type": "boolean",
                        "description": "For each attachment URL, do a HEAD request to fetch Content-Length (size) and Content-Type (MIME). Adds ~0.5s per attachment. Free (no additional charge). When off, you still get filename parsed from the URL.",
                        "default": false
                    },
                    "identify_incumbents": {
                        "title": "Identify Prior Winners ($0.15/opportunity)",
                        "type": "boolean",
                        "description": "For each opportunity, query USASpending for top 5 contractors who won similar work (same agency + NAICS) over the last 5 years. Output includes total won, contract count, and latest PoP end date per winner. No SAM.gov API calls; uses USASpending which has generous rate limits. Charges $0.15 per opportunity enriched.",
                        "default": false
                    },
                    "score_pwin": {
                        "title": "Calculate Bid/No-Bid PWin Score ($0.20/opportunity)",
                        "type": "boolean",
                        "description": "Compute a Probability-of-Win score (0-100) per opportunity based on NAICS fit, past performance, agency history, set-aside fit, competition count, and value range. Verdict: bid (>=70), conditional (50-69), no_bid (<50). Requires company_profile.past_awards for full scoring.",
                        "default": false
                    },
                    "extract_rfp_requirements": {
                        "title": "Extract RFP Compliance Matrix via LLM ($0.35/opportunity)",
                        "type": "boolean",
                        "description": "Download RFP attachment PDFs, extract every shall/must/will requirement via Gemini 2.5 Flash, and organize by section (L, M, SOW). Outputs a compliance matrix. Requires gemini_api_key. Charges $0.35 per opportunity where extraction succeeded.",
                        "default": false
                    },
                    "gemini_api_key": {
                        "title": "Gemini API Key (for RFP extraction)",
                        "type": "string",
                        "description": "Required if extract_rfp_requirements is enabled. Get a free key at https://aistudio.google.com/apikey. You pay Google for the LLM calls directly (typically $0.01-$0.02 per RFP)."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
