DEV Community

Loomwise
Loomwise

Posted on

Federal Contracts Data to Excel: Filter SAM.gov Bids by NAICS and Set-Aside (No API Key)

"Federal contracts data" usually means one of two feeds:

Feed Question it answers Source
Opportunities What is the government buying right now? SAM.gov daily extract
Awards Who just won, and for how much? FPDS / USAspending

This guide is the opportunities side: a spreadsheet of open bids, RFPs and combined synopsis/solicitations you can filter before the response deadline. (Awards are a separate list.)

A real daily slice

From the Nov 8, 2026 public extract, a 150-row sample of active notices included:

  • 136 Combined Synopsis/Solicitation
  • 5 Presolicitation
  • 4 Solicitation
  • 79 notices with a set-aside code filled in
  • 57 total small-business set-asides
  • Construction examples under NAICS 236220 / 238330 (VA facility work, including an SDVOSB roof-equipment railings notice)

That is enough structure for a capture spreadsheet: title, agency, NAICS, set-aside, posted date, deadline, place of performance and the SAM.gov link.

Build the Excel file without coding

  1. Open Federal Opportunities on Apify.
  2. Set postedWithinDays to 7 (or 1 for a daily digest).
  3. Add the NAICS codes you bid (for example 541511, 238220, 561210).
  4. Optionally restrict set-asides to SBA, SDVOSBC, WOSB, HUBZone.
  5. Press Start, then Export → Excel.

Schedule the same input daily and append to Google Sheets if your team lives in a shared workbook.

Pricing: $0.90 per 1,000 rows. Free sample CSV: loomwise.app/data/government-contract-leads.

Python: same filters, CSV out

import csv
from apify_client import ApifyClient

client = ApifyClient()
run = client.actor("loomwise/federal-opportunities").call(run_input={
    "naicsCodes": ["541511", "541512", "238220"],
    "postedWithinDays": 7,
    "maxResults": 1000,
})

fields = ["postedDate", "title", "agency", "naicsCode", "setAside",
          "noticeType", "responseDeadline", "popState", "link"]
with open("federal_contracts_week.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.DictWriter(f, fieldnames=fields, extrasaction="ignore")
    w.writeheader()
    for row in client.dataset(run["defaultDatasetId"]).iterate_items():
        w.writerow(row)
print("wrote federal_contracts_week.csv")
Enter fullscreen mode Exit fullscreen mode

Open the CSV in Excel and pivot by naicsCode or setAside.

Opportunities vs awards

If your question is "which company just won the HVAC job at that VA hospital?", you want award data instead: Federal Contract Awards / loomwise.app/data/government-contract-awards. Keep opportunities for pipeline; keep awards for subcontracting and supplier outreach.

Data: SAM.gov public opportunities extract. Confirm every notice on sam.gov before bidding.

Top comments (0)