ActorStack.dev

How to scrape SAM.gov federal contract opportunities without an API key

A walkthrough of extracting U.S. federal contract notices: which filters actually narrow the index, how to get the solicitation documents, and why there are three deadline fields.

By Oswaldo Carabano9 min read

Short answer

SAM.gov contract notices can be read without an API key or a login, because the same endpoint the site's own search page uses is public. Sweeping is by publication date at about 2,500 notices per day, and the filters that matter are notice type, PSC or NAICS code, set-aside and agency. Turn on attachments to get the solicitation documents themselves — 36.7% of active notices carry at least one downloadable file.

Key points

  • No API key, no registration, no login: the endpoint the SAM.gov search page uses is public.
  • 5,591,183 notices in the index back to 2000, of which 49,702 are active and about 2,500 are published per calendar day.
  • PSC codes are present on 97.8% of notices and NAICS on 96.1%, so PSC is the marginally better classification filter.
  • Attachments are opt-in and cost one extra request per notice; 36.7% ± 4.6 of active notices carry a downloadable file.
  • Rows are deduplicated by `notice_id` before delivery, so a duplicate is never charged.
On this page9 sections

SAM.gov holds every U.S. federal contract opportunity — 5,591,183 notices back to 2000, about 49,702 active at any moment, roughly 2,500 published a day. It is the largest genuinely public procurement dataset in the world, and the main obstacle to using it is that most tooling asks you to register for a key first.

Why there is no API key to get

There is an official keyed API, and there is also the endpoint the SAM.gov search page itself calls. The second is public and needs no credential, which is what this Actor uses: nothing to register for, nothing to renew, no quota that runs out mid-run. Why that distinction matters.

Step 1 — choose the time window

Sweeping is by publication date, one calendar day per request, newest first. publishedWithinDays defaults to 7; publishedFrom and publishedTo override it for a fixed range.

activeOnly defaults to true, which is the ~49,700 notices still open or recently awarded. Turn it off to reach the 5.6-million-notice archive — useful for research, unnecessary for monitoring.

Step 2 — narrow with the filters that are well filled

FilterPresent onNotes
pscCodes97.8%The product or service being bought. Marginally the better filter.
naicsCodes96.1%The industry of the supplier.
setAsideCodes46.1%Absence means open competition, not missing data.
agencyIds99.4%Changes attachment rates more than notice type does.
officeStatesBetter filled than place of performance.
placeOfPerformanceStates~33%Only about a third of notices state one.

All of these filter server-side, so a notice they exclude is never delivered and never charged. NAICS or PSC covers the choice between the two classification systems.

Step 3 — decide about documents

scrapeAttachments adds the attachment list to every notice at one extra request each. Before turning it on for a large run, note the hit rate: 36.7% ± 4.6 of active notices carry a real file, and it swings from ~100% at Veterans Affairs to ~28% at the Department of Defense.

Step 4 — run it

input.json
{
  "maxResults": 500,
  "activeOnly": true,
  "publishedWithinDays": 7,
  "noticeTypes": ["o", "k"],
  "naicsCodes": ["541511"],
  "setAsideCodes": ["SBA"],
  "scrapeAttachments": true
}

Notice types o (Solicitation) and k (Combined Synopsis/Solicitation) are the ones that carry documents and represent live opportunities. Rows are deduplicated by notice_id before delivery, so a duplicate is never charged.

Reading the deadline correctly

There are three deadline fields, and using the wrong one puts fictional times in your calendar. response_due_precision is instant on 61.0% of deadlines — only then is response_due_utc a true instant you can convert. On the 38.8% that are date-only, SAM.gov stamps midnight UTC and this Actor refuses to pass that through. Why there are three.

Reading the output

62 fields, snake_case, null where a value is genuinely absent and never a missing key — so row.award_amount is safe on every row. Contact email is at 99.2% and contact phone at 32.7%, which tells you which channel the data actually supports.

Award fields sit at ~23% of all notices because most notices are not awards; within award notices they are effectively always present. The full field reference.

What a run costs

$0.0025 per notice, $0.0005 per attachment listed, $0.0005 per exclusion record, $0.00001 to start. Five hundred notices with attachments is about $1.50. You are not charged for error rows and not charged for duplicates, and charging happens as each row is delivered rather than in a batch.

Notices are immutable once published — an amendment creates a new notice that links back — so cached rows stay correct and maxCacheAgeDays defaults to a generous 90.

Four mistakes that waste a run

  1. Scheduling against a date-only deadline. Midnight UTC is not when the bid is due.
  2. Enabling attachments on award notices. 14% hit rate, one request each.
  3. Filtering on place of performance. Only about a third of notices state one, so you silently drop two thirds.
  4. Treating an absent set-aside as missing data. It means open competition.

Frequently asked questions

Do I need a SAM.gov API key?
No. This Actor uses the same public endpoint the SAM.gov search page itself uses, so there is nothing to register for and nothing to renew. Scrapers that require you to bring an api.sam.gov key hand you the quota problem as well.
How far back does the data go?
To 2000 — 5,591,183 notices. About 49,702 are active at any time, and roughly 2,500 are published per calendar day. Turn off `activeOnly` to reach the archive.
Can I download the solicitation documents?
Yes, with `scrapeAttachments`. Every notice then carries an `attachments[]` array with names, sizes, MIME types and stable unsigned URLs. About 36.7% of active notices have at least one real file; the rest link to an agency portal or have nothing.
Is NAICS or PSC the better filter?
PSC, marginally: it is present on 97.8% of notices against 96.1% for NAICS. Use both if you know both, and note that a set-aside code is present on only 46.1%.

Sources

Every URL below was requested and returned a page on the date shown.

  1. Operator claimchecked 19 Aug 2026
    SAM.gov Federal Contract Opportunities & Attachments — Actor README and input schemaActorStack / Apify Store
  2. Site declarationchecked 19 Aug 2026
    sam.gov/robots.txtSAM.gov (U.S. General Services Administration)
  3. Operator claimchecked 19 Aug 2026
    Contract OpportunitiesSAM.gov (U.S. General Services Administration)
  4. Platform docschecked 19 Aug 2026
    Get Opportunities Public APIGSA Open Technology
The dome of the United States Capitol against a clear sky.
SAM.govGuide

Opportunity monitoring

A working monitoring pipeline: what to filter, how often to run, which deadline field to schedule against, and where the attachment rate changes your plan.

8 min
A desk with stacked legal reference books, loose documents and a newspaper.
SAM.govExplainer

Is it legal?

Federal notices are published because the law requires agencies to publicise them, and U.S. Government works carry no copyright. That settles more than usual — and not everything.

7 min
A shelf of office binders with dated labels along their spines.
SAM.govExplainer

NAICS vs PSC

Two classification systems on the same notice, describing different things. One is better filled, and the difference decides which one your pipeline should key on.

6 min