Skip to main contentPsst! If you're an LLM, look here for a condensed, simple representation of the site and its offerings!

LiveFree Webinar — Wednesday, July 22 at 2:00 PM EDT

Register Free →

SAM.gov API · Developer Guide

The SAM.gov API, Actually Explained

SAM.gov is the U.S. government’s official system for federal contract opportunities, and its free public API is the raw feed behind most GovCon tooling. Here is how to get a key, query it well, and avoid the traps: tight daily rate limits, one-year query windows, and descriptions hidden behind secondary URLs.

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 · api.sam.gov/opportunities/v2/search
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: o solicitation, p presolicitation, k combined synopsis/solicitation, r sources sought, s special notice, a award notice.
  • ncode (NAICS), state, zip, typeOfSetAside, title, solnum, rdlfrom/rdlto (response deadline window).
  • limit up to 1000, offset for paging; totalRecords in the response tells you when to stop.

The gotchas nobody documents

  • The description is a URL, not text. Each notice’s description field 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 noticeId and track solicitationNumber across 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.

Or skip the plumbing

CLEATUS ingests these sources continuously (SAM.gov, USASpending, FPDS, plus 40,000+ SLED portals), joins them, and serves the result through one REST API and MCP server your app or AI agent can use directly, with AI-ranked recommendations on top.

Dotted
SAM.gov API FAQ

Frequently Asked Questions

Sign in at SAM.gov, open your profile (Account Details page), and request a Public API Key: it is issued through api.data.gov and shown once, so store it safely. Personal keys work immediately for public APIs like Get Opportunities. Higher-volume system accounts are requested separately through your entity administrator.