SAM.gov API: Search contract opportunities
Finds active federal contract notices on SAM.gov that match keywords, agency, place of performance, set-aside, notice type and posting period.
Unofficial. Not affiliated with or endorsed by SAM.gov.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- State optional
state Place-of-performance state, such as Texas or TX.
Not set
- Agency optional
agency Federal agency name, such as Department of Veterans Affairs.
Not set
- Keywords, required
keywords Words to search for, such as janitorial services.
janitorial services
- Set Aside optional
set_aside Business preference, such as hubzone.
any (default)
One of
any,small_business,women_owned,veteran_owned,service_disabled_veteran_owned,hubzone,8a.- Max Results optional
max_results Maximum notices to return, such as 25.
25 (default)
Whole number from 1 to 100.
- Notice Type optional
notice_type Kind of notice, such as solicitation.
any (default)
One of
any,solicitation,presolicitation,sources_sought,combined_synopsis,award_notice.- Posted Within Days optional
posted_within_days Only notices posted within this many days, such as 30.
30 (default)
Whole number from 1 to 365.
Input as JSON
{ "keywords": "janitorial services"}Output
{ "opportunities": [ { "link": "https://sam.gov/workspace/contract/opp/546f260eefcc42e996f4d6ac7df2b460/view" , "title": "Swan Lake Ranger District Janitorial Contract, Flathead National Forest", "agency": "AGRICULTURE, DEPARTMENT OF", "office": "USDA-FS, CSA INTERMOUNTAIN 7", "industry": "Janitorial Services", "notice_id": "546f260eefcc42e996f4d6ac7df2b460", "set_aside": "Small Business Set Aside - Total", "naics_code": "561720", "notice_type": "Combined Synopsis/Solicitation" , "posted_date": "2026-10-22", "response_deadline": "2026-11-12T13:00:00-07:00", "solicitation_number": "1240LS26Q0044", "place_of_performance": "Montana, UNITED STATES" }, { "link": "https://sam.gov/workspace/contract/opp/0602507394964d76986220e4c04c2194/view" , "title": "CFO JANITORIAL SERVICES (5 YEAR)", "agency": "INTERIOR, DEPARTMENT OF THE", "office": "ELY DISTRICT OFFICE", "industry": "Janitorial Services", "notice_id": "0602507394964d76986220e4c04c2194", "set_aside": "Small Business Set Aside - Total", "naics_code": "561720", "notice_type": "Solicitation", "posted_date": "2026-10-22", "response_deadline": "2026-11-16T11:00:00-08:00", "solicitation_number": "140L3926Q0031", "place_of_performance": null }, { "link": "https://sam.gov/workspace/contract/opp/52157360719345188f4407ea74392ec7/view" , "title": "Janitorial Contract Eagle Pass, TX", "agency": "DEPT OF DEFENSE", "office": "W076 ENDIST FT WORTH", "industry": "Janitorial Services", "notice_id": "52157360719345188f4407ea74392ec7", "set_aside": "Small Business Set Aside - Total", "naics_code": "561720", "notice_type": "Combined Synopsis/Solicitation" , "posted_date": "2026-10-22", "response_deadline": "2026-11-05T12:00:00-06:00", "solicitation_number": "W9126G27QA003", "place_of_performance": null } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"sam.gov/search_contract_opportunities","input":{"keywords":"janitorial services"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "sam.gov/search_contract_opportunities" , "input": { "keywords": "janitorial services" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "sam.gov/search_contract_opportunities" , "input": { "keywords": "janitorial services" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run sam.gov/search_contract_opportunities# with {"keywords":"janitorial services"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "keywords" ], "properties": { "state": { "type": "string", "description": "Place-of-performance state, such as Texas or TX." }, "agency": { "type": "string", "description": "Federal agency name, such as Department of Veterans Affairs." }, "keywords": { "type": "string", "minLength": 1, "description": "Words to search for, such as janitorial services." }, "set_aside": { "enum": [ "any", "small_business", "women_owned", "veteran_owned", "service_disabled_veteran_owned", "hubzone", "8a" ], "type": "string", "default": "any", "description": "Business preference, such as hubzone." }, "max_results": { "type": "integer", "default": 25, "maximum": 100, "minimum": 1, "description": "Maximum notices to return, such as 25." }, "notice_type": { "enum": [ "any", "solicitation", "presolicitation", "sources_sought", "combined_synopsis", "award_notice" ], "type": "string", "default": "any", "description": "Kind of notice, such as solicitation." }, "posted_within_days": { "type": "integer", "default": 30, "maximum": 365, "minimum": 1, "description": "Only notices posted within this many days, such as 30." } }}Output schema
{ "type": "object", "required": [ "opportunities" ], "properties": { "opportunities": { "type": "array", "items": { "type": "object", "properties": { "link": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "agency": { "type": [ "string", "null" ] }, "office": { "type": [ "string", "null" ] }, "industry": { "type": [ "string", "null" ] }, "notice_id": { "type": [ "string", "null" ] }, "set_aside": { "type": [ "string", "null" ] }, "naics_code": { "type": [ "string", "null" ] }, "notice_type": { "type": [ "string", "null" ] }, "posted_date": { "type": [ "string", "null" ] }, "response_deadline": { "type": [ "string", "null" ] }, "solicitation_number": { "type": [ "string", "null" ] }, "place_of_performance": { "type": [ "string", "null" ] } } } } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
sam.gov/search_contract_opportunities- Returns
- title, agency, office, notice type, dates, place, industry, set-aside, link, ids
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method sam.gov/search_contract_opportunities with the inputs above.
Ask your agent
- Find active federal solicitations for janitorial services in Texas posted in the last 14 days
- Show me small business set-aside notices from the Department of Veterans Affairs for medical equipment maintenance
- Search sources sought notices about cybersecurity consulting for any agency, posted within 60 days, up to 40 results
- Look up combined synopsis notices in Ohio for HVAC repair with veteran-owned set-aside on SAM.gov
- Any presolicitation for construction of roads or bridges in TX from the Army Corps of Engineers this month, max 15 results
See more
Finds open UK public-sector tender notices on Find a Tender matching keywords, optionally filtered by contract region, estimated value and closing date, newest first.
find-tender.service.gov.uk/search_tendersFinds U.S. federal grant opportunities by topic, agency, applicant type and status, with funding and eligibility details. Open results exclude opportunities whose closing date has passed.
grants.gov/search_grantsSearches USAspending federal awards by keywords, awarding agency, state of performance and date across contracts, grants, loans and direct payments. Searches from October 1, 2007 onward.
usaspending.gov/search_federal_awardsSearches USAJOBS federal jobs by keywords, location, salary threshold and applicant group, in website relevance order. Salary ranges may start below the threshold; annual pay or remote status is null when the announcement does not state it.
usajobs.gov/search_jobsFinds published EU contract award notices on Tenders Electronic Daily by contract topic or winning company, newest publication first, optionally limited to a buyer country and a start date. Values and tender counts are included when published; counts across lots are summed.
ted.europa.eu/search_contract_awardsFind Federal Register rules, proposed rules, notices, and presidential documents by topic, agency, publication dates, and comment status. Significant means designated significant by the source; documents without that designation show no.
federalregister.gov/search_rulesFinds recently published EU procurement notices matching what is being bought, with buyer, estimated value, submission deadline and TED notice link. Open-only results must have a future submission deadline.
ted.europa.eu/search_tendersReturns federal obligations and distinct awards for a company or organization, including its parent and child recipient records. Covers the selected fiscal year or the last five fiscal years.
usaspending.gov/get_company_federal_awards