# GovCon API

Version: `1.0.0`

## Federal Contracts API for Developers

Clean JSON access to federal procurement data: contract opportunities,
FPDS prime contracts, SAM Award Notices, subawards, the SAM entity registry,
debarment exclusions, and contracting-officer contacts.

### What's covered
- **Contract opportunities** (SAM.gov notices, daily refresh)
- **Contracts** (FPDS prime contract transactions; every base award and modification for types A/B/C/D; FY2025+ coverage)
- **SAM Award Notices** (the SAM-noticed slice; backward-compatible surface for integrations that depend on it)
- **Subawards** (FFATA Section 2 reports, FY2025+)
- **SAM entity registry** (~880K registered firms by UEI or CAGE; registration
  status, expiration, NAICS, business-type certifications)
- **Exclusions** (debarred / suspended entities)
- **Companies** (Pro: combined SAM profile + award history)
- **Vendor Risk** (Pro: 7-signal screening per UEI)

Every response includes a top-level `_sources` array naming the data sources composed in that response.

### Authentication
All endpoints (except public demo) require Bearer token authentication:
```
Authorization: Bearer your_api_key_here
```

### Plans
- **Free Trial**: 50 req/day, 14 days, no credit card
- **Developer ($19/mo)**: 1000 req/hr, all opportunities + contracts + awards + subawards + exclusions
  filters + SAM entity lookup (UEI, CAGE, name search)
- **Pro ($39/mo)**: everything Developer + Companies API + SBA/DSBS profile block
  + SAM expiration radar + Vendor Risk + dense subaward enrichment on `/contracts/{piid}`

Use `/api/v1/status` and `/api/v1/me` endpoints for current data and plan details.

### 📚 Documentation
- **This page**: Interactive API reference for developers
- **[Comprehensive Guide](/api-guide)**: Business documentation with worked examples and use cases

Single-file Markdown bundle generated from the live OpenAPI 3.1 schema. Source: <https://govconapi.com/openapi.json>.

## Endpoints

### `GET /api/v1/agency-crosswalk`

**Get Agency Crosswalk**

Public endpoint - returns agency name standardization mappings (rebuilt nightly by the
`crosswalk` task in app/cron_housekeeping.py, which has no weekday gate and runs at 09:30 UTC).

Each row is enriched with the matched `federal_hierarchy` entry (organization_id, cgac, type)
when the canonical_agency resolves to a SAM Federal Hierarchy org. ~99% match rate.
Use organization_id to call GET /api/v1/federal-hierarchy/{id} for structured data.

**Responses:**
- `200`: Successful Response

### `GET /api/v1/awards/search`

**Search Federal Contract Awards**

Tags: Awards

Search awarded contracts by awardee name, UEI, agency, NAICS, amount range, and date range. All filters available on all plans. Free plan: max 100 results. Paid plan: max 1000 results.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `awardee_name` | query |  | no | Awardee company name (partial match, case-insensitive) |
| `uei` | query |  | no | Exact UEI match |
| `naics` | query |  | no | NAICS code |
| `agency` | query |  | no | Awarding agency (partial match) |
| `amount_min` | query |  | no | Minimum award amount |
| `amount_max` | query |  | no | Maximum award amount |
| `awarded_after` | query |  | no | Awards on or after this date (YYYY-MM-DD) |
| `awarded_before` | query |  | no | Awards on or before this date (YYYY-MM-DD) |
| `state` | query |  | no | Awardee state code (2-letter, e.g. CA) |
| `sort_by` | query |  | no | Sort field: award_amount, award_date, awardee_name |
| `sort_order` | query |  | no | Sort order: asc or desc |
| `limit` | query | integer | no | Results per page. Default 100; maximum 100 on the free trial and 1,000 on paid plans. |
| `offset` | query | integer | no | Pagination offset |
| `fields` | query |  | no | Comma-separated response fields to return. `notice_id` always included. Example: `fields=notice_id,awardee_name,award_amount,award_date`. |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/awards/{award_number}`

**Get Award by Contract Number**

Tags: Awards

Get a single award record by award/contract number. Returns the most recent record if multiple exist.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `award_number` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `POST /api/v1/checkout`

**Create Checkout Session**

Create Stripe checkout session for Developer plan subscription

**Responses:**
- `200`: Successful Response

### `GET /api/v1/companies/search`

**Search companies by name across SAM Award Notices and FPDS prime contracts (also matches SAM-registered firms with no awards, up to 200 per search; to list every registered firm use /entities/search)**

Tags: Companies (Pro)

Case-insensitive substring (ILIKE) match against awardee names across BOTH
SAM Award Notices and FPDS prime contract transactions.

Scope as of 2026-06-05: ~101,234 distinct UEIs across SAM Award Notice winners
+ FPDS prime contractors. Many federal contractors don't appear in the SAM
Award Notice slice (FPDS coverage is broader); the search now spans both so a
contractor like Picogrid ($18M+ FPDS, 0 SAM Award Notices) surfaces by name.

Existing fields keep their meaning — `total_awards` / `total_value` /
`last_award_date` describe SAM Award Notice activity only. New `fpds_*`
fields surface FPDS prime contract activity independently. Results are
ranked by the combined value (Award Notice + FPDS) so the biggest federal
contractor for the name surfaces first regardless of which source it lives in.

Optional `naics` and `agency` filters narrow the candidate set to companies
that have WON awards under that NAICS / from that agency (distinct from
Federal Contractor Search, which filters by SAM registration data —
"registered for NAICS X" vs "won awards under NAICS X").

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `q` | query |  | no | Name substring match. UEIs are exact 12-char identifiers — for direct UEI lookup use GET /api/v1/companies/{uei}. |
| `naics` | query |  | no | 6-digit NAICS code. Filters to companies that have won at least one award under this NAICS. |
| `agency` | query |  | no | Agency top-level name (e.g. 'DEPT OF DEFENSE'). Filters to companies that have won at least one award from this agency. Matches the top-level of SAM's dotted agency path. |
| `naics_small` | query |  | no | Narrow to companies SMALL for this NAICS per SBA DSBS (Pro). SBA's authoritative small-business determination, distinct from SAM's self-reported flag; pairs award history with eligibility. |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | Comma-separated response fields. `uei` always included. Example: `fields=uei,name,total_value,fpds_obligated_total`. |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/companies/{uei}`

**Company profile with aggregated stats**

Tags: Companies (Pro)

Aggregate profile for a single UEI.

Combines two sources:
  - **SAM entity registration** (legal name, DBA, address, NAICS, PSC,
    business-type certifications, registration dates, CAGE codes)
  - **Award history** (totals, top NAICS/agencies, activity windows)

