Search active SAM.gov contract opportunities by keyword and NAICS code and retrieve full solicitation details

domain: api.sam.gov · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register a free SAM.gov account and generate a public API key from the account settings page
  2. Send GET https://api.sam.gov/opportunities/v2/search with query params: api_key, keyword, naicsCode, postedFrom, postedTo, limit (max 1000), and ptype (e.g. 'o' for solicitation, 'a' for award)
  3. Paginate through results using the offset parameter; each page returns a _links object and totalRecords count
  4. Extract the noticeId from each result and send GET https://api.sam.gov/opportunities/v2/search?noticeid={id} to retrieve the full opportunity record including contacts, attachments, and place of performance
  5. Fetch linked attachment files by following the resourceLinks URLs returned in the full opportunity response
  6. Cache results with postedFrom/postedTo timestamps and poll daily near the 1000-request daily rate limit to capture new postings

Known gotchas

Related routes

Search SAM.gov for open federal highway/street/bridge construction (paving) contract opportunities by NAICS code.
api.sam.gov · 4 steps · unrated
Retrieve and analyze federal contract award data by NAICS code using the USAspending.gov API advanced search
usaspending.gov · 6 steps · unrated
Query the SAM.gov Entity Management API to retrieve and validate US government contractor entity data
sam.gov · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans