SAM.gov Government Contracts Scraper
Pricing
Pay per event
SAM.gov Government Contracts Scraper
Find active SAM.gov contract opportunities with agencies, NAICS/PSC codes, contacts, deadlines, descriptions, and official notice links.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
Find and export public U.S. federal contract opportunities from SAM.gov. This actor searches SAM.gov opportunity notices, follows pagination, and saves clean structured records with agency, office, NAICS, PSC, dates, contacts, descriptions, and direct SAM.gov links.
Use it when you need a repeatable feed of federal procurement opportunities for sales research, bid monitoring, capture management, compliance checks, market intelligence, or internal lead routing.
What does SAM.gov Government Contracts Scraper do?
The actor collects public opportunity search results from SAM.gov and turns them into a normalized Apify dataset.
It can:
- 🔎 Search by keyword or phrase.
- 🏛️ Filter to active opportunities.
- 📄 Filter by SAM.gov notice type codes.
- 🧭 Filter by NAICS or PSC code.
- ⏱️ Sort by recently modified or recently published notices.
- 📬 Extract contact names, emails, and phone numbers when SAM.gov provides them.
- 🧾 Save cleaned plain-text descriptions for spreadsheet and CRM workflows.
- 🔗 Include direct SAM.gov detail URLs for verification.
Who is it for?
Government contractors
Track active solicitations, combined synopsis notices, presolicitations, and award notices for target keywords and classification codes.
Business development teams
Build daily or weekly opportunity lists for account executives, capture managers, proposal teams, and partner managers.
Market researchers
Analyze which agencies, offices, and NAICS categories are publishing contract opportunities in your market.
Procurement analysts
Monitor federal buying activity, response deadlines, and agency demand without manually refreshing SAM.gov searches.
Data teams
Use the Apify API, integrations, and webhooks to load government opportunity data into warehouses, CRMs, dashboards, or alerting systems.
Why use this actor?
- ✅ HTTP-only implementation keeps runs lightweight and affordable.
- ✅ No SAM.gov account or user API key is required for the public search endpoint.
- ✅ Dataset fields are designed for spreadsheet, CRM, and BI exports.
- ✅ Pagination is handled automatically until your
maxItemslimit is reached. - ✅ Contact fields are split into clean arrays.
- ✅ Plain-text description is included by default.
- ✅ Raw HTML description can be enabled only when needed.
Typical use cases
- Daily feed of new active opportunities for
cybersecurity. - Weekly search for NAICS
541511software development opportunities. - PSC-specific monitoring for vehicles, facilities, logistics, IT, or professional services.
- Capture team routing by agency or office.
- Market sizing by agency, NAICS code, notice type, and deadline.
- Contract opportunity enrichment before human review.
How much does it cost to scrape SAM.gov government contracts?
The actor uses pay-per-event pricing with a small run-start event and a per-opportunity event. You only pay for opportunities saved to the dataset, plus the standard Apify platform usage included in the actor run.
A small monitoring run can request 25 opportunities. Larger research runs can request hundreds or thousands of opportunities depending on the search result volume available from SAM.gov.
Final tiered pricing is calculated from cloud validation runs before store publication so the actor remains sustainable while staying predictable for users.
Input configuration
| Field | Type | Default | Description |
|---|---|---|---|
query | string | truck prefill | Keyword or phrase to search. Leave empty for newest active notices. |
maxItems | integer | 50 | Maximum number of opportunities to save. |
activeOnly | boolean | true | Return only active opportunities. |
noticeTypes | array | o, k prefill | SAM.gov notice type codes. |
naicsCode | string | empty | Optional NAICS code filter. |
pscCode | string | empty | Optional Product Service Code filter. |
sort | string | -modifiedDate | SAM.gov sort expression. |
includeHtmlDescription | boolean | false | Include raw HTML notice description. |
Example input
{"query": "truck","maxItems": 25,"activeOnly": true,"noticeTypes": ["o", "k"],"sort": "-modifiedDate","includeHtmlDescription": false}
Output data
Each dataset item is one SAM.gov opportunity notice.
| Field | Description |
|---|---|
id | SAM.gov opportunity identifier. |
title | Opportunity title. |
solicitationNumber | Solicitation or notice number. |
noticeType | Human-readable notice type. |
noticeTypeCode | SAM.gov notice type code. |
active | Whether the notice is active. |
canceled | Whether the notice is canceled. |
publishDate | Publication date. |
modifiedDate | Last modified date. |
responseDate | Response deadline when available. |
archiveDate | Archive date when available. |
department | Department name. |
agency | Agency name. |
office | Office name. |
naicsCodes | NAICS code array. |
naicsTitles | NAICS title array. |
pscCodes | PSC code array. |
pscTitles | PSC title array. |
placeOfPerformance | Flattened place of performance. |
contactNames | Contact names. |
contactEmails | Contact emails. |
contactPhones | Contact phone and fax values. |
descriptionText | Cleaned plain-text description. |
descriptionHtml | Optional original HTML description. |
samUrl | Direct SAM.gov detail URL. |
source | Source endpoint. |
Example output
{"id": "69c370d6849a4783bcacbd43075693e9","title": "Request for Quote - Supply Pickup Truck Vehicles","solicitationNumber": "19LA9026Q0010","noticeType": "Combined Synopsis/Solicitation","noticeTypeCode": "k","active": true,"canceled": false,"publishDate": "2026-06-17T04:59:02+00:00","responseDate": "2026-07-18T03:59:00+00:00","department": "STATE, DEPARTMENT OF","agency": "STATE, DEPARTMENT OF","office": "U.S. EMBASSY VIENTIANE","naicsCodes": ["336110"],"pscCodes": ["2310"],"placeOfPerformance": "Vientiane, LAO","contactEmails": ["VientianeProcurement@state.gov"],"samUrl": "https://sam.gov/opp/69c370d6849a4783bcacbd43075693e9/view"}
How to run it
- Open the actor on Apify.
- Enter a keyword, NAICS code, PSC code, or leave the query empty.
- Set
maxItemsto the number of opportunities you want. - Keep
activeOnlyenabled for live pipeline monitoring. - Run the actor.
- Export results as JSON, CSV, Excel, XML, RSS, or HTML.
Search tips
- Use broad keywords first, then narrow with NAICS or PSC codes.
- Use
activeOnly: truefor bid monitoring. - Use
activeOnly: falseonly when you need historical or archived notices available in search. - Use notice type
ofor solicitations. - Use notice type
kfor combined synopsis/solicitation notices. - Use notice type
pfor presolicitations. - Use notice type
awhen researching awards. - Keep
maxItemssmall for first tests, then scale once filters look right.
Notice type examples
SAM.gov uses short notice type codes. Common examples include:
o— Solicitation.k— Combined Synopsis/Solicitation.p— Presolicitation.a— Award Notice.r— Sources Sought.s— Special Notice.
The exact codes shown by SAM.gov may evolve. If a code stops returning expected records, run a broad keyword search and inspect the noticeTypeCode output values.
Integrations
You can connect the actor to:
- 📊 Google Sheets for daily opportunity lists.
- 🧰 Airtable for capture pipeline intake.
- 🧾 HubSpot, Salesforce, or Pipedrive via Apify webhooks and Make/Zapier.
- 🏢 Data warehouses such as BigQuery, Snowflake, or Postgres.
- 🔔 Slack or email alerts for new matching notices.
- 🧪 Internal scoring pipelines that rank opportunities by agency, deadline, or classification code.
API usage
Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('automation-lab/samgov-government-contracts-scraper').call({query: 'cybersecurity',maxItems: 50,activeOnly: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items.slice(0, 3));
Python
from apify_client import ApifyClientimport osclient = ApifyClient(os.environ['APIFY_TOKEN'])run = client.actor('automation-lab/samgov-government-contracts-scraper').call(run_input={'query': 'construction','maxItems': 50,'activeOnly': True,})items = client.dataset(run['defaultDatasetId']).list_items().itemsprint(items[:3])
cURL
curl -X POST 'https://api.apify.com/v2/acts/automation-lab~samgov-government-contracts-scraper/runs?token=YOUR_APIFY_TOKEN' \-H 'Content-Type: application/json' \-d '{"query":"truck","maxItems":25,"activeOnly":true}'
MCP usage
Use the Apify MCP server to call this actor from AI tools.
MCP URL:
https://mcp.apify.com/?tools=automation-lab/samgov-government-contracts-scraper
Claude Code setup:
$claude mcp add apify-samgov "https://mcp.apify.com/?tools=automation-lab/samgov-government-contracts-scraper"
Claude Desktop JSON config:
{"mcpServers": {"apify-samgov": {"url": "https://mcp.apify.com/?tools=automation-lab/samgov-government-contracts-scraper"}}}
Example prompts:
- "Find 20 active SAM.gov opportunities for cybersecurity and summarize the agencies."
- "Search SAM.gov for NAICS 541511 and list response deadlines."
- "Collect active vehicle procurement notices and highlight contact emails."
Data quality notes
SAM.gov records vary by agency and notice type. Some notices have complete contact information and long descriptions, while others have minimal metadata. This actor preserves available values and uses empty arrays or nulls when SAM.gov does not provide a field.
Limitations
- The actor currently collects search result data returned by the public SAM.gov endpoint.
- It does not download attachments.
- It does not log in to SAM.gov.
- It does not submit bids or interact with procurement workflows.
- SAM.gov can change filters and response fields without notice.
FAQ
Is this an official SAM.gov product?
No. This is an independent Apify actor that extracts publicly available SAM.gov opportunity search data. Always verify procurement decisions on the official SAM.gov notice.
Does it require a SAM.gov account?
No. The actor uses public SAM.gov opportunity search data and does not ask for SAM.gov credentials.
Troubleshooting
Why did I get fewer results than maxItems?
SAM.gov may have fewer matching records for your keyword and filters. Try a broader query, remove NAICS/PSC filters, or disable specific notice type filters.
Why are some contact fields empty?
Not every notice includes public contacts in the search response. The actor exports contacts when SAM.gov includes them.
Why is the description shorter than the notice page?
The default descriptionText field is cleaned from the search response description. Enable includeHtmlDescription if you want the raw HTML body returned by the endpoint.
Legality and responsible use
This actor collects publicly available SAM.gov opportunity search data. Use the data responsibly, respect SAM.gov terms and applicable laws, and verify important procurement details on the official SAM.gov notice before making business decisions.
Related scrapers
Other Automation Lab actors that can complement government contract research:
- https://apify.com/automation-lab/website-contact-finder
- https://apify.com/automation-lab/google-maps-lead-finder
- https://apify.com/automation-lab/linkedin-company-scraper
- https://apify.com/automation-lab/indeed-jobs-scraper
Changelog
0.1
- Initial SAM.gov opportunity search scraper.
- Extracts notices, dates, agency hierarchy, NAICS/PSC data, contacts, descriptions, and SAM.gov links.
Support
If a run fails or returns unexpected data, include your input JSON and run ID when asking for help. This makes it much easier to reproduce the search and compare it with SAM.gov.