**Scope of the award totals:** `total_awards`, `total_value`, and
`avg_value` count **SAM Award Notices only** (the SAM-noticed slice,
roughly 10-30% of federal obligations). They are NOT the company's total
federal contract value: a contractor active only in FPDS shows
`total_value: 0` here by design. For the fuller federal prime-contract
obligation figure read `fpds_obligated_total` (Pro), returned alongside.
The two are kept separate rather than summed because the sources overlap
at the award level (most SAM Award Notices also have an FPDS record) and
SAM `award_amount` carries occasional garbage values; pick the denominator
that fits your question.

Returns 200 if either source has the UEI. Returns 404 only when the UEI
is unknown to both. Award fields default to 0/empty when the company is
SAM-registered but has never won a contract (the common case for SMBs
in the SAM directory of ~880K registered entities).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/companies/{uei}/awards`

**Award history for a UEI (paginated)**

Tags: Companies (Pro)

Full paginated award history. sort=date (default, desc) | amount (desc).
Also accepts sort_by=award_date|award_amount + sort_order=asc|desc.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `sort` | query | string | no |  |
| `sort_by` | query |  | no | Sort field: award_date or award_amount (alias for sort) |
| `sort_order` | query |  | no | Sort order: asc or desc (used with sort_by) |
| `fields` | query |  | no | Comma-separated response fields. `notice_id` always included. |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/companies/{uei}/peers`

**Similar companies by NAICS + agency overlap**

Tags: Companies (Pro)

Find similar awardees based on overlap of NAICS codes and agencies.

Scoring: count NAICS overlap + count agency overlap (each weighted by
their award frequency at the target UEI). Not a true Jaccard; closer
to 'weighted match count'.

This is the slowest endpoint. Expect 200-1500ms on prod data.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |
| `limit` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/companies/{uei}/prime-relationships`

**Primes that have paid this UEI as a sub-vendor. Reverse lookup by subawardee_uei.**

Tags: Subawards

What primes have paid this sub? Indexed on subawardee_uei.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `date_from` | query |  | no |  |
| `date_to` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/companies/{uei}/subawards`

**Subawards paid by this prime (UEI). Reverse lookup over /subawards/search.**

Tags: Subawards

What subs has this prime paid? Indexed on prime_awardee_uei.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `date_from` | query |  | no |  |
| `date_to` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/company-contact/{uei}`

**Resolve a vendor's real decision-maker contact (Pro), SAM registration agents filtered out**

Tags: Company Contacts

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/contacts/lookup`

**Look Up Contracting Officer Contact Info**

Tags: Contacts (Pro)

Resolver lookup for a contracting officer.

Two query modes:
- **By name** (`name=X`, optional `agency=Y` and `state=ST`). Returns up to 5 substring matches.
- **By email** (`email=foo@bar.gov`). Exact match, single record. Useful for CRM-enrichment workflows where the email is on file and the customer wants the current name / agency / phone for that address.

One of `name` or `email` is required.

**This is a resolver, not a directory.** It is not possible to list or paginate contacts via this endpoint. To browse the full directory, search by NAICS or agency, view award history, or see colleague graphs and AI dossiers, use the web app at https://contacts.govconapi.com (included with Pro).

**Auth:** Pro tier ($39/mo). Returns 402 on Developer-only keys.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | query |  | no | Name (or partial name) of the contracting officer. Required unless `email` is provided. |
| `agency` | query |  | no | Optional agency substring for disambiguation (e.g. 'Air Force', 'DLA'). Used only with `name`. |
| `state` | query |  | no | Optional 2-letter state/territory code (e.g. 'CA', 'DC'). Used only with `name`. |
| `email` | query |  | no | Exact email address for reverse lookup. Returns one record. Mutually exclusive with `name` (if both, `email` wins). |

**Responses:**
- `200`: Up to 5 contacts matching the query.
- `402`: This endpoint requires the Pro plan.
- `404`: No matching contacts.
- `422`: Required parameter missing or invalid.
- `429`: Rate limit exceeded.
- `503`: Contacts data store temporarily unavailable. Retry.

### `GET /api/v1/contracts/search`

**Search FPDS prime contract transactions by UEI, PIID, agency, NAICS**

Tags: Contracts

Per conventions §1.1, §3.5, §4.2, §5, §6.1, §9.3 and ARCHITECTURE.md §4.1.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | query |  | no | Recipient UEI (exact) |
| `parent_uei` | query |  | no | Recipient parent UEI (corporate roll-up) |
| `piid` | query |  | no | Award PIID (exact) |
| `parent_piid` | query |  | no | Parent award PIID (vehicle/IDV) |
| `agency` | query |  | no | Awarding agency name substring (case-insensitive) |
| `naics` | query |  | no | NAICS, exactly 6 digits |
| `award_type_code` | query |  | no | FPDS award type: A, B, C, or D |
| `date_from` | query |  | no | YYYY-MM-DD (action_date) |
| `date_to` | query |  | no | YYYY-MM-DD (action_date) |
| `amount_min` | query |  | no | federal_action_obligation min |
| `amount_max` | query |  | no | federal_action_obligation max |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | lean \| expanded \| full \| comma-list of columns |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/contracts/{piid}`

**Single contract by PIID — latest action + roll-up + optional subaward enrichment**

Tags: Contracts

Returns the LATEST transaction row for this PIID plus a roll-up of
obligation/value totals across every transaction (mods included).

Detail-style response per ARCHITECTURE.md §4.2 — singular `contract` key
at top level; `subaward_rollup` enrichment as a sibling, NOT nested.
Pro-gated subaward enrichment via contacts_access per §8.4 (Free tier
sees the contract record but no subaward block).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |
| `fields` | query |  | no | lean \| expanded \| full \| comma-list of columns |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/contracts/{piid}/modifications`

**Full transaction history for a PIID — every modification row, oldest to newest**

Tags: Contracts

Returns every transaction row for the given PIID, oldest action first.

