Microproduct data guideintermediate

SAM.gov Contract Opportunities

Current U.S. federal procurement notices for building opportunity monitors, deadline alerts, and focused market-discovery tools.

At a glance

Difficulty
Intermediate — some data preparation helps
Size
Small · ≤0.1 GB
Formats
JSON
Access
API
API key
Required
Provider
U.S. General Services Administration
Updates
Daily
Data terms
U.S. Government public data / GSA reuse guidance

From source to product signal

Test a product idea in four steps

The SAM.gov Opportunities API publishes federal procurement notices and their current deadlines. Start with one NAICS code and a 30-day posting window. Date windows are required, notices can be revised, deadlines can change, and the public API exposes only the latest active version rather than a complete revision history.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • A SAM.gov public API key saved in the SAM_API_KEY environment variable
2

Access the data

  1. 1.Create a SAM.gov account and request a public API key from Account Details.
  2. 2.Save the key in the SAM_API_KEY environment variable.
  3. 3.Choose one documented NAICS code and request notices posted within a bounded date window.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas requests

import os
from datetime import date, timedelta
import pandas as pd
import requests

today = date.today()
response = requests.get(
    "https://api.sam.gov/opportunities/v2/search",
    params={
        "api_key": os.environ["SAM_API_KEY"],
        "postedFrom": (today - timedelta(days=30)).strftime("%m/%d/%Y"),
        "postedTo": today.strftime("%m/%d/%Y"),
        "ncode": "541511",
        "limit": 100,
        "offset": 0,
    },
    timeout=30,
)
response.raise_for_status()
opportunities = pd.DataFrame(response.json()["opportunitiesData"])
opportunities["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
columns = ["noticeId", "title", "postedDate", "responseDeadLine", "naicsCode", "active"]
print(opportunities.reindex(columns=columns).head(20))
4

Test a useful signal

Monitor software contract opportunities

Identify currently active notices for one NAICS code that still have time before their response deadline.

  1. 01Filter the bounded response to active notices and parse available response deadlines.
  2. 02Sort open notices by deadline and retain the notice ID and retrieval timestamp for refreshes.
  3. 03Recheck each notice in SAM.gov and explain how revisions, cancellations, missing deadlines, and latest-version-only access limit the monitor.

Dataset details

U.S. General Services Administration is a government source. Last verified 2026-08-11. Temporal coverage: current active and archived notices.

Domains

Government ProcurementBusiness

Data types

Event DataTabular

Tasks

Opportunity MonitoringLead DiscoveryAlerting

Geography

United States

Formats

JSON

Provider

U.S. General Services Administration

Data terms

U.S. Government public data / GSA reuse guidance