search_opportunities
Search active SAM.gov contract opportunity notices: solicitations, combined synopses, presolicitations, sources sought, special notices, award notices, and justifications.
All filters combine. Keyword search covers titles and full descriptions. By default, only the latest version of each amended notice is included. Notices whose response deadline has passed are left out, except award notices and justifications; notices with no deadline are also included. Set include_past_deadlines to true to include other past-deadline notices. Results are sorted by soonest deadline, with notices that have no deadline last. Returns up to 100 notices per call with the total match count; use offset to page. Use get_opportunity for a notice's full description and contacts.
Data is SAM.gov's public daily file of active notices, not live SAM.gov. Archived notices and attachments are not included.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | deadline: soonest response deadline first. newest: most recently posted first. relevance: best keyword match first (needs keywords). | deadline |
| limit | No | ||
| agency | No | Text matched against the department, sub-tier, and office names, e.g. Army, Veterans Affairs, NSWC Dahlgren. Field activities post under their own office names, so a command name matches only its headquarters office (NAVSEA matches NAVSEA HQ, not NSWC or NUWC offices). | |
| offset | No | ||
| keywords | No | Words that must all appear in the title or full description. Put exact phrases in double quotes, e.g. zero trust "cloud migration". Word endings are matched loosely (bridge matches bridges). | |
| posted_to | No | Latest posted date, YYYY-MM-DD. | |
| psc_codes | No | Product and service codes or prefixes, e.g. D3 or R425. | |
| deadline_to | No | Latest response deadline date, YYYY-MM-DD. | |
| naics_codes | No | NAICS codes or prefixes (2 to 6 digits); a prefix such as 5415 matches every code under it. | |
| posted_from | No | Earliest posted date, YYYY-MM-DD. | |
| notice_types | No | Current notice types to include. Omit for all types. | |
| office_state | No | Two-letter state code of the contracting office. Filled in on nearly every notice, but an office's state is not always where the work happens. | |
| deadline_from | No | Earliest response deadline date, YYYY-MM-DD, in the deadline's own time zone. | |
| set_aside_codes | No | SAM.gov set-aside codes, e.g. SBA (total small business), 8A, SDVOSBC, WOSB, HZC. NONE means the notice says no set-aside was used. | |
| solicitation_number | No | Exact solicitation number. | |
| include_past_deadlines | No | Include notices whose response deadline has already passed. SAM.gov keeps notices active for a while after the deadline; by default they are left out. Award notices and justifications are always included, even when they list a past deadline, and so are notices with no deadline. | |
| include_earlier_versions | No | Include earlier versions of amended notices. SAM.gov's file lists every version of a notice as its own row; by default only the latest version of each is included. | |
| place_of_performance_state | No | Two-letter state code for the place of performance. Most notices leave the place of performance blank, so results also report how many more notices have a contracting office in that state (see office_state). |