BidHatch API: open federal contracts, pay per call
Search every open U.S. federal contract opportunity in SAM.gov's public Contract Opportunities data (solicitations, quote requests, sources sought, presolicitations, special notices). There are about 9,000+ open at any time, refreshed every morning. You can filter by NAICS, state, set-aside, PSC, agency, keyword and deadline.
It's built for AI agents and scripts. There's no signup and no API key: each call costs $0.02 in USDC on Base, paid with the open x402 standard (HTTP 402).
Endpoints
Search. Up to 100 records per call, each with title, solicitation #, agency/office, type, posted date, deadline (UTC), NAICS, PSC, set-aside, place of performance, the contracting officer's public contact, a description excerpt (2,000 chars max), the SAM.gov link and BidHatch trade tags.
3 recent open opportunities in exactly the paid response shape, so you can test parsing first.
Counts by state, notice type and set-aside, so you can check a query is worth paying for.
Federal contract award history from USAspending.gov public data (FPDS prime awards, refreshed daily): who won, for how much, when and for which agency. Use it to find incumbents, past prices and competitors before bidding. Coverage: trade-service NAICS codes (trucking 4841xx/4842xx, 488510, courier 4921xx/4922xx, janitorial/landscaping/pest 5617xx, electrical 238210, HVAC/plumbing 238220, 238990, equipment repair 811310), awards with activity since Oct 1, 2024. Filters:
naics, psc, state, agency (part of the name), recipient (contractor name or UEI), q (keywords), since/until (award start date), min_amount, limit (1-100), offset, sort (amount|date). With no filters you get the largest covered awards. Each record: award ID, recipient, UEI, amount, outlays, start/end, agency/sub-agency, award type, description, NAICS, PSC, place of performance and a USAspending link, plus count, total and average award amount for your filter.Machine-readable docs: /openapi.json ยท /.well-known/x402 ยท /llms.txt
Query parameters (all optional)
naics: code or prefix, comma-separated (max 10). Example:561720or5617state: place-of-performance state(s). If a notice lists no place of performance, the contracting office's state is used. Example:TX,OKsetaside:SBA,8A,SDVOSBC,WOSB,EDWOSB,HZC,VSA, orANY/NONEpsc: Product/Service Code or prefix. Example:S201trade: one of janitorial, landscaping-snow, pest-control, hvac, plumbing, electrical, freight-hauling, courier, moving, facility-maintenancetype: solicitation, combined, presolicitation, sources-sought, special-noticeagency: part of the department, agency or office name.q: keywords in the title or descriptionposted_since,due_after,due_before: dates as YYYY-MM-DDlimit(1-100, default 50),offset,sort(deadlineorposted)
Payment for /api/v1/awards works exactly the same way, with amount 30000 (0.03 USDC).
Bad parameters get a 400 before any payment is asked for. If our database query fails after you pay, the payment is not settled, so you're not charged.
How payment works
- Call
GET /api/v1/bids?.... You get402 Payment Requiredwith an x402 v2PaymentRequiredobject, in thePAYMENT-REQUIREDheader (base64) and in the JSON body. It asks for schemeexact, networkeip155:8453(Base), asset USDC0x8335โฆ2913, amount20000(0.02 USDC), payTo0x0a56c3405674A582514989ba0ecBAf9aA1Bc9E35. - Your x402 client signs an EIP-3009 USDC authorization from your wallet and retries with the
PAYMENT-SIGNATUREheader. The legacy v1X-PAYMENTheader is also accepted. - A public x402 facilitator (PayAI, with xpay as fallback) checks the authorization. We run your query, then the facilitator settles the payment onchain, straight to the payTo address above. You get
200with the data and aPAYMENT-RESPONSEheader holding the transaction hash.
Gas is paid by the facilitator. BidHatch never holds your funds or any keys.
Try it
curl -s https://bidhatch.pages.dev/api/v1/sample
curl -i "https://bidhatch.pages.dev/api/v1/bids?naics=561720&state=TX&setaside=SBA" # 402 + payment requirements
# TypeScript agent (x402 v2 client libraries)
import { wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
// ...create an x402Client with your own Base signer, then:
const res = await fetchWithPayment("https://bidhatch.pages.dev/api/v1/bids?naics=561720&state=TX");
console.log(await res.json()); Data and limits
The source is SAM.gov's public Contract Opportunities bulk data file (sam.gov/data-services), downloaded once a day. Award notices, justifications and expired notices are removed, and amendments are deduplicated (latest version kept). Descriptions are excerpts, so attachments and full text are on the linked SAM.gov notice, which is always the source of truth. BidHatch is independent and not affiliated with SAM.gov or GSA.
Humans looking for trade bids: see the daily trade listings.