Gov Contracts Scraper avatar

Gov Contracts Scraper

Pricing

from $5.00 / 1,000 results

Go to Apify Store
Gov Contracts Scraper

Gov Contracts Scraper

Search U.S. federal contract opportunities, awards, and agencies from SAM.gov. Filter by keyword, NAICS code, set-aside type, state, agency, and more. Returns structured data including contacts, deadlines, award amounts, and direct SAM.gov links. Requires a free SAM.gov API key.

Pricing

from $5.00 / 1,000 results

Rating

0.0

(0)

Developer

Mick

Mick

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a day ago

Last modified

Categories

Share

Government Contracts Scraper

Search federal contract opportunities, awards, and agencies from SAM.gov -- structured, filterable, and ready for analysis. MCP-ready for AI agent integration.

What does it do?

Government Contracts Scraper pulls structured data from the SAM.gov public API, the official source for all U.S. federal contracting opportunities. You provide a free SAM.gov API key and search filters, and it returns clean, structured contract data. Returns consistent JSON -- ready for analysis, GovTech pipelines, or consumption by AI agents via MCP.

Use cases:

  • Government contracting -- find open solicitations matching your capabilities, NAICS codes, or set-aside categories
  • Competitive intelligence -- track which agencies are awarding contracts and to whom
  • Market research -- analyze federal spending patterns by agency, industry code, or region
  • Business development -- identify upcoming opportunities before competitors
  • Policy research -- study procurement trends, small business set-asides, and agency spending
  • AI agent tooling -- expose as an MCP tool so AI agents can search federal contracts, track awards, and monitor procurement activity in real time

Features

  • 3 modes: search opportunities, search awards, and federal entity lookup
  • Rich filtering: keyword, NAICS code, PSC code, set-aside type, state, ZIP, agency, date ranges, solicitation number
  • 9 procurement types: solicitations, pre-solicitations, combined synopsis, sources sought, awards, special notices, and more
  • 14 small business set-aside filters: 8(a), HUBZone, SDVOSB, WOSB, EDWOSB, and more
  • Contact extraction: primary contact name, email, and phone from each opportunity
  • Place of performance data (city, state, ZIP, country)
  • Award details for contract awards (awardee name, amount, date, UEI)
  • Automatic pagination through SAM.gov results (up to 10,000 records)
  • Rate limiting built in (1-second interval between requests)
  • Retry logic with exponential backoff on failures
  • State persistence -- survives Apify actor migrations mid-run
  • No proxies needed -- SAM.gov is a government API with no anti-bot measures

Prerequisites

You need a free SAM.gov public API key:

  1. Go to sam.gov and create an account (or sign in)
  2. Navigate to your Account Details page
  3. Request a Public API Key (instant, no approval needed)
  4. Paste the key into the scraper's apiKey input field

What data does it extract?

Opportunities and Awards:

FieldDescription
typeProcurement type (Solicitation, Pre-solicitation, Award Notice, etc.)
noticeIdSAM.gov notice ID
titleOpportunity title
solicitationNumberSolicitation/contract number
departmentFull agency path (e.g. "DEPT OF DEFENSE.DEPT OF THE ARMY...")
agencyMost specific agency name
postedDateDate posted
responseDeadlineResponse/offer deadline
archiveDateArchive date
activeWhether the opportunity is currently active
naicsCodeNAICS industry code
classificationCodeProduct Service Code (PSC)
setAsideSmall business set-aside description
placeOfPerformanceCity, state, ZIP, country
contactNamePrimary point of contact name
contactEmailContact email
contactPhoneContact phone
officeAddressContracting office city, state, ZIP
descriptionUrlLink to full description
uiLinkDirect link to SAM.gov listing
awardDateAward date (award notices only)
awardNumberAward contract number (award notices only)
awardAmountAward dollar amount (award notices only)
awardeeNameWinning contractor name (award notices only)
awardeeUeiWinning contractor UEI (award notices only)

Organizations (Entity Lookup mode):

FieldDescription
typeAlways "organization"
orgKeyOrganization key
nameOrganization name
codeOrganization code (use this in search filters)
levelHierarchy level
parentNameParent organization name
parentCodeParent organization code
descriptionOrganization description
cgacCGAC code

Input

Choose a scraping mode and provide your SAM.gov API key along with any search filters.

Mode 1: Search Opportunities

Search for open contract opportunities (solicitations, pre-solicitations, sources sought, etc.).

