SAM.gov Contract Opportunities API Scraper avatar

SAM.gov Contract Opportunities API Scraper

Pricing

$3.00 / 1,000 result returneds

Go to Apify Store
SAM.gov Contract Opportunities API Scraper

SAM.gov Contract Opportunities API Scraper

US federal contract opportunities from the official SAM.gov API: solicitations, sources sought, awards, set-asides, NAICS, deadlines, contacts.

Pricing

$3.00 / 1,000 result returneds

Rating

0.0

(0)

Developer

Jason

Jason

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

4 days ago

Last modified

Share

Every US federal contract opportunity — solicitations, combined synopses, presolicitations, sources sought, special notices and award notices — pulled straight from the official SAM.gov Get Opportunities Public API v2 and delivered as flat, ready-to-use JSON, CSV or Excel. No HTML scraping and no unofficial mirror: the Actor calls the government endpoint that SAM.gov publishes for exactly this purpose, so what you get is what the contracting officer posted, including NAICS and PSC codes, set-aside program, response deadline, place of performance, award amounts and the contracting officer's name, email and phone. Point it at a date window, narrow it by industry or agency, and get a clean pipeline of federal bid leads into your CRM, spreadsheet or database.

You bring your own free SAM.gov API key (see Data source and licence); the Actor keeps its request count to the minimum so a personal key goes a long way.

What you get

