# Federal Contracts & Grants by Company (USAspending) (`swillz/federal-awards-by-company`) Actor

Get the federal contracts, grants and loans any US company won, from official USAspending.gov data. Search by company name or UEI, agency, NAICS, PSC, state or keyword. Returns award rows plus a company summary: total obligated, top agencies and NAICS. Misses are free.

- **URL**: https://apify.com/swillz/federal-awards-by-company.md
- **Developed by:** [William Jin](https://apify.com/swillz) (community)
- **Categories:** Lead generation, Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 1,000 award or company summary returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Federal Contracts & Grants by Company (USAspending)

See which **US federal contracts, grants and loans a company has won**, straight from the official **USAspending.gov** data. Give it company names or SAM.gov UEIs and get back:

- **award rows** with amount, agency, dates, NAICS, PSC, description and a link;
- a **company summary** with total obligated, matched legal entities, top agencies and top NAICS codes.

You can also search with no company at all, by agency, NAICS, PSC, state or keyword.

Built for B2B sales and GovCon teams, analysts and investors doing due diligence, journalists, and AI agents that need to answer "how much federal money does company X get?"

### What can it do?

- **Company to awards in one call.** `"Palantir"` returns PALANTIR USG INC and PALANTIR TECHNOLOGIES INC. with their largest awards, both included automatically.
- **No fuzzy junk.** USAspending's own name search is fuzzy: "Booz Allen" also returns unrelated firms. The Actor keeps only recipients whose name contains every word of your query, then pulls their awards by UEI.
- **UEI lookups.** A 12-character UEI like `JCBMLGPE6Z71` gives an exact match.
- **A company summary row.** It shows obligated in the period, matched recipient names and UEIs, the top 5 awarding agencies and the top 5 NAICS codes.
- **Contracts, IDVs, grants and loans.** IDVs cover GSA schedules, GWACs, IDIQs and BPAs.
- **Filters.** Narrow by date range (back to FY2008), awarding agency, NAICS, PSC, place of performance state, keyword and minimum amount.
- **Filters-only mode.** Leave `companies` empty to find, for example, the largest Department of Energy cybersecurity contracts performed in Virginia.
- **Misses are free.** Unknown companies come back as a free `not_found` row with tips.

### What data does it return?

| Field | Example |
|---|---|
| `type`, `query`, `status`, `rank` | `award`, `Palantir`, `found`, `1` |
| `awardCategory`, `awardType`, `awardId` | `contract`, `DEFINITIVE CONTRACT`, `W52P1J...` |
| `recipientName`, `recipientUei` | `PALANTIR USG INC`, `...` |
| `amount`, `totalOutlays` | `637552404.79`, `...` |
| `startDate`, `endDate`, `description` | `2024-05-29`, `2029-05-28`, `...` |
| `awardingAgency`, `awardingSubAgency`, `fundingAgency` | `Department of Defense`, `Department of the Army` |
| `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription` | `541511`, `CUSTOM COMPUTER PROGRAMMING SERVICES` |
| `assistanceListings` (grants and loans) | `["93.855 Allergy and Infectious Diseases Research"]` |
| `placeOfPerformanceState`, `usaspendingUrl`, `recipientProfileUrl` | `VA`, `https://www.usaspending.gov/award/...` |

The `company_summary` row adds `obligatedInPeriod`, `matchedRecipients` (name, UEI, amount), `topAwardingAgencies`, `topNaics`, `periodStart`, `periodEnd` and `awardsReturned`.

**Statuses:**

- Charged: `found`.
- Free: `not_found`, `invalid_input`, `service_unavailable` and `skipped_charge_limit`.

### How much does it cost?

You pay per record returned. An award row or a company summary row each count as one record:

| Plan | Per 1,000 records |
|---|---|
| Free | $2.00 |
| Bronze | $1.70 |
| Silver | $1.40 |
| Gold | $1.10 |

A company with a summary and its top 20 awards costs about $0.04. Misses are **free**. There is also a tiny Apify start fee of $0.00005 per run.

### Input example

```json
{
  "companies": ["Booz Allen Hamilton", "Palantir", "JCBMLGPE6Z71"],
  "awardTypes": ["contracts", "idvs"],
  "lookbackDays": 365,
  "maxAwardsPerCompany": 20
}
```

Filters only:

```json
{"keywords": ["cybersecurity"], "agencies": ["Department of Energy"], "states": ["VA"], "lookbackDays": 180, "maxAwardsPerCompany": 50}
```

### Output example

```json
{"type": "company_summary", "query": "Palantir", "status": "found", "obligatedInPeriod": 1981710256.98,
 "matchedRecipients": [{"name": "PALANTIR USG INC", "amount": 1411899868.54}, {"name": "PALANTIR TECHNOLOGIES INC.", "amount": 569810388.44}],
 "topNaics": [{"code": "541511", "name": "Custom Computer Programming Services", "amount": 1157460371.18}]}
```

```json
{"type": "award", "query": "Palantir", "status": "found", "rank": 1, "awardCategory": "contract", "recipientName": "PALANTIR USG INC",
 "amount": 637552404.79, "awardingAgency": "Department of Defense", "naicsCode": "541511", "usaspendingUrl": "https://www.usaspending.gov/award/CONT_AWD_..."}
```

### Use cases

- **Sales prospecting and account research:** see which agencies a target account sells to and how much.
- **Competitor tracking in GovCon:** compare competitors' awards by NAICS, PSC and agency every month.
- **Investment and credit due diligence:** measure a company's federal revenue exposure and agency concentration.
- **Partner and teaming search:** filter by NAICS, PSC and state to find who wins the work you want.
- **Journalism and research:** pull award lists with links to the official records.

### Use with AI agents (MCP, ChatGPT, Claude, Cursor, n8n)

AI agents can run this Actor through the [Apify MCP server](https://mcp.apify.com):

```json
{"mcpServers":{"apify":{"url":"https://mcp.apify.com?tools=swillz/federal-awards-by-company"}}}
```

Or run it locally with `npx -y @apify/actors-mcp-server --tools swillz/federal-awards-by-company` and `APIFY_TOKEN` set.

Example prompts:

- "How much in federal contracts did Palantir get in the last 12 months, and from which agencies?"
- "List the 10 largest Department of Energy cybersecurity contracts performed in Virginia this year."
- "Compare federal awards for Booz Allen Hamilton and Leidos by NAICS."

Minimal input: `{"companies": ["Palantir"], "maxAwardsPerCompany": 10}`. To cap the cost, pass `maxTotalChargeUsd`. Companies left unrun come back as free `skipped_charge_limit` rows.

### Integrations and API

Run it from the Apify API, the clients, Make, Zapier or n8n. To enrich a lead list, chain it with `{"datasetId": "...", "companyField": "companyName"}`. The OUTPUT record holds a run summary (`byStatus`, `period`, `zeroResultsReason`, `nextSteps`).

### FAQ

**Where does the data come from?** The public USAspending.gov API (US Treasury), which publishes FPDS contract data and FABS assistance data. No login or API key is needed.

**Why are recent DoD numbers lower than expected?** DoD contract data is published with a 90-day delay, and agencies can revise records later.

**Does it return data about individuals?** No. It never requests assistance types made to individuals (direct payments, insurance and other), and it drops redacted or aggregated "multiple recipients" rows.

**Why does `obligatedInPeriod` differ from the sum of award amounts?** The summary counts obligations made inside your date range. `amount` on an award row is the award's total over its whole life.

### Related tools

More tools from the same developer, built to work together:

- [Career Site Jobs Scraper](https://apify.com/swillz/career-site-jobs-scraper): jobs from Greenhouse, Lever, Ashby, Workable and Recruitee boards, with salary fields, as a jobs API or CSV.
- [Workday Jobs Scraper](https://apify.com/swillz/workday-jobs-scraper): every job from any myworkdayjobs.com career site, past the 2,000-result cap.
- [Company Website Enrichment](https://apify.com/swillz/company-website-enrichment): turn a list of domains into company name, emails, phones, social links and tech stack.
- [AI Extract](https://apify.com/swillz/ai-extract): structured JSON from any web page with a plain-English prompt or a JSON schema. AI included.
- [Google Sheets Import & Export](https://apify.com/swillz/google-sheets-import-export): send any Apify dataset to a Google Sheet (append, replace or dedupe) or read a sheet as JSON.
- [XML Sitemap URL Extractor & Sitemap to CSV](https://apify.com/swillz/sitemap-url-extractor): every URL from a website's sitemap, with lastmod, HTTP status and new-page monitoring.
- [AI Brand Visibility Tracker](https://apify.com/swillz/ai-brand-visibility-tracker): track whether ChatGPT mentions, ranks and cites your brand vs competitors (GEO).
- [Email Provider Detector](https://apify.com/swillz/email-provider-detector): bulk check whether domains use Google Workspace, Microsoft 365, Proofpoint or Mimecast, plus SPF, DMARC and DKIM.
- [Hiring Signals by Company Domain](https://apify.com/swillz/hiring-signals-by-domain): from a list of company domains, find which ATS each uses and how many open roles, by department and location.
- [EU VAT Number Validator (VIES)](https://apify.com/swillz/eu-vat-validator): bulk check EU VAT numbers against official VIES, with company name and address.
- [EORI Number Validator](https://apify.com/swillz/eori-validator): bulk check EU and UK EORI numbers for customs, with trader name where published.
- [LEI Lookup (GLEIF)](https://apify.com/swillz/lei-lookup): find a company's Legal Entity Identifier, legal name, address, status and parent from official GLEIF data.
- [Sanctions Screener](https://apify.com/swillz/sanctions-screener): screen company and person names against official OFAC, UN, EU and UK sanctions lists with fuzzy matching.
- [HTS Code Lookup (USITC)](https://apify.com/swillz/hts-code-lookup): US HTS codes and import duty rates from the official tariff schedule, by code or product description.

**Popular workflows**

- **Government-contractor research:** pull a company's federal awards with this Actor, screen it with [Sanctions Screener](https://apify.com/swillz/sanctions-screener), and add contacts with [Company Website Enrichment](https://apify.com/swillz/company-website-enrichment).
- **Weekly award watch:** schedule this Actor for your competitors or prospects and append new awards to a sheet with [Google Sheets Import & Export](https://apify.com/swillz/google-sheets-import-export).

Source code: https://github.com/williamjin02/apify-actors/tree/main/actors/federal-awards-by-company

# Actor input Schema

## `companies` (type: `array`):

Company names (e.g. "Booz Allen Hamilton", "Palantir") or 12-character SAM.gov UEIs (e.g. "JCBMLGPE6Z71"). Names are matched strictly: every word must appear in the recipient name, so all subsidiaries that share the name are included. Leave empty to search by filters only.

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

Which awards to return: contracts (definitive contracts, purchase orders, delivery orders), idvs (GSA schedules, GWACs, IDIQs, BPAs), grants, loans. Default contracts.

## `lookbackDays` (type: `integer`):

Awards with activity in the last N days (default 365). Ignored when startDate is set.

## `startDate` (type: `string`):

Optional start of the period, YYYY-MM-DD (earliest 2007-10-01). Overrides lookbackDays.

## `endDate` (type: `string`):

Optional end of the period, YYYY-MM-DD. Default today.

## `maxAwardsPerCompany` (type: `integer`):

Most award rows per company (or for a filters-only search), 1-5000, default 100. Each row is one charged record.

## `sortBy` (type: `string`):

Return the largest awards first (default) or the newest first.

## `includeSummary` (type: `boolean`):

Add one company_summary row per company: matched recipient names and UEIs, total obligated in the period, top awarding agencies and top NAICS codes. Counts as one record. Default true.

## `strictNameMatch` (type: `boolean`):

Keep only recipients whose name contains every word of your query (default true). USAspending's own name search is fuzzy and returns unrelated companies; turn this off only to see everything it returns.

## `keywords` (type: `array`):

Optional: only awards whose description or fields match these words, e.g. "cybersecurity", "cloud migration" (3+ characters each).

## `agencies` (type: `array`):

Optional top-tier awarding agency names exactly as USAspending writes them, e.g. "Department of Defense", "Department of Veterans Affairs", "General Services Administration".

## `naicsCodes` (type: `array`):

Optional NAICS codes or prefixes (2-6 digits), e.g. "541512" or "5415".

## `pscCodes` (type: `array`):

Optional Product and Service Codes, e.g. "DA01" or "R425" (contracts and IDVs only).

## `states` (type: `array`):

Optional 2-letter US state codes for where the work is done, e.g. "VA", "CA".

## `minAmount` (type: `integer`):

Optional: skip awards smaller than this amount.

## `maxCompanies` (type: `integer`):

Safety cap on companies processed in one run (default 200).

## `datasetId` (type: `string`):

Optional: read company names from another Actor's dataset (e.g. a lead list). The name field is auto-detected (companyName, company, organization, legalName, name, uei) or set companyField.

## `companyField` (type: `string`):

Field in that dataset holding the company name or UEI. Dot paths work (e.g. company.name).

## `datasetMaxItems` (type: `integer`):

Most companies read from the dataset (default 100).

## Actor input object example

```json
{
  "companies": [
    "Booz Allen Hamilton",
    "Palantir",
    "JCBMLGPE6Z71"
  ],
  "awardTypes": [
    "contracts"
  ],
  "lookbackDays": 365,
  "maxAwardsPerCompany": 20,
  "sortBy": "amount",
  "includeSummary": true,
  "strictNameMatch": true,
  "maxCompanies": 200,
  "datasetMaxItems": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Example award: {"type":"award","query":"Palantir","awardId":"...","recipientName":"PALANTIR USG INC","amount":637552404.79,"awardingAgency":"Department of Defense","naicsCode":"541511"}. Miss: {"type":"status","status":"not_found","error":"..."}.

## `summary` (type: `string`):

JSON: companies, recordsReturned, byStatus, period, awardTypes, chargeLimitReached, zeroResultsReason, nextSteps.

# 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 = {
    "companies": [
        "Booz Allen Hamilton",
        "Palantir",
        "JCBMLGPE6Z71"
    ],
    "maxAwardsPerCompany": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("swillz/federal-awards-by-company").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 = {
    "companies": [
        "Booz Allen Hamilton",
        "Palantir",
        "JCBMLGPE6Z71",
    ],
    "maxAwardsPerCompany": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("swillz/federal-awards-by-company").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 '{
  "companies": [
    "Booz Allen Hamilton",
    "Palantir",
    "JCBMLGPE6Z71"
  ],
  "maxAwardsPerCompany": 20
}' |
apify call swillz/federal-awards-by-company --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,swillz/federal-awards-by-company"
        }
    }
}
```

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/5y5JRc5hfa5GN9SJl/builds/QKFFHVj5VELpshCXh/openapi.json