{
"apiKey": "YOUR_SAM_GOV_API_KEY",
"mode": "search_opportunities",
"keyword": "cybersecurity",
"maxResults": 100
}

Filter by NAICS code and set-aside type:

{
"apiKey": "YOUR_SAM_GOV_API_KEY",
"mode": "search_opportunities",
"keyword": "cloud migration",
"naicsCode": "541512",
"setAside": "SBA",
"state": "VA",
"maxResults": 200
}

Mode 2: Search Awards

Search for contract award notices to see who won and for how much.

{
"apiKey": "YOUR_SAM_GOV_API_KEY",
"mode": "search_awards",
"keyword": "artificial intelligence",
"maxResults": 100
}

Mode 3: Entity Lookup

Look up federal agencies and organizations. Useful for finding organization codes to use as search filters.

{
"apiKey": "YOUR_SAM_GOV_API_KEY",
"mode": "entity_lookup",
"organizationName": "Department of Defense"
}

Search Filters

All filters apply to Mode 1 and Mode 2. Leave blank for no filtering.

ParameterDescription
keywordSearch keyword for opportunity titles and descriptions
solicitationNumberSearch by specific solicitation number
procurementTypeFilter by type: Solicitation, Pre-solicitation, Combined Synopsis, Sources Sought, Award Notice, Special Notice, Sale of Surplus, Justification, Intent to Bundle
naicsCodeNAICS industry code (up to 6 digits, e.g. 541512 for Computer Systems Design)
classificationCodeProduct Service Code / PSC (e.g. 7030 for ADP Software)
setAsideSmall business set-aside type (SBA, 8(a), HUBZone, SDVOSB, WOSB, EDWOSB, etc.)
state2-letter state code for place of performance (e.g. VA, CA, TX)
zipZIP code for place of performance
organizationCodeFederal agency/organization code (use Entity Lookup mode to find codes)
postedFromStart date for posted range (MM/dd/yyyy). Defaults to 30 days ago
postedToEnd date for posted range (MM/dd/yyyy). Defaults to today
responseDeadlineFromFilter by response deadline start (MM/dd/yyyy)
responseDeadlineToFilter by response deadline end (MM/dd/yyyy)

Additional Options

ParameterDefaultDescription
maxResults100Maximum results to return (max 10,000). Free users are limited to 25 per run.

Output

Results are saved to the default dataset. Download them in JSON, CSV, Excel, or XML format from the Output tab.

Example: Opportunity output

{
"type": "Solicitation",
"noticeId": "abc123def456",
"title": "Cybersecurity Assessment Services",
"solicitationNumber": "W911NF-26-R-0042",
"department": "DEPT OF DEFENSE.DEPT OF THE ARMY.ACC-APG NATICK",
"agency": "ACC-APG NATICK",
"postedDate": "2026-02-01",
"responseDeadline": "2026-03-15",
"archiveDate": "2026-04-15",
"active": "Yes",
"naicsCode": "541512",
"classificationCode": "D310",
"setAside": "Total Small Business Set-Aside",
"setAsideCode": "SBA",
"placeOfPerformance": {
"city": "Natick",
"state": "MA",
"zip": "01760",
"country": "US"
},
"contactName": "Jane Smith",
"contactEmail": "jane.smith@army.mil",
"contactPhone": "508-555-0199",
"officeAddress": {
"city": "Natick",
"state": "MA",
"zip": "01760"
},
"descriptionUrl": "https://sam.gov/api/prod/opps/v3/opportunities/resources/...",
"resourceLinks": [],
"uiLink": "https://sam.gov/opp/abc123def456/view",
"awardDate": "",
"awardNumber": "",
"awardAmount": "",
"awardeeName": "",
"awardeeUei": ""
}

Example: Award output

{
"type": "Award Notice",
"noticeId": "xyz789ghi012",
"title": "Cloud Infrastructure Modernization",
"solicitationNumber": "FA8750-26-C-0001",
"department": "DEPT OF DEFENSE.DEPT OF THE AIR FORCE.AFMC",
"agency": "AFMC",
"postedDate": "2026-01-20",
"responseDeadline": "",
"archiveDate": "2026-04-20",
"active": "Yes",
"naicsCode": "541519",
"classificationCode": "7030",
"setAside": "",
"setAsideCode": "",
"placeOfPerformance": {
"city": "Rome",
"state": "NY",
"zip": "13441",
"country": "US"
},
"contactName": "John Doe",
"contactEmail": "john.doe@us.af.mil",
"contactPhone": "",
"officeAddress": {
"city": "Rome",
"state": "NY",
"zip": "13441"
},
"descriptionUrl": "",
"resourceLinks": [],
"uiLink": "https://sam.gov/opp/xyz789ghi012/view",
"awardDate": "2026-01-15",
"awardNumber": "FA8750-26-C-0001",
"awardAmount": "4500000",
"awardeeName": "Acme Federal Solutions LLC",
"awardeeUei": "ABC1DEF2GHI3"
}