One record per notice, flat camelCase fields:

  • Identity and linkid (SAM.gov noticeId), source, url (https://sam.gov/opp/{id}/view), uiLink, solicitationNumber, fetchedAt
  • The noticetitle, noticeType, baseType, postedDate, responseDeadline, archiveType, archiveDate, active
  • ClassificationnaicsCode, naicsCodes (all codes on the notice), classificationCode (PSC), setAside, setAsideDescription
  • Buying agencyagencyPath (full department → sub-tier → office path), agencyPathCode, department, subTier, office, organizationType, officeCity, officeState, officeZip, officeCountry
  • Where the work happensplaceOfPerformance (one readable line), popCity, popState, popZip, popCountry
  • Who to contactpointOfContact (full array as published) plus flattened primaryContactName, primaryContactEmail, primaryContactPhone
  • Award noticesawardDate, awardNumber, awardAmount (numeric), awardeeName, awardeeUei, awardeeCity, awardeeState
  • DocumentsdescriptionLink, description (full notice text, optional), additionalInfoLink, resourceLinks (attachment URLs)

Input

FieldTypeDefaultWhat it does
apiKeystring (secret)Required. Your own free SAM.gov public API key. Falls back to the SAM_API_KEY environment variable.
daysBackinteger7Fetch notices posted in the last N days. Ignored when dateFrom and dateTo are both set.
dateFrom / dateTostringExplicit posted-date window, YYYY-MM-DD. Max one year apart (a SAM.gov rule).
noticeTypesarray[] (all)Notice type codes: o Solicitation, k Combined Synopsis/Solicitation, p Presolicitation, r Sources Sought, a Award Notice, s Special Notice, u Justification, i Intent to Bundle, g Sale of Surplus. Full names such as Sources Sought also work.
keywordsarray[]Case-insensitive OR match over title, solicitation number, agency, NAICS, PSC, set-aside and awardee. A single keyword is pushed to the API as a title search; several are matched locally.
titlestringServer-side SAM.gov title search.
naicsCodesarray[]e.g. 541512. One full 6-digit code is sent to the API; several codes — or prefixes like 5415 — are matched locally against every NAICS code on the notice.
setAsidesarray[]Set-aside codes, e.g. SBA, 8A, HZC, SDVOSBC, WOSB, EDWOSB, VSA.
classificationCodestringProduct/Service Code (PSC), e.g. D310.
statestringTwo-letter place-of-performance state, e.g. TX.
zipstringPlace-of-performance ZIP.
organizationNamestringContracting organization name as SAM.gov spells it.
solicitationNumberstringFetch one solicitation by number.
noticeIdstringFetch one notice by its SAM.gov id.
responseDeadlineFrom / responseDeadlineTostringResponse-deadline window, YYYY-MM-DD. Use responseDeadlineFrom = today to skip closed notices.
activeOnlybooleanfalseDrop notices SAM.gov has archived.
fetchDescriptionsbooleanfalseAlso download the full notice text into description. Costs one extra API request per record — see Limits and freshness.
maxItemsinteger500Stop after this many results. This is also your cost cap.

Example input — open small-business IT solicitations in Texas from the last two weeks:

{
"apiKey": "<your SAM.gov key>",
"daysBack": 14,
"noticeTypes": ["o", "k"],
"naicsCodes": ["541512"],
"setAsides": ["SBA"],
"state": "TX",
"activeOnly": true,
"maxItems": 200
}

Output example

Illustrative — not a live capture. api.sam.gov is geo-restricted and answers every request from the machine this Actor was built on with an empty HTTP 404, so no record below came off the wire here. The JSON is GSA's own published example notice from the Get Opportunities API documentation, passed through this Actor's normalizeRecord(), so the field names, types and nesting are exactly what a run produces (pointOfContact and a few empty fields trimmed for length). Run the Actor with your own free key to see genuine records.

{
"id": "5b345bbb7127b91a3ad577b203fc6f68",
"source": "sam.gov",
"url": "https://sam.gov/opp/5b345bbb7127b91a3ad577b203fc6f68/view",
"title": "Historic Office Renovation",
"solicitationNumber": "47PF0018R0023",
"noticeType": "Award Notice",
"baseType": "Combined Synopsis/Solicitation",
"postedDate": "2018-05-04",
"responseDeadline": null,
"archiveType": "manual",
"naicsCode": "236220",
"naicsCodes": ["236220"],
"classificationCode": "Z",
"setAside": null,
"setAsideDescription": null,
"agencyPath": "GENERAL SERVICES ADMINISTRATION.FEDERAL ACQUISITION SERVICE.GSA/FAS CENTER FOR IT SCHEDULE PROG",
"agencyPathCode": "047.4732.47QTCA",
"department": "GENERAL SERVICES ADMINISTRATION",
"subTier": "PUBLIC BUILDINGS SERVICE",
"office": "PBS R5",
"organizationType": "OFFICE",
"officeCity": "CHICAGO",
"officeState": "IL",
"officeZip": "60604",
"placeOfPerformance": "517 E Wisconsin Ave, Milwaukee, WI 53202, USA",
"popCity": "Milwaukee",
"popState": "WI",
"popZip": "53202",
"primaryContactName": "Jesse L. Jones",
"primaryContactEmail": "jesse.jones@gsa.gov",
"primaryContactPhone": "2174941263",
"awardDate": "2018-05-04",
"awardNumber": "47PF0018C0066",
"awardAmount": 800620,
"awardeeName": "D.G. Beyer, Inc.",
"awardeeUei": "025114695AST",
"awardeeCity": "New Berlin",
"awardeeState": "WI",
"descriptionLink": "https://api.sam.gov/prod/opportunities/v1/noticedesc?noticeid=5b345bbb7127b91a3ad577b203fc6f68",
"active": true,
"fetchedAt": "2026-09-07T06:12:44.183Z"
}

Every run also writes a SUMMARY record to the key-value store with pushed, scanned, filteredOut, totalRecordsInWindow, requests (SAM.gov API calls used) and the resolved date window.

Pricing

Pay per result: $0.003 per opportunity returned, i.e. $3.00 per 1,000 results. Nothing is charged for a run that returns no results, and maxItems caps your spend exactly. Apify's free plan includes monthly usage credit, so small runs typically cost you nothing beyond that allowance; larger runs draw on your Apify plan as usual.

Data source and licence

  • Source: SAM.gov Get Opportunities Public API v2, operated by the US General Services Administration — https://api.sam.gov/opportunities/v2/search.
  • Licence: SAM.gov contract opportunity notices are works of the US federal government, not subject to domestic copyright, and are published as open data (see the Data.gov data policy). Use is subject to the SAM.gov terms of use and the GSA API terms on the page linked above. This Actor neither modifies nor re-hosts the data; it reformats the API response.
  • Your API key: sign in at sam.gov, open Account Details and choose Request API Key (the "Public API Key" on your profile). It is free, arrives immediately, and belongs to you — enter it in the apiKey field, where Apify stores it encrypted. It is never printed to the run log; the Actor redacts it from every URL and error message.
  • No affiliation: this Actor is an independent client of a public API. It is not endorsed by or affiliated with GSA or SAM.gov.

Limits and freshness

  • Freshness: notices appear here as soon as SAM.gov publishes them to the API — usually within minutes of the contracting officer posting. Schedule the Actor daily with daysBack: 2 for a reliable overlap.
  • Your daily key quota is the real limit. GSA rate-limits by role: 10 requests per day for a non-federal personal key, 1,000 per day for a federal user; entity-linked and system accounts get more. This Actor is built around that: it fetches 1,000 records per request (the API maximum), makes exactly one request when no local filter is needed, and never re-requests a page. Ten requests therefore reach up to 10,000 notices a day.
  • fetchDescriptions is the expensive option. SAM.gov serves the full notice text from a separate endpoint, one record at a time, and each download counts against the same daily quota. With a personal key, keep maxItems under 10 when you turn it on. Without it, you still get descriptionLink for every record.
  • Window rules: postedFrom and postedTo are mandatory at SAM.gov and may not be more than one year apart; the Actor validates this before spending a request.
  • Filters: single-value filters (one NAICS code, one set-aside, one title/keyword, state, ZIP, PSC, organization) are pushed to the API so it does the work. Multi-value filters are applied locally, which needs full 1,000-record pages — expect more requests when you combine several.
  • If a run returns nothing: SAM.gov answers HTTP 404 with an empty body both when no notice matches and when the caller's region is blocked. The Actor logs this clearly. Apify's US and EU runners are fine; some other regions are not.
  • Paging mode, still unverified against the live API. GSA documents offset as a page index, but some deployments treat it as a record offset. The Actor starts in the documented page-index mode and switches to record-offset mode when a second page comes back mostly duplicated (Detected record-offset paging in the log); both branches are covered by test/unit.test.js and test/e2e.test.js against a stubbed transport, and neither has yet been confirmed against a live HTTP 200 from api.sam.gov — no key exists on the build machine and the API is geo-blocked from it. After the first keyed live run, record which mode the log reported here, together with the run date and the region it ran from.
  • Retries: every request retries with exponential backoff on 429 and 5xx. If your daily quota runs out mid-run, the Actor delivers what it already has, records a warning in SUMMARY, and exits cleanly instead of failing.

Use cases

  • Federal bid pipeline — schedule a daily run filtered to your NAICS codes and set-aside eligibility, and push new solicitations straight into HubSpot, Salesforce or a Slack channel the morning they post.
  • Capture and teaming research — pull Sources Sought and Presolicitation notices to see what an agency intends to buy months before the RFP, with the contracting officer's email already in the row.
  • Competitive and pricing intelligence — collect Award Notices for your NAICS or PSC codes to track who is winning, at what dollar value, for which agency and where.

Support

Found a bug, a field that should be added, or a filter that behaves oddly? Open an issue on this Actor's Issues tab on Apify Store, including your input JSON and the run ID. Issues are answered within 14 days.