> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Government Solicitations

> Federal contract opportunities (SAM.gov) by NAICS code, with the contracting officer's published contact.

**Which federal agencies are buying what you sell, right now?**

A Sources Sought or Presolicitation notice is SAM.gov's signal that an agency has a requirement and is still writing it — before it hits a formal solicitation, before a prime has been picked, while the contracting officer is actively looking for vendors to talk to. That window is the buying window: respond to a Sources Sought and you can shape the requirement; wait for the full solicitation and you're competing on someone else's terms. Every notice carries the contracting officer's published name, email, and phone — the join a normal B2B database can't make, because "the federal government" isn't a company record.

This is a lead-generation endpoint for selling *to* government, not a general contract-research tool: it filters to the early, relationship-building notice types (`r`/`p`) by default, and every row's point of contact is real and reachable.

Async, like every research endpoint on this site: you POST a request, get back a `request_id`, and poll `GET /v1/requests/{request_id}` with `X-Agent-ID` (your wallet) until the job completes — without the wallet header the poll returns `401 missing_wallet`.

<Note>
  This endpoint accepts optional `memo` (≤ 1000 chars) and `decisionContext`
  (object) body fields. Stored on the receipt for debugging and audit — see
  [Audit Trail](/sdk/audit-context).
</Note>

## Request

`POST /v1/tools/gov/solicitations`

<ParamField body="naics" type="string[]" required>
  One or more 6-digit NAICS codes (1–20), e.g. `["541511"]`. Every code must match `^\d{6}$`. See [NAICS codes to start from](#naics-codes-to-start-from) below.
</ParamField>

<ParamField body="notice_types" type="string[]" default="['r', 'p']">
  SAM.gov procurement type codes to include (1–9): `r` Sources Sought, `p` Presolicitation, `o` Solicitation, `k` Combined Synopsis/Solicitation, `s` Special Notice, `a` Award Notice, `u` Justification, `i` Intent to Bundle, `g` Surplus Property. The default keeps you in the buying window — before the requirement has hardened into a formal solicitation.
</ParamField>

<ParamField body="since_days" type="number" default="30">
  Look-back window on posted date, 1–365.
</ParamField>

<ParamField body="agencies" type="string[]" optional>
  Case-insensitive substrings matched against the agency path (max 20), e.g. `["DEPT OF THE ARMY"]`.
</ParamField>

<ParamField body="keywords" type="string[]" optional>
  Title / full-text keywords (max 20).
</ParamField>

<ParamField body="state" type="string" optional>
  Two-letter place-of-performance state code, e.g. `"TX"`. Rows with no recorded place of performance are unknown, not a match, and are excluded when this filter is set.
</ParamField>

<ParamField body="set_aside" type="string" optional>
  Set-aside code: `SBA`, `8A`, `HZC`, `SDVOSBC`, `WOSB`, ...
</ParamField>

<ParamField body="active_only" type="boolean" default="true">
  Drop archived notices and notices whose response deadline has already passed.
</ParamField>

<ParamField body="has_contact" type="boolean" default="false">
  `true` keeps only notices whose point of contact has both a name and an email — the rows you can actually act on.
</ParamField>

<ParamField body="include_description" type="boolean" default="true">
  Fetch description bodies for the first rows of the result. See [description cap](#the-description-cap) below.
</ParamField>

<ParamField body="limit" type="number" default="100">
  Max results, 1–500.
</ParamField>

```bash theme={null}
curl -X POST https://win.oneshotagent.com/v1/tools/gov/solicitations \
  -H "Content-Type: application/json" \
  -H "PAYMENT-SIGNATURE: <signature>" \
  -d '{
    "naics": ["541511"],
    "has_contact": true,
    "since_days": 30
  }'
```

<Note>
  The x402 middleware reads `payment-signature` (or legacy `x-payment`). The SDK sets this for you — pass the signed payment when calling HTTP directly.
</Note>

## Response

```json theme={null}
{
  "status": "completed",
  "result": {
    "results": [
      {
        "notice_id": "a1b2c3d4e5f6",
        "notice_type": "sources_sought",
        "notice_type_code": "r",
        "title": "Custom Software Development Support Services",
        "solicitation_number": "W91CRB-26-R-0042",
        "agency": "DEPT OF DEFENSE.DEPT OF THE ARMY.AMC",
        "naics_code": "541511",
        "posted_date": "2026-08-12",
        "response_deadline": "2026-09-15T17:00:00Z",
        "active": true,
        "set_aside": "SBA",
        "place_of_performance": { "city": "Huntsville", "state": "AL", "zip": "35805" },
        "contact": {
          "name": "Jordan Ellis",
          "email": "jordan.ellis@army.mil",
          "phone": "(256) 555-0119",
          "title": "Contracting Officer",
          "type": "primary"
        },
        "contacts": [
          { "name": "Jordan Ellis", "email": "jordan.ellis@army.mil", "phone": "(256) 555-0119", "title": "Contracting Officer", "type": "primary" }
        ],
        "description": "The government is seeking sources capable of providing custom software development...",
        "description_truncated": false,
        "url": "https://sam.gov/opp/a1b2c3d4e5f6/view",
        "id": "a1b2c3d4e5f6"
      }
    ],
    "total_found": 1,
    "truncated": false,
    "description_fetches": 1,
    "vendor_calls": 2,
    "data_as_of": "2026-09-07T06:00:00.000Z",
    "filters": { "naics": ["541511"], "has_contact": true, "since_days": 30 }
  }
}
```

<Info>
  Zero rows is a **completed** job, not an error — `results: []`, `total_found: 0`. It means no notice matched your filters in the window, not that the search failed. The same contract as every other search endpoint on this site.
</Info>

`data_as_of` is an ISO timestamp of the data snapshot behind `results`: the publish time of SAM.gov's daily extract when served from it (same-day postings typically appear the next morning), or the request time when the live SAM.gov API answered.

### The description cap

Description bodies are a second upstream call per notice, so they're fetched for a capped number of rows per search rather than every row unconditionally. `description` is `null` on any row the fetch didn't reach. `truncated: true` on the top-level result means either the description cap stopped some rows short, or the search itself was halted early by an upstream error — check `description_fetches` and inspect which rows have `description: null` to tell which happened. `description_truncated` (per row) is different: it means the description body itself was longer than the per-notice character cap and was cut, not that it's missing.

### `has_contact`

Not every notice publishes a point of contact — pass `has_contact: true` to only get rows with a name and an email you can act on immediately. Without it you'll see notices where `contact` is `null`.

## NAICS codes to start from

| Vertical                                   | NAICS    |
| ------------------------------------------ | -------- |
| Custom computer programming / software dev | `541511` |
| IT systems integration                     | `541512` |
| Computer facilities management             | `541513` |
| Management consulting                      | `541611` |
| Engineering services                       | `541330` |
| Commercial building construction           | `236220` |
| Facilities support services                | `561210` |
| Janitorial services                        | `561720` |
| Security guard services                    | `561612` |
| Office administrative services             | `561110` |

NAICS codes are hierarchical — `5415` (computer systems design) rolls up `541511`–`541519`, but this endpoint only accepts full 6-digit codes. Pass the code(s) closest to what you actually deliver; SAM.gov's own NAICS lookup (`naics.com` or `sam.gov`) is the canonical reference for less common verticals.

## SDK

```typescript theme={null}
const opportunities = await agent.govSolicitations({
  naics: ['541511'],
  has_contact: true,
});

for (const notice of opportunities.results) {
  console.log(notice.title, notice.contact?.email);
}
```

See [Pricing](/pricing) for costs.
