Discover/SAM API
live

SAM APIsam.gov ↗

Search and retrieve federal contract opportunity notices from SAM.gov. Access notice details, NAICS codes, award data, attachments, and revision history.

Endpoint health
verified 3h ago
search_opportunities
get_opportunity
list_opportunity_attachments
3/3 passing latest checkself-healing
Endpoints
3
Updated
4h ago

What is the SAM API?

This API provides access to SAM.gov federal contract opportunity notices across 3 endpoints. Use search_opportunities to run keyword searches against notice titles, descriptions, and solicitation numbers with optional NAICS code filtering, notice type filtering, and response deadline sorting. Full notice details — including award data, place of performance, points of contact, and complete HTML or plain-text descriptions — are available via get_opportunity.

This call costs1 credit / call— charged only on success
Try it
1-based results page.
Results per page, 1-100.
Result ordering: relevance ranking, most recently updated first, or soonest response deadline first.
NAICS code or code prefix, 2-6 digits (e.g. 541512). Omitted = no NAICS filter.
Natural-language keyword search text; matched against notice titles, descriptions, and solicitation numbers.
Whether to return only active notices, only inactive (archived/closed) notices, or both.
How the keywords are matched: all words present, any word present, or the exact phrase.
Single notice type code to restrict results to. Omitted = all notice types.
→ api.parse.bot/scraper/cc787065-d91e-4a91-a013-e892af2fabfe/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/cc787065-d91e-4a91-a013-e892af2fabfe/search_opportunities?page=2&size=5&sort=modified_date&query=cybersecurity&status=all&notice_type=o' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace sam-gov-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: SAM.gov contract opportunities — search, drill down, list attachments."""
from parse_apis.sam_gov_api import SamGov, SortOrder, NoticeType, InputNotFound

client = SamGov()

# Search active opportunities by keyword, capped to 5 total results.
for summary in client.opportunity_summaries.search(
    query="cybersecurity",
    sort=SortOrder.MODIFIED_DATE,
    notice_type=NoticeType.SOLICITATION,
    limit=5,
):
    print(summary.title, summary.organization.agency, summary.notice_type)

# Drill into the first result's full details via the typed summary→detail link.
summary = client.opportunity_summaries.search(query="cybersecurity", limit=1).first()
if summary is not None:
    opp = summary.details()
    print(opp.title, opp.status, opp.solicitation_number)
    print("NAICS:", opp.naics_codes)
    print("Place:", opp.place_of_performance.city, opp.place_of_performance.state)

    # Walk points of contact on the full opportunity.
    for contact in opp.points_of_contact:
        print(contact.full_name, contact.email)

    # List attached documents for this opportunity.
    for att in opp.attachments.list(limit=10):
        print(att.name, att.size_bytes, att.download_url)

# Point lookup by an id discovered from the search above.
if summary is not None:
    try:
        detail = client.opportunities.get(opportunity_id=summary.opportunity_id)
        print(detail.title, detail.response_deadline)
    except InputNotFound:
        print("Opportunity no longer available")

print("exercised: search / details / get / attachments.list")
All endpoints · 3 totalmissing one? ·

Keyword search over SAM.gov contract opportunity notices. Returns one page of notice summaries (title, notice type, dates, issuing organization, description snippet) plus total_results and total_pages from the site. Paging is caller-controlled: page (1-based, default 1) and size (1-100, default 25); has_more is true while page < total_pages. By default only active notices are returned; status widens to inactive or all. notice_type filters to a single notice type code, naics to a NAICS code prefix (2-6 digits). Sorting defaults to the site's relevance ranking. Keyword match mode defaults to all words. An empty results array with total_results 0 is a valid response for a term with no matches.

Input
ParamTypeDescription
pageinteger1-based results page.
sizeintegerResults per page, 1-100.
sortstringResult ordering: relevance ranking, most recently updated first, or soonest response deadline first.
naicsstringNAICS code or code prefix, 2-6 digits (e.g. 541512). Omitted = no NAICS filter.
queryrequiredstringNatural-language keyword search text; matched against notice titles, descriptions, and solicitation numbers.
statusstringWhether to return only active notices, only inactive (archived/closed) notices, or both.
match_modestringHow the keywords are matched: all words present, any word present, or the exact phrase.
notice_typestringSingle notice type code to restrict results to. Omitted = all notice types.
Response
{
  "type": "object",
  "fields": {
    "page": "1-based page returned",
    "size": "page size used",
    "query": "echo of the search text",
    "results": "array of notice summaries; opportunity_id is the key accepted by get_opportunity and list_opportunity_attachments",
    "has_more": "boolean, true when a later page exists",
    "total_pages": "integer total pages at this size",
    "total_results": "integer total matching notices reported by the site",
    "results[].organization": "object with department, agency, office names of the issuing office (nulls when the site omits a level)",
    "results[].response_date": "ISO datetime with offset of the response deadline, null when the notice has none",
    "results[].notice_type_code": "single-letter SAM.gov notice type code (see NoticeType enum)",
    "results[].modification_count": "integer number of published revisions"
  },
  "sample": {
    "data": {
      "page": 1,
      "size": 5,
      "query": "cybersecurity",
      "results": [
        {
          "url": "https://sam.gov/workspace/contract/opp/6c70e76fce4e449087a6b90f656b6d87/view",
          "title": "Cyber Platform",
          "is_active": true,
          "is_canceled": false,
          "notice_type": "Presolicitation",
          "organization": {
            "agency": "DEPT OF THE NAVY",
            "office": "NAVSUP FLT LOG CTR NORFOLK",
            "department": "DEPT OF DEFENSE"
          },
          "modified_date": "2026-08-18T14:06:51+00:00",
          "response_date": null,
          "opportunity_id": "6c70e76fce4e449087a6b90f656b6d87",
          "published_date": "2026-08-18T14:06:51+00:00",
          "notice_type_code": "p",
          "response_timezone": null,
          "modification_count": 0,
          "description_snippet": "NAVSUP Fleet Logistics Center Norfolk, Contracting Department, Pentagon Directorate intends to acquire, via small business set aside, a commercial cybersecurity training and certification platform for National Defense University (NDU), College of",
          "solicitation_number": "N0018926QD213"
        }
      ],
      "has_more": true,
      "total_pages": 169,
      "total_results": 842
    },
    "status": "success"
  }
}

