# US Government Contracts — Federal Awards Search (AI) (`noniner/us-gov-contracts`) Actor

Search US federal contract and grant awards from the official USAspending.gov data: who won what, how much, from which agency — with an AI summary of a company's or sector's federal footprint. For B2G sales, competitive intel and research.

- **URL**: https://apify.com/noniner/us-gov-contracts.md
- **Developed by:** [Fredrik Hansson](https://apify.com/noniner) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$150.00 / 1,000 query analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Government Contracts — Federal Awards Search (AI)

**See exactly who is winning US federal money — and what that means for your pipeline.** Hand this Actor a company name or a keyword like `cybersecurity`, and it searches the official **USAspending.gov** award data: every **federal contract** and **grant** that matches, who won it, how much, and from which agency. Then OpenAI reads the whole award set and writes a plain-English **summary of that company's or sector's federal footprint** — totals, top agencies, the kinds of work being funded, and a one-line **opportunity signal** for a B2G seller.

You bring names or keywords. It hands back the money trail plus the read on it.

***

### The flow

```
1. Give company names or keywords     2. USAspending.gov API              3. Get awards + AI summary
   (e.g. "Palantir",              →      official federal award      →      one row per award +
    "cybersecurity")                      data, no key needed                a footprint summary
```

1. **List your queries** — company / recipient names (`Booz Allen`, `Palantir`) or keywords describing a sector (`cybersecurity`, `satellite`, `nursing`).
2. **The Actor calls the public USAspending API** for each query, pulling the top awards by dollar amount in your look-back window.
3. **OpenAI summarises the footprint** — grounded strictly in the award rows, never inventing amounts — and you get a clean dataset: one record per award plus one summary record per query.

***

### What you get per query

For every query, the Actor:

1. **Pulls the top federal awards by amount** from USAspending.gov for your chosen award types (**contracts** and/or **grants**) and look-back window (default 3 years). One dataset record per award: `awardId`, `recipient`, `amount`, `awardingAgency`, `subAgency`, `startDate`, `endDate`, `awardType`, `description`, and a direct `usaspendingUrl` to the award page.
2. **Aggregates the set** — `totalAwards`, `totalAmount` (sum of award amounts), `topAgencies` and `topRecipients` (with dollar totals and counts).
3. **Summarises with AI** (OpenAI `gpt-4o-mini`, a fast and low-cost model), grounded only in the data:
   - **`summary`** — 2–3 sentences on the federal footprint (totals, main recipient, main agency).
   - **`topAwards`** — the largest awards (`awardId`, `recipient`, `amount`, `agency`, `whatFor`).
   - **`themes`** — what kinds of work the awards fund.
   - **`notableAgencies`** — the agencies that show up most / spend most.
   - **`opportunitySignal`** — one sentence: for a B2G seller, where the budget and the buyers are.

All of this lands in one `recordType: "summary"` row per query.

***

### Three ways people use it

- **B2G / government sales intelligence** — see which agencies actually fund your category, how big the deals are, and which incumbents hold the **federal contracts** today. Walk into a **GovCon** pitch already knowing the money trail from the **USAspending API**.
- **Competitor federal-win tracking** — drop in a rival's name and read their **government awards** history: total federal revenue signal, which agencies buy from them, and the kinds of **federal contracts** they keep winning.
- **Market / sector research** — search a keyword (`AI`, `cybersecurity`, `logistics`) to map a whole **B2G** sector: top recipients, spending agencies and funding themes across years of **government awards** — ideal for market sizing, diligence and investor research.

Keywords: federal contracts, USAspending API, government awards, GovCon, B2G, federal grants, government spending data, public procurement, award search.

***

### Input

| Field | Type | Notes |
|---|---|---|
| `queries` | array | **Required.** Company / recipient names OR keywords. One per line. Each is searched and summarised. |
| `awardTypes` | array | `contracts` (codes A/B/C/D) and/or `grants` (codes 02/03/04/05). Default `["contracts"]`. |
| `timePeriodYears` | integer | Look back this many years from today. Default `3`. |
| `maxAwardsPerQuery` | integer | Top awards (by amount) to pull per query. Default `25`. |
| `maxResults` | integer | Max queries to process. Default `100`. |
| `maxConcurrency` | integer | Queries processed in parallel. Default `3`. |
| `model` | string | Override the OpenAI model. Default `gpt-4o-mini`. |

#### Minimal input example

```json
{
  "queries": ["Palantir", "Booz Allen", "cybersecurity"],
  "awardTypes": ["contracts"],
  "timePeriodYears": 3
}
```

***

### Output example

An **award row**:

```json
{
  "query": "Booz Allen",
  "recordType": "award",
  "awardId": "47QRAA20D000X",
  "recipient": "BOOZ ALLEN HAMILTON INC.",
  "amount": 318450000.0,
  "awardingAgency": "Department of Defense",
  "subAgency": "Department of the Army",
  "startDate": "2021-09-30",
  "endDate": "2026-09-29",
  "awardType": "Delivery Order",
  "description": "IT AND TELECOM- IT AND TELECOM SUPPORT SERVICES",
  "usaspendingUrl": "https://www.usaspending.gov/award/CONT_AWD_..."
}
```

A **summary row** (one per query):

```json
{
  "query": "Booz Allen",
  "recordType": "summary",
  "totalAwards": 25,
  "totalAmount": 2140000000,
  "topAgencies": [
    { "agency": "Department of Defense", "amount": 1450000000, "count": 14 },
    { "agency": "Department of Homeland Security", "amount": 410000000, "count": 5 }
  ],
  "topRecipients": [
    { "recipient": "BOOZ ALLEN HAMILTON INC.", "amount": 2140000000, "count": 25 }
  ],
  "themes": ["IT and telecom support", "cyber and intelligence analytics", "systems engineering"],
  "notableAgencies": ["Department of Defense", "Department of Homeland Security"],
  "topAwards": [
    { "awardId": "47QRAA20D000X", "recipient": "BOOZ ALLEN HAMILTON INC.", "amount": 318450000, "agency": "Department of Defense", "whatFor": "IT and telecom support services" }
  ],
  "opportunitySignal": "Defense IT and cyber budgets dominate this footprint — a B2G seller of secure IT services should target DoD and DHS program offices.",
  "summary": "Booz Allen's recent federal footprint is concentrated in Defense IT, cyber and analytics work, led by large DoD delivery orders. The Department of Defense is by far the dominant buyer, with Homeland Security a distant second."
}
```

***

### Pay-per-event pricing

This Actor uses **pay-per-event** billing with a single event:

| Event | Charged when | Price |
|---|---|---|
| `query-analyzed` | Once per company or keyword searched against USAspending and summarised with AI. | $0.15 |

The Actor logs its OpenAI token usage and the estimated AI cost at the end of every run, so the event price always stays safely above the model cost.

***

### Data source

All award data comes from **[USAspending.gov](https://www.usaspending.gov/)** — the US government's official, free, public source of federal spending data, via its open API (no API key required). This Actor reads only published award records; it does not add or alter any figures.

***

### Setup

The AI summary calls the OpenAI API. Set the environment variable / secret **`OPENAI_API_KEY`** on the Actor. Without it the run stops before the summary — the award search itself needs no key.

***

### Use it from an AI agent (Apify MCP server)

This Actor is available through the [Apify MCP server](https://mcp.apify.com), so AI agents (Claude, ChatGPT, or anything that speaks MCP) can call it as a tool — hand it `queries`, and read back the federal awards and footprint summary — with no custom integration code.

***

### Run it locally

```bash
npm install
## put your input in storage/key_value_stores/default/INPUT.json
export OPENAI_API_KEY=sk-...   # required for the AI summary
apify run -p
```

***

### Related actors

- [Nordic Public Tenders](https://apify.com/noniner/nordic-public-tenders) — NO/FI/SE public procurement tenders normalised into one English schema.
- [AI Company Enrichment](https://apify.com/noniner/ai-company-enrichment) — Turn a list of domains into structured company profiles — firmographics, contacts, socials and ICP fit.
- [B2B Account Brief](https://apify.com/noniner/b2b-account-brief) — AI account research briefs for B2B sales teams.
- [SEC Filings Extractor](https://apify.com/noniner/sec-filings-extractor) — Pull structured data from US SEC filings.

***

**Part of the [No Niner](https://noniner.io) toolkit** — no-code web scraping, enrichment & AI data tools, all pay-per-use. Browse the full set at **[noniner.io](https://noniner.io)**.

# Actor input Schema

## `queries` (type: `array`):

Company / recipient names OR keywords (e.g. "cybersecurity"). One per line. Each query is searched against USAspending and summarized with AI.

## `awardTypes` (type: `array`):

Which federal award types to include. "contracts" = procurement contracts, "grants" = grants / cooperative agreements.

## `timePeriodYears` (type: `integer`):

Look back this many years from today for awards.

## `maxAwardsPerQuery` (type: `integer`):

How many top awards (by amount) to pull per query.

## `maxResults` (type: `integer`):

Max number of queries to process. One pay-per-event charge per query analyzed.

## `maxConcurrency` (type: `integer`):

How many queries to process in parallel.

## `model` (type: `string`):

Override the model (default gpt-4o-mini).

## Actor input object example

```json
{
  "queries": [
    "Palantir",
    "Booz Allen"
  ],
  "awardTypes": [
    "contracts"
  ],
  "timePeriodYears": 3,
  "maxAwardsPerQuery": 25,
  "maxResults": 100,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `awards` (type: `string`):

All award and summary records in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "Palantir",
        "Booz Allen"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("noniner/us-gov-contracts").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": [
        "Palantir",
        "Booz Allen",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("noniner/us-gov-contracts").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "Palantir",
    "Booz Allen"
  ]
}' |
apify call noniner/us-gov-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,noniner/us-gov-contracts"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9ftaeRNbjqayP2QXe/builds/BNRXk1uSpDAtetQ5M/openapi.json