Modification trail use case: amendments, options exercised, partial
terminations. Each row is a single FPDS action; mods stack on the
original award. Not date-windowed by request (no date_from/to params —
a caller asking for one PIID's history gets everything WE HOLD for it),
but `prime_awards` itself only carries FY2025 onward (CONTRACTS_DATA_FLOOR),
so an order whose PoP predates that floor silently starts mid-sequence
(e.g. first modification_number P00026, not P00001). Disclosed via the
same `window` block search_contracts/search_vehicles/search_subawards use.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | lean \| expanded \| full \| comma-list of columns |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/contracts/{piid}/vehicle`

**The contract vehicle this order was placed against (IDIQ, GWAC, FSS, BPA)**

Tags: Contracts

Resolve an order to its parent vehicle.

Most federal services work is not bought as a standalone contract: it is a task
order placed against a vehicle you must already hold. 6.18M of our contract rows
carry a `parent_award_id_piid`, so for those the actionable question is not "who
won this" but "what would I have needed to hold to bid at all".

Three outcomes, deliberately distinguished, because collapsing them into one 404
would tell the customer nothing:
  `standalone`   - the order has no parent; it was competed on its own.
  `resolved`     - we hold the parent vehicle; it is returned.
  `not_in_corpus`- the order names a parent we do not carry. Honest, not a 404:
                   the order exists, the vehicle is simply outside our coverage.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/dsbs/{uei}`

**SBA DSBS small-business profile for a UEI (Pro): NAICS-small, dated SBA certifications, capabilities**

Tags: DSBS Enrichment

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/entities/by-cage/{cage_code}`

**SAM entity lookup by CAGE code (every plan)**

Tags: Entities

SAM-registered entity by Commercial and Government Entity (CAGE) code.

CAGE is the DoD/DLA-issued 5-character identifier used by contracting
officers and legacy procurement systems. Each CAGE code is assigned to
one entity by DLA. Large entities (USPS, financial institutions) can
have multiple CAGE codes per UEI; this endpoint returns the entity
that owns the CAGE you queried.

Response is the same shape as `/entities/{uei}` plus a `queried_cage`
field echoing the input. Every plan (matches `/entities/{uei}`: both are
alternate-identifier lookups for the same underlying record).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `cage_code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/entities/expiring`

**Registrations expiring within N days (Pro)**

Tags: Entities

Active SAM registrations expiring within `within_days` days.

Pro. Renewal-radar use case: customers monitor a state, a NAICS
cohort, or the full population for entities that need to renew. Past-due
expirations are excluded (status would already be 'E').

Sorted by expiration_date ascending (most urgent first). Result includes
`days_until_expiration` for direct rendering.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `within_days` | query | integer | no | Days from today to look ahead |
| `state` | query |  | no |  |
| `naics` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/entities/search`

**Search SAM entities by name and filters (every plan)**

Tags: Entities

Filter-based entity search.

Every plan, including the free trial: combine `q` (name substring,
trigram-indexed) with `naics` / `state` / `business_type` / `active_only`
/ `naics_small` as needed.

At least one of `q` / `naics` / `state` / `business_type` / `active_only`
must be provided. NAICS values omit the Y/N small-business suffix (we
match either flag).

`business_type` accepts SAM 2-3 char codes like `8W` (WOSB), `QF`
(SDVOSB), `27` (Self-Cert SDB), `2X` (For Profit), etc. An unknown code
returns 400 listing every valid code. Note: SBA-certified codes
(A6, XX, JT, A4) are valid but appear ~zero times in the Public V2 SAM extract.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `q` | query |  | no | Name substring |
| `naics` | query |  | no | 6-digit NAICS code (SAM's Y/N/E suffix is accepted and dropped) |
| `state` | query |  | no | 2-letter US state |
| `business_type` | query |  | no | SAM business-type code, e.g. 8W (WOSB), QF (SDVOSB), 27 (self-cert SDB). An unknown code returns 400 with the full valid list. |
| `active_only` | query | boolean | no | Only Active registrations |
| `naics_small` | query |  | no | Firms SMALL for this NAICS per SBA DSBS. SBA's authoritative small-business determination, distinct from SAM's self-reported per-NAICS flag. |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | Comma-separated response fields. `uei` always included. Example: `fields=uei,legal_business_name,primary_naics`. |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/entities/{uei}`

**SAM entity lookup by UEI (every plan)**

Tags: Entities

Single SAM-registered entity by UEI.

Returns registration block (status, dates, expiring_soon flag) and entity
block (legal name, DBA, address, NAICS/PSC, business-type certifications,
decoded labels, CAGE codes).

Every plan (any active API key). A Pro key also receives the SBA profile and
award and subaward totals; the full company view is `/companies/{uei}` (Pro).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/exclusions/search`

**Search Excluded Entities**

Tags: Exclusions

Search SAM.gov exclusions database for debarred entities. Search by name, UEI, CAGE code, agency, or location.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `entity_name` | query |  | no | Entity or person name (partial match). Also matches cross_reference, the other names SAM lists on an exclusion, including businesses an excluded person operates under. |
| `name` | query |  | no | Alias for entity_name (accepted for backwards compatibility) |
| `q` | query |  | no | Alias for entity_name. Same name-search param as /entities/search and /companies/search, so a screening script can reuse it across endpoints. |
| `uei_sam` | query |  | no | UEI SAM identifier |
| `uei` | query |  | no | Alias for uei_sam (the canonical name on every other endpoint) |
| `cage_code` | query |  | no | CAGE code. Note: only ~0.3% of exclusion records carry one, so an empty result here means the field is absent, not that the entity is clear. |
| `excluding_agency` | query |  | no | Excluding agency code or name substring (e.g., 'DOD', or 'DEFENSE LOGISTICS') |
| `classification_type` | query |  | no | Classification: Individual, Firm, Vessel, Special Entity Designation. Case-insensitive; an unknown value returns 400 with the valid list. |
| `exclusion_type` | query |  | no | Type: Prohibition/Restriction, Ineligible (Proceedings Completed), Ineligible (Proceedings Pending), Voluntary Exclusion. Case-insensitive; an unknown value returns 400 with the valid list. SAM stores both 'Proceedings Complete' and 'Proceedings Completed'; either input matches both. |
| `state` | query |  | no | State/province code |
| `country` | query |  | no | Country code. Unreliable for the sanctioned (OFAC) slice, where SAM codes many foreign entities as US or as the non-ISO bucket XUN, so a country filter can return a false-negative subset. Do not rely on it for sanctions screening. |
| `active_only` | query | boolean | no | Only show currently active exclusions |
| `limit` | query | integer | no | Results per page. Default 100; maximum 100 on the free trial and 1,000 on paid plans. |
| `offset` | query | integer | no | Pagination offset |
| `fields` | query |  | no | Comma-separated response fields to return. `uei_sam` always included. Example: `fields=entity_name,uei_sam,excluding_agency_code,activate_date`. Omit to return all fields (default). |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/exclusions/{uei_sam}`

**Check UEI Against Exclusions List**

Tags: Exclusions

Vendor-risk screening lookup: pass a UEI SAM and find out whether that entity is on the current SAM exclusions list.

**This is a current-state list, not a history.** It is refreshed as a full replace of what SAM publishes today, so an exclusion that has already been terminated is absent entirely rather than returned as expired. A 404 means 'not on the list now', not 'never excluded'.

**Response semantics**
- `200` — entity IS on the exclusions list. Body contains the full record.
- `404` — UEI is **not** on the exclusions list. This is the expected answer for the vast majority of legitimate vendors and means the entity is clean.

**Coverage caveat:** roughly 73% of SAM exclusions are individuals or small entities without a UEI. A 404 here means *no UEI-keyed exclusion*; to also screen against name-based debarments (e.g. principals, officers, individuals), pair this lookup with `/api/v1/exclusions/search?entity_name=...`.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei_sam` | path | string | yes |  |

**Responses:**
- `200`: Entity is on the exclusions list. Full record returned.
- `404`: No UEI-keyed exclusion found. Entity is clean by UEI; screen names separately for full coverage.
- `422`: Validation Error
- `429`: Rate limit exceeded.

### `GET /api/v1/federal-hierarchy/`

**List Federal Organizations**

Tags: Federal Hierarchy

Search and filter the SAM Federal Hierarchy (~907 federal departments, agencies, and offices). All filters are optional. Free tier — available to any authenticated API key.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `type` | query |  | no | Filter by type: DEPARTMENT or AGENCY (case-insensitive) |
| `cgac` | query |  | no | Filter by Treasury account code (e.g. 097 for DoD) |
| `parent_id` | query |  | no | Filter by parent organization_id |
| `hierarchy_level` | query |  | no | Filter by depth (1 = root department) |
| `is_active` | query |  | no | Filter by active status (default: true) |
| `search` | query |  | no | Match on canonical_name, short_name, alternative_names, or an agency path as it appears on SAM notices (case-insensitive) |
| `limit` | query | integer | no | Results per page. Default 100; maximum 100 on the free trial and 1,000 on paid plans. |
| `offset` | query | integer | no | Pagination offset |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/federal-hierarchy/{organization_id}`

**Federal Organization Detail**

Tags: Federal Hierarchy

Lookup a single federal organization by `organization_id`. Response includes the full record plus inline `parent`, `children`, and `ancestors` for traversal in one call.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `organization_id` | path | integer | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/federal-hierarchy/{organization_id}/ancestors`

**Ancestor Chain**

Tags: Federal Hierarchy

Return the chain of ancestors (root → immediate parent) for `organization_id`. Empty array if the organization is a root department.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `organization_id` | path | integer | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/federal-hierarchy/{organization_id}/children`

**Immediate Children**

Tags: Federal Hierarchy

Return immediate child organizations of `organization_id`.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `organization_id` | path | integer | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/forecasts/search`

**Search procurement forecasts**

Tags: Forecasts

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `source` | query |  | no | fco \| dhs \| hhs |
| `agency` | query |  | no | Agency name (partial match) |
| `naics` | query |  | no | NAICS code (prefix match, e.g. 5415) |
| `set_aside` | query |  | no | Set-aside program (8(a), WOSB, HUBZone, SDVOSB, SB) |
| `state` | query |  | no | Place-of-performance state (2-letter) |
| `est_award_fy` | query |  | no | Estimated award fiscal year |
| `est_award_quarter` | query |  | no | Estimated award quarter (1-4) |
| `amount_min` | query |  | no | Min estimated value (USD) |
| `amount_max` | query |  | no | Max estimated value (USD) |
| `status` | query |  | no | Lifecycle status (FCO only), e.g. 'Acquisition Planning' |
| `is_recompete` | query |  | no | Only forecasts that name a current incumbent |
| `keywords` | query |  | no | Full-text search over title + description |
| `active_only` | query | boolean | no | Default true: upcoming, not-yet-awarded forecasts only |
| `fields` | query |  | no | Comma-separated response fields to return |
| `sort_by` | query |  | no | est_award_fy \| est_solicitation_date \| value_high \| agency \| last_updated_date |
| `sort_order` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/identifiers/{identifier}`

**Resolve DUNS ↔ UEI**

Tags: Identifiers

Free reverse lookup between legacy DUNS (9 digits, or 13-digit DUNS+4) and current UEI (12 alphanumeric). Accepts either side; returns both plus the entity name and FFATA evidence count.

**Coverage truth.** The crosswalk is built from FFATA Section 2 subaward filings since FY2025, where both identifiers co-exist on the same record. A 404 here means *not in the FFATA-derived crosswalk* (about 24K firms indexed), not *not in SAM*. The official SAM DUNS↔UEI translator is admin-gated and not publicly available.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `identifier` | path | string | yes |  |

**Responses:**
- `200`: Pair found. Returns DUNS, UEI, entity name, evidence count, last seen.
- `404`: Identifier not in the FFATA-derived crosswalk.
- `422`: Identifier shape invalid (not 9-digit DUNS, not 12-char UEI).
- `429`: Rate limit exceeded.

### `POST /api/v1/keys`

**Create API Key**

Tags: Management

Create or regenerate API key. New users get free trial, existing users keep current plan.

**Responses:**
- `200`: Successful Response

### `GET /api/v1/me`

**Current User Info**

Tags: Management

Get current user's plan and account information

**Responses:**
- `200`: Successful Response

### `GET /api/v1/naics`

**Discover NAICS codes by current federal spending + small-business set-aside leverage (free)**

Tags: Market Intelligence

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `sector` | query |  | no | 2-digit NAICS sector prefix. |
| `prefix` | query |  | no | Any-length NAICS prefix. |
| `min_market` | query |  | no | Minimum FY25+ obligated dollars. |
| `max_competitors` | query |  | no | Maximum distinct winning firms. |
| `set_aside_family` | query |  | no | Only codes with obligations in this set-aside family (total_small_business, 8a, sdvosb, wosb, hubzone, veteran, native). |
| `keywords` | query |  | no | Match the NAICS description text. |
| `sort_by` | query | string | no | market \| competitors \| setaside_pct |
| `sort_order` | query | string | no | asc \| desc |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/naics/leaderboard/{board}`

**Market Pulse leaderboard (free): ranked NAICS markets by size / competition / set-aside leverage**

Tags: Market Intelligence

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `board` | path | string | yes |  |
| `limit` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/naics/{code}`

**Federal market profile for a NAICS code (free): spending, competition, set-aside leverage, top buyers + incumbents**

Tags: Market Intelligence

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/naics/{code}/competition`

**How contested is this NAICS market? (free) The facts a would-be competitor needs: competition (offers per award + single-bidder share), geography (where the work is), trend (award volume by quarter), accessibility (share of recent winners holding only one or two awards), and the winner-cert set-aside mix (the $-share going to firms holding each socioeconomic certification). Whole-market, over FPDS prime awards. Factual, never scored.**

Tags: Market Intelligence

How contested a NAICS market is, over FPDS prime awards (whole market, deduped to award). Four blocks
a would-be competitor needs and which live nowhere else in the API: competition (offers received +
single-bidder share), geography (top place-of-performance states), trend (award volume by quarter), and
accessibility (the share of the last year's winners holding only one or two awards in the NAICS , the
long tail that shows the market is not locked up by incumbents). competition/geography/accessibility read
the trailing 12 months; trend runs the full FY2025+ record. Facts only; the reader interprets. Distinct
from /naics/{code} (size + concentration), /simplified-acquisition (the small-buy value bands), and
/positioning (the language).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/naics/{code}/positioning`

**How this market is described + its set-aside makeup + who solicits it (free): the language to put in your SAM/DSBS profile and capability statement so contracting officers find you**

Tags: Market Intelligence

The solicitation side of a NAICS market (last 24 months of SAM opportunities): the phrase
vocabulary contracting officers use, the set-aside makeup (share of notices), and the top soliciting
agencies. Pair with GET /api/v1/naics/{code} for the award side (spending, incumbents, competition).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/naics/{code}/simplified-acquisition`

**Award-value breakdown for a NAICS (free): counts of micro / simplified-acquisition / above-SAT awards, and the offices making simplified-acquisition-band awards with distinct-firm and set-aside counts. Factual, never scored.**

Tags: Market Intelligence

The award-value bands for a NAICS over the last 12 months of FPDS prime awards (FAR Part 13 context:
buys at/below the $350k Simplified Acquisition Threshold use streamlined procedures, and the $15k-$350k
band is reserved for small business under the FAR 19.502-2(a) Rule of Two). Returns the per-band award
counts and, for the simplified-acquisition band, the offices by award count with the number of distinct
firms that won and the set-aside share. Facts only; the reader interprets. Pair with /positioning (the
language) and /naics/{code} (the whole-market picture).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/offices`

**Which contracting offices buy a NAICS, ranked, each with its own competition + set-aside facts (free)**

Tags: Contracting Offices

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query | string | yes | NAICS code, 2-6 digits. Required. |
| `sort` | query | string | no | biggest \| most_open \| most_setaside |
| `limit` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/offices/{office_code}`

**How one contracting office buys: obligations, competition, set-aside lean, and the NAICS it buys (free)**

Tags: Contracting Offices

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `office_code` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/opportunities/delta`

**Delta Sync**

Tags: Delta Sync

Get all opportunities added or modified since a given timestamp. Use this to keep your local database in sync without re-pulling everything.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `since` | query | string | yes | ISO 8601 timestamp (e.g. 2026-04-05T06:00:00Z). Returns records where last_seen >= this value. |
| `limit` | query |  | no | Results per page. Defaults to your plan maximum: 1,000 on paid plans, 100 on the free trial. |
| `offset` | query | integer | no | Pagination offset |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/opportunities/search`

**Search Contract Opportunities**

Tags: Search

Search federal contract opportunities. All filters available on every plan. Developer plan adds a larger page size (1,000 vs 100) and a 1,000/hour rate limit.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query |  | no |  |
| `psc` | query |  | no |  |
| `psc_type` | query |  | no |  |
| `agency` | query |  | no |  |
| `state` | query |  | no |  |
| `posted_after` | query |  | no |  |
| `due_before` | query |  | no |  |
| `due_after` | query |  | no |  |
| `keywords` | query |  | no | Full-text search across title, agency name, and contract description. Also matches solicitation number. |
| `set_aside` | query |  | no |  |
| `notice_type` | query |  | no |  |
| `solicitation_number` | query |  | no | Exact solicitation number (e.g., USCA25Q0053) |
| `value_min` | query |  | no |  |
| `value_max` | query |  | no |  |
| `location` | query |  | no |  |
| `date_from` | query |  | no |  |
| `date_to` | query |  | no |  |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `naics_multiple` | query |  | no |  |
| `has_attachments` | query |  | no |  |
| `content` | query |  | no | Full-text search INSIDE the solicitation's attached documents (PDF, Word, Excel, PowerPoint, and scanned pages via OCR), not just the title and description. Finds requirements that appear only in the documents (award method, clearance level, period of performance, incumbent, compliance bars like FedRAMP or CMMC). Supports quoted phrases, e.g. content="lowest price technically acceptable". Pro plan. |
| `active_only` | query | boolean | no | Convenience filter, computed by us from `archive_date_detailed`. When true, returns only notices whose archive date is in the future (i.e. currently open). This is NOT a SAM source field — the stored `active` column is always 'Yes' by design (we never archive). Equivalent to filtering `archive_date_detailed > CURRENT_DATE` yourself. |
| `limit` | query | integer | no | Results per page. Default 100; maximum 100 on the free trial and 1,000 on paid plans. |
| `offset` | query | integer | no | Pagination offset |
| `format` | query | string | no | Response format. Only `json` is supported. |
| `fields` | query |  | no | Comma-separated list of response fields to return. Reduces payload size when you only need a few columns. Example: `fields=notice_id,title,naics,posted_date`. `notice_id` is always included. Omit to return all 59 fields per record (default). |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/opportunities/{notice_id}`

**Get Single Opportunity**

Tags: Search

Retrieve detailed information for a specific contract opportunity

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `notice_id` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/opportunities/{notice_id}/attachments`

**Get Opportunity Attachments**

Tags: Search

Retrieve attachments for a specific contract opportunity. Returns direct SAM.gov download URLs plus a parallel `files` array with each file's filename, size, and type.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `notice_id` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/partners/search`

**Find teaming/partner firms with real past performance by NAICS + agency + state + set-aside (Pro)**

Tags: Partners

Factual partner-finder. Composes prime_awards past performance + entities
(POCs, firmographics, registration). Ranked by gross obligated $ (recency
tiebreak). No scores.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query |  | no | NAICS code (exact) |
| `agency` | query |  | no | Agency name/acronym, crosswalk-resolved (e.g. Army, Navy, USACE) |
| `state` | query |  | no | Place-of-performance state (2-letter) |
| `set_aside` | query |  | no | sdvosb \| vosb \| wosb \| woman_owned \| hubzone \| 8a \| sdb \| minority_owned |
| `psc` | query |  | no | Product/Service Code (exact) |
| `keywords` | query |  | no | Match in the award description |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/pricing/benchmark`

**Comparable-award price benchmark for a NAICS, segmented by contract pricing type**

Tags: Pricing

Percentile distribution of comparable contract value, by pricing type.

Per conventions §1.2 (aggregate → flat object), §3.5, §3.7, §6.1, §8.2, §9.1.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query |  | no | NAICS, exactly 6 digits (required) |
| `set_aside` | query |  | no | Set-aside code, exact (e.g. 8A, 8AN, SBA, SDVOSBC, WOSB, HZC, NONE) |
| `psc` | query |  | no | Product/Service Code, 1-4 alphanumeric, exact (finer scope than NAICS, e.g. DA01, R425) |
| `pricing_type` | query |  | no | Pin one contract pricing type (e.g. 'FIRM FIXED PRICE', 'TIME AND MATERIALS') |
| `agency` | query |  | no | Buying agency: name / acronym / CGAC code (e.g. 'Navy', 'Department of Defense', '1700'). Narrows the comparable set to that agency. |
| `value_basis` | query |  | no | current (default) \| potential \| obligated |
| `date_from` | query |  | no | YYYY-MM-DD (action_date lower bound) |
| `date_to` | query |  | no | YYYY-MM-DD (action_date upper bound) |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/pricing/labor-rates`

**Awarded labor-rate (should-cost) benchmark for a labor category, from GSA CALC**

Tags: Pricing

Awarded ceiling-rate distribution + comparable rates for a labor category.

Per conventions §1.2 (aggregate -> flat object), §3.5, §3.7, §6.1, §8.2, §9.1.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `labor_category` | query |  | no | Labor category to benchmark (required) |
| `match` | query | string | no | labor_category match: contains (default) \| exact |
| `education_level` | query |  | no | HS \| AA \| BA \| MA \| PHD \| OTHER |
| `min_experience` | query |  | no | min years experience floor |
| `max_experience` | query |  | no | min years experience ceiling |
| `naics` | query |  | no | 6-digit NAICS (via the SIN bridge) |
| `vendor` | query |  | no | Vendor name (substring; competitor / self rate-card lookup) |
| `worksite` | query |  | no | Customer \| Contractor \| Virtual |
| `business_size` | query |  | no | S (small business) \| O (other than small) |
| `security_clearance` | query |  | no | Yes \| No |
| `value_basis` | query |  | no | current (default) \| next_year \| second_year |
| `sample_limit` | query | integer | no | how many comparable rates to return |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/pricing/position`

**Where does YOUR value sit: percentile rank + the real comparable contracts nearest it**

Tags: Pricing

Rank YOUR value against the comparable set + return the nearest real contracts.

Same comparable-set filters as /benchmark (shared `_resolve_filters`), plus the
caller's own `value`. Returns the percentile rank, the comparable distribution
inline (so the call is self-contained), and the `sample_limit` contracts closest
to `value` so the position can be judged justified by eye.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query |  | no | NAICS, exactly 6 digits (required) |
| `value` | query |  | no | YOUR contract/bid value in dollars, e.g. 2200000 or $2,200,000 (required) |
| `set_aside` | query |  | no | Set-aside code, exact (e.g. 8A, 8AN, SBA, SDVOSBC, WOSB, HZC, NONE) |
| `psc` | query |  | no | Product/Service Code, 1-4 alphanumeric, exact (the scope lever, e.g. DA01, R425) |
| `pricing_type` | query |  | no | Pin one contract pricing type (recommended for an apples-to-apples position) |
| `agency` | query |  | no | Buying agency: name / acronym / CGAC code (e.g. 'Navy', 'Department of Defense', '1700'). Narrows the comparable set to that agency. |
| `value_basis` | query |  | no | current (default) \| potential \| obligated (your value is read on this basis) |
| `sample_limit` | query | integer | no | How many comparable contracts to return (nearest to your value) |
| `date_from` | query |  | no | YYYY-MM-DD (action_date lower bound) |
| `date_to` | query |  | no | YYYY-MM-DD (action_date upper bound) |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/protests`

**Federal bid protests, pending and decided: who protested, on which solicitation, when it was filed, the date GAO must decide by, and the outcome. status=Open is the live set; filter to Sustained for the protests that actually disturbed an award. Factual, never scored.**

Tags: Bid Protests

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `outcome` | query |  | no | Denied \| Dismissed \| Sustained \| Withdrawn \| Granted |
| `agency` | query |  | no | Awarding-agency substring, case-insensitive |
| `status` | query |  | no | Open \| Closed. Open = the protest is still pending before GAO. |
| `case_type` | query |  | no | e.g. 'Bid Protest' or 'Reconsideration'. Substring, case-insensitive. |
| `filed_from` | query |  | no | Filed on or after this ISO date (YYYY-MM-DD). |
| `filed_to` | query |  | no | Filed on or before this ISO date (YYYY-MM-DD). |
| `case_number` | query |  | no | GAO case, e.g. 'B-424433'. Returns every docket on that case (B-424433.1, .2, ...). |
| `protester` | query |  | no | The firm that FILED the protest. Substring, case-insensitive. Use this rather than `search` for competitor research: `search` also matches the agency column. |
| `search` | query |  | no | Full-text over protester, agency, solicitation number and file number. Wrap in double quotes for a phrase. |
| `fields` | query |  | no | Comma-separated response fields to return. `b_number` is always included. Example: `fields=b_number,outcome,due_date`. Omit for the full row. |
| `sort` | query | string | no | recent (default) \| oldest \| filed \| due. 'due' = soonest statutory deadline first. |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/protests/{solicitation_number}`

**Every protest on one solicitation (Pro): the contestability read for an opportunity or an award, including any protest pending right now and the date it must be decided by.**

Tags: Bid Protests

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `solicitation_number` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `402`: Caller's plan does not include Pro. The feed at /api/v1/protests is on every plan.
- `422`: Validation Error

### `GET /api/v1/psc/search`

**Search Product & Service Codes**

Tags: Reference

Search the federal Product & Service Code (PSC) catalog by code prefix or name/description text (`keywords`). Each code carries its official name and description, whether it is a Service or a Product, its category-management hierarchy (category / subcategory / parent group), whether it is currently active, and how many prime awards we hold use it (results are ordered active-first, then most-used). Authoritative structure from the GSA PSC Manual; free on any plan. With no filters it returns the full catalog, paginated. Pass `active_only=true` to hide retired codes.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `keywords` | query | string | no | Code prefix or name/description substring (case-insensitive) |
| `category` | query | string | no | Category-management Level 1 (e.g. 'Professional Services') |
| `psc_type` | query | string | no | 'Service' or 'Product' |
| `active_only` | query | boolean | no | Exclude retired codes |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/psc/{code}`

**Get one Product & Service Code**

Tags: Reference

Resolve a Product & Service Code to its official name, description, category-management hierarchy, active/retired status, and prime-award usage count. Free on any plan.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `code` | path | string | yes |  |

**Responses:**
- `200`: Code found.
- `400`: Code is not 1-4 alphanumeric characters.
- `404`: Well-formed code not present in the GSA PSC catalog.
- `422`: Validation Error

### `GET /api/v1/recompetes`

**List Recompetes**

Tags: Recompetes

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `naics` | query |  | no | NAICS, exactly 6 digits |
| `agency` | query |  | no | Awarding agency name substring |
| `set_aside` | query |  | no | Set-aside type substring |
| `state` | query |  | no | Place-of-performance state code |
| `amount_min` | query |  | no | Min current contract value (USD) |
| `amount_max` | query |  | no | Max current contract value (USD) |
| `ends_after_months` | query | integer | no | Window floor: exclude contracts ending sooner than N months (set ~6 to skip the too-late-to-influence band) |
| `ends_within_months` | query | integer | no | Window ceiling: contracts ending within N months |
| `date_anchor` | query | string | no | Which date the window applies to: current_end (next decision point) \| potential_end (guaranteed recompete, all options used) |
| `options_exhausted_only` | query | boolean | no | If true, only contracts whose options are ~exhausted (the high-confidence 'must recompete, not renew' subset) |
| `options_window_days` | query | integer | no | Options counted ~exhausted when potential_end is within N days of current_end (used only with options_exhausted_only) |
| `incumbent_excluded` | query |  | no | If true, only recompetes whose incumbent is CURRENTLY on the SAM exclusions list (can't legally win the recompete). If false, only recompetes whose incumbent is clean. Omit for both. |
| `sort_by` | query | string | no | ends_soonest \| value \| mod_churn \| de_obligated |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `early_signal_days` | query | integer | no | Early-signal feed lookback window, in days (how far back to pull live notices) |
| `early_signal_types` | query | string | no | Comma-separated early-signal notice types (aliases): sources_sought, rfi, presolicitation, special_notice, industry_day, solicitation, rfp, combined, justification, award_notice |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/recompetes/{piid}`

**Recompete Detail**

Tags: Recompetes

One recompeting/expiring contract by PIID, plus the incumbent-vulnerability signals
(cert-lapse / lone-holder / single-agency) composed from the incumbent's DSBS certifications and
FPDS obligation history. Factual, signals-not-scores. Pro. Not windowed (an ID lookup).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/spending/{cut}`

**Spending Rollup**

Tags: spending

One precomputed federal-spending rollup, obligation-ranked. `cut` is one of
`by-agency`, `by-psc`, `by-set-aside`. Trailing 12 months over FPDS prime awards. Free.

`by-set-aside` reports only dollars EXPLICITLY coded to each set-aside program (a floor);
the ~93% of federal dollars that carry no set-aside code are excluded, not shown as
"not set aside" (most are orders inheriting a parent's set-aside).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `cut` | path | string | yes |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/status`

**Data status: per-source row counts + freshness**

Tags: Public

Consolidated, always-consistent view of every data source: how much we hold and how current it is. Public response is rounded totals + freshness; send a valid API key for exact counts + density.

**Responses:**
- `200`: Successful Response

### `GET /api/v1/subawards/search`

**Search FFATA subawards by prime/sub UEI, contract PIID, agency, NAICS, or keywords**

Tags: Subawards

Filter-based subaward search with the standard envelope + window block.

Per conventions §1.1, §3.5, §4.2, §5, §6.1, §9.3.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `prime_uei` | query |  | no |  |
| `sub_uei` | query |  | no |  |
| `piid` | query |  | no |  |
| `agency` | query |  | no | Awarding agency name substring (case-insensitive) |
| `naics` | query |  | no | Exactly 6 digits |
| `sub_name` | query |  | no | Sub-vendor name substring (case-insensitive) |
| `date_from` | query |  | no | YYYY-MM-DD |
| `date_to` | query |  | no | YYYY-MM-DD |
| `amount_min` | query |  | no |  |
| `amount_max` | query |  | no |  |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/subawards/{subaward_sam_report_id}`

**Single FFATA report by SAM report ID (UUID)**

Tags: Subawards

Single-record lookup. Returns flat object per §1.2. NOT windowed (§4.4).

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `subaward_sam_report_id` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/vehicles/search`

**Search contract vehicles (IDIQ, GWAC, FSS, BPA, BOA) by holder, agency, NAICS, or type**

Tags: Vehicles

One row per VEHICLE (latest transaction), not per transaction. See the
module docstring for why the grain differs from /contracts/search.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | query |  | no | Vehicle holder UEI (exact) |
| `parent_uei` | query |  | no | Holder parent UEI (corporate roll-up) |
| `piid` | query |  | no | Vehicle PIID (exact) |
| `agency` | query |  | no | Awarding agency name, acronym, or code |
| `naics` | query |  | no | NAICS, exactly 6 digits |
| `idv_type` | query |  | no | IDC, FSS, BPA, GWAC, or BOA |
| `active_only` | query |  | no | Only vehicles whose period of performance has not ended |
| `date_from` | query |  | no | YYYY-MM-DD (action_date). Not floored: see the window block |
| `date_to` | query |  | no | YYYY-MM-DD (action_date) |
| `ceiling_min` | query |  | no | Vehicle ceiling min (potential_total_value_of_award) |
| `ceiling_max` | query |  | no | Vehicle ceiling max (potential_total_value_of_award) |
| `sort_by` | query |  | no |  |
| `sort_order` | query |  | no |  |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | lean \| expanded \| full \| comma-list of columns |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/vehicles/{piid}`

**Single contract vehicle — ceiling, period, and what has been ordered through it**

Tags: Vehicles

Latest transaction for the vehicle, plus two roll-ups.

Detail shape per §1.2: singular `vehicle` key with the roll-ups as SIBLINGS,
not nested inside it.

`orders_rollup` is the block that makes this endpoint worth calling: the
vehicle's own transactions carry the CEILING, but the money moves on the orders
placed against it, which live in the contracts table. A vehicle without its
orders is a stub.

`transaction_rollup`/`orders_rollup` are deliberately scoped to THIS ONE PIID,
matching how USAspending's own IDV award view works (verified against their
public API contract 2026-08-29: a single award's child-orders view has no
cross-awardee aggregation option). On a multiple-award IDIQ, every awardee
holds a SEPARATE PIID, so `distinct_awardees` here can never exceed 1 , that
is a structural fact, not a bug, and family-blending the money/order numbers
would answer a different question than the one the URL asked. What WAS
missing: any signal in this response that the vehicle is part of a larger
family at all. `vehicle_family` below closes that gap cheaply (reusing the
same `vehicle_family_piids()` resolution `/holders` already proves out)
without touching what the roll-up numbers mean.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |
| `fields` | query |  | no | lean \| expanded \| full \| comma-list of columns |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/vehicles/{piid}/holders`

**Pro: who holds this vehicle, and who is actually earning through it**

Tags: Vehicles

The "can I even compete for this work" answer.

Returns two distinct populations, because conflating them would mislead:
`awardees` hold the vehicle; `earners` have actually been paid through it. A
firm can hold a vehicle for years and earn nothing on it.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `piid` | path | string | yes |  |
| `limit` | query | integer | no |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `POST /api/v1/vendor-risk/bulk`

**Bulk vendor risk screening (up to 100 UEIs)**

Tags: Vendor Risk (Pro)

Return risk reports for each supplied UEI. Not-found UEIs come back
with status='not_found' rather than failing the whole request — stale
UEIs in vendor lists are normal.

**Request body:**
- Content type: `application/json`

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/vendor-risk/{uei}`

**Vendor risk report for a UEI**

Tags: Vendor Risk (Pro)

Return all seven risk signals for a single UEI.

Always returns 200 with the full signal shape, even for clean vendors.
Never returns a risk score; callers interpret the signals themselves.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `uei` | path | string | yes |  |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/wage-determinations/by-location`

**WDs applicable in a state/county**

Tags: Wage Determinations

The compliance shortcut: 'I'm bidding a contract in this state/county,
which wage determinations apply?' Returns all currently-active DBA, SCA,
and CBA records that include the requested jurisdiction.

Statewide DBAs (location with no county) are included regardless of the
`county` filter, since they apply everywhere in the state. No date filter,
so no window block: this endpoint answers "what is in force here now".

`type` narrows to DBA/SCA/CBA. Without it, CBAs sort first (alphabetical
`wd_type`) and can dominate the default page in a CBA-heavy jurisdiction ,
a services bidder checking Davis-Bacon/SCA coverage previously had no way
to filter them out.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `state` | query | string | yes | 2-letter US state code |
| `county` | query |  | no | County name (optional; omit for statewide) |
| `type` | query |  | no | DBA \| SCA \| CBA (optional; omit for all types) |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | Comma-list of response fields to return |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/wage-determinations/rate-summary`

**Prevailing-wage floor for one occupation (distribution)**

Tags: Wage Determinations

The labor-cost FLOOR for one occupation, aggregated across wage determinations:
base hourly percentiles + the Health & Welfare fringe + how many WDs set it. The
`/rates` listing gives the individual county rate lines; this gives their
distribution in one call, what a services bidder needs to price loaded labor,
which on an SCA contract drives the bid far more than the award value.

Provide `occupation_code` (exact, preferred) or `classification` (substring). The
binding rate on a given contract is the county-of-performance floor; this is the
national distribution. Free on every plan.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `occupation_code` | query |  | no | SCA 5-digit occupation code, e.g. 11150 (Janitor), 27101 (Guard). The precise key. |
| `classification` | query |  | no | Trade/occupation name substring, e.g. 'Guard'. Used when no occupation_code is given. |
| `type` | query |  | no | SCA \| DBA (default SCA). CBAs have no rate table. |
| `state` | query |  | no | 2-letter state code: scope to WDs covering that state (via the WD's jurisdictions). |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/wage-determinations/rates`

**Query prevailing-wage rates by occupation**

Tags: Wage Determinations

Query prevailing-wage rates ACROSS wage determinations, by occupation. The
listing endpoints answer "which WDs apply here"; this answers "what does a given
trade actually pay". Each row is one classification's hourly base wage plus
fringe, tied to the WD it came from.

Patterns:
- Electrician rates in WDs covering California:
  `?classification=Electrician&state=CA&active_only=true`
- One SCA occupation code:
  `?occupation_code=23210`
- Every rate line on one WD:
  `?wd_number=AK20260001`

DBA rows carry a `rate_group` (survey/union code) and a per-classification fringe;
SCA rows carry an `occupation_code` and the document-level Health & Welfare fringe.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `classification` | query |  | no | Trade/occupation name substring (e.g. 'Electrician') |
| `type` | query |  | no | DBA \| SCA (CBAs have no rate table) |
| `occupation_code` | query |  | no | SCA 5-digit occupation code (e.g. 23210) |
| `wd_number` | query |  | no | Exact WD number (e.g. 'AK20260001') |
| `state` | query |  | no | 2-letter US state code (via the WD's jurisdictions) |
| `active_only` | query | boolean | no | Only rates on currently-effective WDs |
| `sort_by` | query |  | no | base_rate \| classification \| wd_number |
| `sort_order` | query |  | no | asc \| desc (default desc) |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | Comma-list of response fields to return |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/wage-determinations/search`

**Search wage determinations**

Tags: Wage Determinations

Filter Davis-Bacon (DBA), Service Contract Act (SCA), and CBA
determinations. Common patterns:

- All active DBA WDs in Cook County, IL:
  `?type=DBA&state=IL&county=Cook&active_only=true`
- Track revisions since a date:
  `?date_from=2026-04-01&active_only=true`
- Look up by number:
  `?wd_number=AK2026`

Returns at most 100 records per page. Pagination via `limit` + `offset`.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `type` | query |  | no | DBA \| SCA \| CBA |
| `state` | query |  | no | 2-letter US state code |
| `county` | query |  | no | County name substring (e.g. 'Cook') |
| `wd_number` | query |  | no | WD number substring (e.g. 'AK2026', '1994-2371') |
| `active_only` | query | boolean | no | Only currently-effective WDs |
| `date_from` | query |  | no | ISO YYYY-MM-DD; modified on/after this date |
| `date_to` | query |  | no | ISO YYYY-MM-DD; modified on/before this date |
| `construction_type` | query |  | no | DBA only: Building \| Heavy \| Highway \| Residential |
| `sort_by` | query |  | no | modified_date \| publish_date \| wd_number \| revision_number |
| `sort_order` | query |  | no | asc \| desc (default desc) |
| `limit` | query | integer | no |  |
| `offset` | query | integer | no |  |
| `fields` | query |  | no | Comma-list of response fields to return |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /api/v1/wage-determinations/{wd_id}`

**Get a single wage determination**

Tags: Wage Determinations

Lookup by sgs `wd_id` (the internal ID, e.g. '43309') or by the
human-readable WD number (e.g. 'AK20260001'). Returns the canonical record
with full location array, a `rates[]` block (for DBA/SCA: each classification's
hourly wage + fringe), and (for CBAs) the `cba` detail block: contractor name,
union, effective dates, services covered.

Flat detail response (§1.2): the record at the top level, no pagination. The
`rates` and `cba` enrichment blocks sit alongside the record fields (like the
existing `cba` block), so their presence/absence is explicit.

**Parameters:**

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `wd_id` | path | string | yes |  |
| `fields` | query |  | no | Comma-list of response fields to return |

**Responses:**
- `200`: Successful Response
- `422`: Validation Error

### `GET /demo/samples`

**Demo Samples**

Real responses from each major endpoint, one per tab, cached 6h.

**Responses:**
- `200`: Successful Response

### `GET /favicon.ico`

**Favicon Ico**

Serve favicon.ico (redirect to SVG)

**Responses:**
- `200`: Successful Response

### `GET /health`

**Health**

Health check endpoint.

**Responses:**
- `200`: Successful Response

### `GET /robots.txt`

**Robots**

Generate robots.txt for search engine crawlers

**Responses:**
- `200`: Successful Response

### `GET /sitemap.xml`

**Sitemap**

Generate XML sitemap for search engines including daily snapshots

**Responses:**
- `200`: Successful Response