Example: Organization output

{
"type": "organization",
"orgKey": "100000000",
"name": "DEPARTMENT OF DEFENSE",
"code": "097",
"level": "1",
"parentOrgKey": "",
"parentName": "",
"parentCode": "",
"description": "",
"startDate": "",
"endDate": "",
"cgac": "097",
"fpdsOrgId": "9700",
"fhOrgId": "300000000"
}

Cost

This actor uses pay-per-event (PPE) pricing. You pay only for the results you get.

  • $0.50 per 1,000 results ($0.0005 per result)
  • No proxy costs -- SAM.gov is a government API, no proxies needed
  • Free tier: 25 results per run (no subscription required)

SAM.gov API requests are fast. A typical run fetching 100 opportunities completes in under a minute.


Technical details

  • Uses the SAM.gov public Opportunities API (api.sam.gov/opportunities/v2/search)
  • Federal Hierarchy API for entity lookup (api.sam.gov/prod/federalorganizations/v1/orgs)
  • API key passed as query parameter (standard SAM.gov authentication)
  • Rate limited to 1 request/second (respects government API guidelines)
  • Automatic retry with exponential backoff on failures
  • Offset-based pagination (up to 1,000 results per page, 10,000 max depth)
  • Results pushed in batches of 25 for efficiency
  • Actor state persisted across migrations
  • No proxies, no browser, no cookies -- direct API access

Limitations

  • SAM.gov requires the postedFrom and postedTo date range to be within 1 year. The scraper defaults to the last 30 days if no dates are provided.
  • Maximum pagination depth is 10,000 results per run.
  • The SAM.gov API occasionally returns empty pages; the scraper tolerates up to 2 consecutive empty pages before stopping.
  • Entity Lookup mode returns a maximum of 100 organizations per query.
  • You need your own SAM.gov API key (free, but requires registration).

FAQ

How do I get a SAM.gov API key?

Go to sam.gov, create a free account, then navigate to Account Details and request a Public API Key. It is issued instantly.

Is this data public?

Yes. All data returned by this scraper comes from the SAM.gov public API, which is the U.S. government's official system for posting federal contracting opportunities. This data is publicly available by law.

What is a NAICS code?

NAICS (North American Industry Classification System) codes categorize businesses by industry. Common examples: 541512 (Computer Systems Design), 541511 (Custom Computer Programming), 541519 (Other Computer Related Services). You can search by code to find contracts in your industry.

What are set-aside types?

The federal government reserves certain contracts for small businesses. Set-aside types include Small Business (SBA), 8(a) for disadvantaged businesses, HUBZone for businesses in historically underutilized areas, SDVOSB for service-disabled veteran-owned businesses, WOSB for women-owned businesses, and more.

Why are some fields empty in award notices?

Award notices may not include all fields that solicitations have (like response deadlines), and solicitations will not have award-specific fields (like award amount or awardee name). This is normal -- the fields are only populated when relevant.

Can I use this with the Apify API?

Yes. Call the actor via the Apify API and retrieve results programmatically in JSON, CSV, or other formats. Works with the Apify Python and JavaScript clients.


MCP Integration

This actor works as an MCP tool through Apify's hosted MCP server. No custom server needed.

  • Endpoint: https://mcp.apify.com?tools=labrat011/gov-contracts-scraper
  • Auth: Authorization: Bearer <APIFY_TOKEN>
  • Transport: Streamable HTTP
  • Works with: Claude Desktop, Cursor, VS Code, Windsurf, Warp, Gemini CLI

Example MCP config (Claude Desktop / Cursor):

{
"mcpServers": {
"gov-contracts-scraper": {
"url": "https://mcp.apify.com?tools=labrat011/gov-contracts-scraper",
"headers": {
"Authorization": "Bearer <APIFY_TOKEN>"
}
}
}
}

AI agents can use this actor to search federal contract opportunities, track award notices, look up agencies, and monitor procurement activity -- all as a callable MCP tool.


Feedback

Found a bug or have a feature request? Open an issue on the actor's Issues tab in Apify Console.