About the SAM API

Search and Filter Contract Notices

search_opportunities accepts a required query string matched against notice titles, descriptions, and solicitation numbers on SAM.gov. Results can be filtered by naics code (2–6 digit prefix), notice_type code, and status (active, inactive, or both). The match_mode parameter controls whether the query matches all words, any word, or an exact phrase. Each result in the results array includes an opportunity_id — a 32-character hex identifier used by the other two endpoints — along with response_date, notice_type_code, and an organization object containing department, agency, and office names.

Full Notice Details

get_opportunity takes an opportunity_id and returns the complete record: naics_codes, set_aside_code, archive_date, status, and the full description in both description_html and description_text. When the notice is a contract award, the award object includes date, number, amount, awardee_name, and awardee_uei. The history array lists all revisions of the notice, newest first, each with its own opportunity_id, index, request_type, action_type, posted_date, and notice_type.

Attachments and Documents

list_opportunity_attachments returns all documents and external links attached to a notice in the site's display order. Each record in the attachments array includes type (file or link), size_bytes, download_url for uploaded files, uri for external links, and is_deleted to flag removed attachments. The attachment_count field gives the total count without iterating the array. File contents are not fetched — only the public SAM.gov download URL is returned.

Reliability & maintenanceVerified

The SAM API is a managed, monitored endpoint for sam.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when sam.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official sam.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
3h ago
Latest check
3/3 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Monitor new federal contract solicitations matching a specific NAICS code prefix for market intelligence
  • Track response deadline changes by comparing response_date across repeated searches on the same solicitation
  • Build a procurement pipeline tool that surfaces active set-aside opportunities using set_aside_code and status filters
  • Retrieve full award records including awardee_name, awardee_uei, and amount for competitive analysis
  • Enumerate all attachments on a solicitation notice before downloading RFP documents via their download_url
  • Audit notice revision history using the history array to see how a solicitation has changed over time
  • Filter opportunities to a specific federal agency by inspecting the organization.agency field in search results
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 req/min

Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does SAM.gov have an official developer API?+
Yes. SAM.gov offers official public APIs documented at https://open.gsa.gov/api/get-opportunities-public-api/. They require a registered API key and cover a subset of the contract opportunities data.
What does the `history` array in `get_opportunity` contain?+
It contains one entry per revision of the notice, ordered newest first. Each entry includes a separate opportunity_id for that revision, an index, request_type, action_type, posted_date, and notice_type. This lets you reconstruct the amendment history of a solicitation.
Does `search_opportunities` return notices from all SAM.gov notice types?+
By default it returns all notice types. You can restrict results to a single type using the notice_type parameter, which accepts a single SAM.gov notice type code. Multiple simultaneous notice type filters are not currently supported. You can fork the API on Parse and revise it to add multi-type filtering.
Does the API return the actual content of attached files?+
list_opportunity_attachments returns metadata and, for file attachments, a public download_url pointing to the SAM.gov file. The file content itself is not fetched or returned. You can fork the API on Parse and revise it to add an endpoint that retrieves file bytes from the provided URL.
Are there any data gaps to be aware of when using `get_opportunity`?+
The award object is null for any notice that is not an award notice. set_aside_code and archive_date may be null when the source notice omits them. Organization fields in search results (department, agency, office) may also be null if the issuing office record is incomplete on SAM.gov.
Page content last updated . Spec covers 3 endpoints from sam.gov.
Related APIs in Government PublicSee all →
purchasing.alberta.ca API
Access data from purchasing.alberta.ca.
simpler.grants.gov API
Search and discover federal funding opportunities available through Grants.gov, then retrieve detailed information about grants, loans, and other financial assistance programs that match your needs. Access comprehensive opportunity details including eligibility requirements, funding amounts, and application deadlines all in one place.
nbon-rpanb.gnb.ca API
Access data from nbon-rpanb.gnb.ca.
business.network.sap.com API
Search and browse public procurement opportunities and sourcing leads posted on SAP Business Network Discovery, then view the complete details of any posting that interests you. Find potential business opportunities without needing to log in or create an account.
mohawkmedbuy.ca API
Access data from mohawkmedbuy.ca.
usaspending.gov API
Access data from usaspending.gov.
eprocurement-sfd.uae.app.jaggaer.com API
Monitor and retrieve current procurement opportunities from the Sharjah Government Finance Department, including detailed information about each tender and project listing. Browse available bids to identify and track business opportunities in the Sharjah region.
buy.nsw.gov.au API
Search and retrieve NSW Government tender opportunities and contract notices from buy.nsw, including detailed information about available opportunities, supplier hubs, and procurement categories. Filter opportunities by category and discover top procurement deals in real-time to stay informed about potential business contracts with the NSW Government.