What the SAM.gov API covers
The API family at api.sam.gov exposes the data behind SAM.gov itself. The three you will actually use:
- Get Opportunities (
/opportunities/v2/search): active and archived contract opportunities: solicitations, presolicitations, combined synopsis/solicitations, sources sought, special notices, and award notices. - Entity Management (
/entity-information/v3/entities): registration records: legal business name, UEI, CAGE code, status, NAICS, and points of contact. - Exclusions (
/entity-information/v4/exclusions): debarred and excluded parties.
Step 1: get your API key
Sign in at SAM.gov, open Account Details, and request a Public API Key. Keys are issued via api.data.gov and displayed once. That single key works across the public SAM.gov APIs, passed as an api_key query parameter.
Step 2: query Get Opportunities
curl -G "https://api.sam.gov/opportunities/v2/search" \
--data-urlencode "api_key=YOUR_KEY" \
--data-urlencode "postedFrom=01/01/2026" \
--data-urlencode "postedTo=07/01/2026" \
--data-urlencode "ncode=541512" \
--data-urlencode "ptype=o,k" \
--data-urlencode "state=VA" \
--data-urlencode "limit=100" \
--data-urlencode "offset=0"The parameters that matter:
postedFrom/postedTo: required, MM/dd/yyyy, max one year apart.ptype: notice type:osolicitation,ppresolicitation,kcombined synopsis/solicitation,rsources sought,sspecial notice,aaward notice.ncode(NAICS),state,zip,typeOfSetAside,title,solnum,rdlfrom/rdlto(response deadline window).limitup to 1000,offsetfor paging;totalRecordsin the response tells you when to stop.
The gotchas nobody documents
- The description is a URL, not text. Each notice’s
descriptionfield points at another authenticated endpoint. Full text costs a second call per notice, and attachments (resourceLinks) are more calls again. - The daily rate limit is brutal on personal keys. Non-federal accounts get on the order of ten Get Opportunities calls per day; system accounts get about a thousand. A naive backfill burns the budget instantly, so cache aggressively and paginate deliberately.
- Amendments create churn. Notices are updated and re-posted; deduplicate by
noticeIdand tracksolicitationNumberacross versions or your dataset drifts. - SAM.gov is federal-prime only. No state, local, or education procurement, no DLA DIBBS solicitations, no GSA eBuy RFQs: those live in entirely separate systems.
When the raw API is enough, and when it is not
For a personal dashboard, a low-volume alert script, or research, the raw API is genuinely fine. The moment you need full descriptions at scale, joined award history, state and local coverage, or an AI agent operating on the data, you are signing up to build ingestion, dedup, enrichment, and rate-limit orchestration as a permanent side project. That pipeline is exactly what the CLEATUS API already runs: SAM.gov plus 40,000+ SLED sources, USASpending, and FPDS, normalized and served with AI-ranked recommendations, over REST and MCP for agents.
