DEV Community

Juan de Pablos
Juan de Pablos

Posted on

US Federal Contract Opportunities as Clean JSON (SAM.gov Without the Pain)

Every business day the US federal government publishes hundreds of new contract opportunities on SAM.gov. It is the single largest buyer in the world, and unlike most B2B pipelines, everything is public: what they want to buy, when responses are due, who the contracting officer is, and whether the contract is reserved for small businesses.

The problem is not access. The problem is that actually working with SAM.gov means refreshing a slow portal, fighting saved-search emails that arrive late, or wrestling an official API that returns deeply nested records, cryptic set-aside codes and HTML-polluted descriptions.

I got tired of it and built a feed that does one thing: give me the opportunities matching my filters as clean JSON, with the fields I actually need for a go/no-go decision. This post shows what it returns and how to use it.

What a useful opportunity record looks like

Here is a real record from a cybersecurity keyword scan (trimmed for length):

{
  "title": "HHS/OCI West Publishing Clear Software or EQUAL",
  "solicitationNumber": "7571TEHHSOCIWPCS",
  "noticeType": "Solicitation",
  "publishDate": "2026-07-02T15:19:03.194+00:00",
  "responseDeadline": "2026-07-06T16:30:00-04:00",
  "daysUntilDeadline": 1,
  "naicsCodes": ["541511"],
  "setAside": "NONE",
  "placeOfPerformance": "Silver Spring, MD, USA",
  "contactName": "Raja Seshadri",
  "contactEmail": "raja.seshadri@hhs.gov",
  "url": "https://sam.gov/opp/a57a5914739646ccbd70cbbecac11b5b/view"
}
Enter fullscreen mode Exit fullscreen mode

Three details do most of the work here:

daysUntilDeadline is computed against now. SAM.gov gives you a timestamp; what you actually want to know is "is this alive, and how urgent is it". A record with daysUntilDeadline: 1 goes to the top of today's list. Anything negative never reaches you.

setAside is a label, not a code. The raw API speaks in codes like SBA, 8A, WOSBC, SDVOSBC. The feed maps them to what they mean, so you can filter for "total small business set-aside" or "service-disabled veteran-owned" without a lookup table. If you qualify for a set-aside category, these are the opportunities where your win rate is structurally higher, because most of the market is excluded by law.

The contracting officer is right there. Name and email, from the official record. For subcontracting or capability questions, that contact is the difference between a bid and a shot in the dark.

Running a scan

The feed runs as an Apify Actor, so you can call it from anywhere that can make an HTTP request:

curl -X POST "https://api.apify.com/v2/acts/jdepablos~samgov-opportunities-feed/run-sync-get-dataset-items?timeout=300" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": "cybersecurity",
    "dueWithinDays": 30,
    "setAsides": ["SBA"],
    "maxOpportunities": 25
  }'
Enter fullscreen mode Exit fullscreen mode

You can filter by keywords, NAICS codes, notice types (solicitations vs sources-sought vs award notices), deadline window and set-aside categories. Descriptions come back with the HTML stripped.

Schedule that daily and you have a private deal-flow feed for exactly your niche, hitting your inbox or your CRM before you would ever find the opportunity by browsing.

What it costs

Pay per event: $0.004 per opportunity delivered. A daily scan returning 25 matches costs 10 cents. There is no subscription, and runs that return nothing cost you nothing beyond Apify's tiny platform fee. Compare that with the enterprise gov-con intelligence suites, which start in the hundreds per month and mostly resell the same public data.

Who this is for

  • Small businesses with set-aside eligibility. Filter for your categories and stop competing with everyone.
  • Subcontractors. Sources-sought notices tell you which primes are hunting for partners, weeks before an award.
  • Anyone building agents. The Actor is exposed as an MCP tool, so an AI agent can query live federal opportunities mid-conversation. Ask it "find cybersecurity contracts closing this month with small-business set-asides" and it has the answer in one call.

The Actor is here: US Contract Opportunities Feed on Apify. Runnable examples for this and 16 other data tools live in my Data Actors Cookbook.

If you work gov-con and there is a field or filter you are missing, tell me in the comments. The last two features I shipped on another feed came straight from a reader request.

Top comments (0)