Returns federal contract awards from USAspending.gov — government spending data sourced from Treasury/GSA

Returns federal contract awards from USAspending.gov — government spending data sourced from Treasury/GSA. Each record is one prime contract award (BPA Call, Purchase Order, Delivery Order, or Definitive Contract). Modifications appear as separate records. Use this when the user asks about: who's getting federal contracts, how much a specific recipient (Lockheed Martin, RTX, Raytheon, Booz Allen, etc.) won this year/quarter, contracts by industry (NAICS code) or product type (PSC code), or to cross-reference congressional trading with contract awards. Cross-source pattern (the political-alpha play): 1. get_congressional_trades(ticker:'LMT', since:'2026-01-01') — find LMT trades by members of Congress. 2. get_federal_contracts(recipient_name:'Lockheed Martin', since:'2026-01-01') — find LMT contract awards. 3. Compare timing — trades within 30 days before a major contract are the high-signal cases. ⚠ award_amount and total_outlays are NULLABLE, and total_outlays is null on MOST rows. USAspending omits Total Outlays from the search response about 75% of the time, and this tool now reports that as null rather than as $0 — a 0 here means the source really said zero. Do not do arithmetic on either field without a null check. Rows with a null value are excluded from min_amount filters and sort LAST, because a value we do not have cannot satisfy a threshold. recipient_name is a case-insensitive substring match — use the parent name ('Lockheed Martin') to catch all subsidiaries. COVERAGE — live passthrough (source:'live'): each call queries USAspending's API over the full dataset (2007-10 onward), with recipient/NAICS/PSC/min-amount/date filters applied server-side. The response's total_count is USAspending's authoritative award count for your filtered query — USE IT for volume answers (the results array is just the requested page). total_count is omitted — and coverage_warning says why — when USAspending cannot count the answer: a recipient_uei that is also the PARENT of other recipients (USAspending cannot filter to one UEI's own awards), recipient_name combined with recipient_uei, or a start_date window (sort_by start_date with since/until). Then has_more is true whenever the search stopped before the end. On USAspending outage the tool falls back to a recent cached window (source:'cache' + coverage_warning) — don't infer volume there.

get/v1/federal-contracts

Request

  • Base URL: https://api.keyvex.com
  • URL: https://api.keyvex.com/v1/federal-contracts
  • Auth: API key in header x-api-key

Query parameters

recipient_namestring

Recipient name substring; case-insensitive match. Example: 'Lockheed Martin' matches 'LOCKHEED MARTIN CORP', 'LOCKHEED MARTIN MISSILES AND FIRE CONTROL', etc. USAspending also matches the PARENT company's name, so a parent name returns its subsidiaries' awards (e.g. Sikorsky under 'Lockheed Martin'). Combined with recipient_uei it is matched against that recipient's OWN name instead, and coverage_warning says how many awards it removed.

recipient_ueistring

Unique Entity Identifier (replaced DUNS in 2022). 12-character alphanumeric. Exact match: only awards made to this UEI itself. If it is also the parent of other recipients, their awards are NOT included and total_count is omitted — coverage_warning names the parent; use recipient_name with that name for the whole family.

awarding_agencystring

The TOPTIER awarding agency name — exact and case-sensitive; a sub-agency name (e.g. 'Defense Logistics Agency') or an abbreviation ('NASA') matches nothing. Examples: 'Department of Defense', 'National Aeronautics and Space Administration', 'Department of Health and Human Services'.

naics_codestring

6-digit North American Industry Classification System code. Example: '541710' (R&D in Physical/Engineering/Life Sciences). Exact match.

psc_codestring

Product or Service Code (4-character). Example: 'AR33' (R&D Space Flight Advanced Development). Exact match.

min_amountnumber

Filter to awards with award_amount >= this value (USD). Use to focus on large contracts.

sincestring

ISO date (YYYY-MM-DD). Only records on or after this date — on last_modified_date, except when sort_by is start_date, where it applies to start_date.

untilstring

ISO date (YYYY-MM-DD). Only records on or before this date (the same date field as since).

sort_by'last_modified_date' | 'start_date' | 'award_amount' | 'total_outlays'

Field used for ordering. since/until apply to start_date when this is start_date, and to last_modified_date for every other sort. Default: last_modified_date (most-recently-modified first).

sort_order'desc' | 'asc'

Default: desc.

limitinteger

Maximum records to return. Default 50, max 500.

Response

JSON envelope: { results: [...], count, has_more }.

Changes

No recorded changes to this operation across all 1 revision of this API.