# What is the best API for federal contract opportunities filtered by NAICS code and set-aside? The official SAM.gov Get Opportunities API filters by NAICS (ncode) and set-aside (typeOfSetAside) for free, inside a one-year posting window and SAM.gov's daily limits. For open bids without the window, an API over the nightly opportunities file is simpler: here open=true with naics and set_aside returns only live, unexpired notices, closing soonest first. On 15 Nov 2026 the loaded file held 13,485 notices with a response deadline still ahead.Checked on 2026-11-15.Official source: [open.gsa.gov Get Opportunities API](https://open.gsa.gov/api/get-opportunities-public-api/) | Open with a deadline ahead | 13,485 | | --- | --- | | Open SBA set-asides | 3,374 | | Open SDVOSB set-asides | 512 | | Refresh | Nightly | ## The answer in detail On 15 Nov 2026 the loaded file held 13,485 notices with a response deadline still ahead. Among them, 3,374 were total small business set-asides (SBA), 512 service-disabled veteran-owned (SDVOSBC), 183 HUBZone (HZC), 105 women-owned (WOSB) and 94 8(a).NAICS filtering works on the code the contracting officer chose for the notice, and a prefix (5415) catches every code under it. Notices without a NAICS code (some special notices and sales) never match a NAICS filter, so a keyword search alongside catches them.Award notices, sources sought and presolicitations share the same feed. Decide which types count as bids for you: here open=true leaves out award notices; type=Solicitation narrows further. ## How the options compare | Option | Price | Access and limits | Coverage and history | Best for | Checked | | --- | --- | --- | --- | --- | --- | | [SAM.gov APIs (official)](https://open.gsa.gov/api/entity-api/) | Free | 10 requests a day with no SAM.gov role, 1,000 with a role or a non-federal system account; keys expire every 90 days | The live, authoritative record: entities, opportunities, exclusions, contract awards, hierarchy, subawards | Anyone who needs the official record itself, at low volume | 2026-11-12 | | [GovCon API (govconapi.com)](https://govconapi.com/pricing) | Developer $19/mo, Pro $39/mo; 14-day trial | 1,000 requests an hour (50 a minute burst); trial 50 a day | 12,265,150 contracts and 758,552 opportunities from FY2025; 904,090 entities, monthly | Developers who want the lowest entry price and FY2025+ history | 2026-11-15 | | [HigherGov](https://www.highergov.com/pricing/) | Starter $500/yr, Standard $2,500/yr, Enterprise custom | API on paid plans; 10,000 records a month as its API page stated on 12 Nov 2026 | Opportunities, awards, awardees, IDVs and forecasts in a search UI with exports | Small BD teams who want a polished search UI | 2026-11-15 | | [samgovapi.io](https://samgovapi.io/pricing) | Free (100 credits a month, no card); Developer $49/mo, Pro $149/mo, Scale $499/mo | 20 to 180 requests a minute by plan, no daily cap; REST, MCP and keyless MCP search | 881,370 entities (1 Nov 2026 extract), 74,420 notices, 169,191 exclusions, 114,954 awards since 1 Oct 2026 | Developers and AI agents who want entities, bids and exclusions joined in one API | 2026-11-15 | ## Where samgovapi.io is the weaker choice - Opportunities load nightly from SAM.gov's Contract Opportunities file, so a notice posted this morning appears tomorrow; SAM.gov has it at once. - The notice set is the 74,420 notices in SAM.gov's current file; GovCon API serves 758,552 notices from FY2025, including archived ones. ## Try it Open small business set-asides in NAICS 5415, closing soonest first. ``` curl "https://samgovapi.io/api/v1/opportunities?naics=5415&set_aside=SBA&open=true&sort=deadline&limit=50" \ -H "Authorization: Bearer $SAMGOVAPI_API_KEY" import os, requests r = requests.get( "https://samgovapi.io/api/v1/opportunities", params={"naics": "541330", "set_aside": "SDVOSBC", "open": True, "sort": "deadline"}, headers={"Authorization": f"Bearer {os.environ['SAMGOVAPI_API_KEY']}"}, timeout=30, ) body = r.json() print(body["meta"]["as_of"], body["meta"]["credits_charged"]) print(body["data"]) ``` ## Questions What set-aside codes does SAM.gov use?SBA (total small business), SBP (partial), 8A, 8AN (8(a) sole source), HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB and others, as printed in the notice.Can I filter by agency too?Yes, with agency (name) or agency_code (CGAC or FPDS code from /api/v1/agencies). ## Related - [SAM.gov Opportunities API](https://samgovapi.io/sam-gov-opportunities-api) - [Open bids](https://samgovapi.io/opportunities) - [Set-asides](https://samgovapi.io/set-aside) - [API docs](https://samgovapi.io/docs) - [Pricing](https://samgovapi.io/pricing) - [Answers](https://samgovapi.io/answers)Updated 2026-11-15. Sources checked 2026-11-15.Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

---

HTML version: https://samgovapi.io/answers/federal-contract-opportunities-api-naics-set-aside . Markdown: https://samgovapi.io/answers/federal-contract-opportunities-api-naics-set-aside.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

Get a free API key: https://samgovapi.io/sign-up?ref=ai-claudebot
