# USAspending Scraper: Federal Contracts, Grants & Awards (`pankajbhatia/usaspending-federal-awards`) Actor

Find who won U.S. government contracts, grants and loans, and for how much. Search USAspending.gov by keyword, agency, company, NAICS, PSC, state, amount and date. Official U.S. Treasury data, for competitor and market research.

- **URL**: https://apify.com/pankajbhatia/usaspending-federal-awards.md
- **Developed by:** [Pankaj Bhatia](https://apify.com/pankajbhatia) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 awards

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

## USAspending Federal Awards Scraper: Government Contracts & Grants

**Find out who wins U.S. government money, and how much.** Search **USAspending.gov**, the official U.S. Treasury database of every federal contract, grant and loan, and export clean rows:

- **Award ID**, award type and link to the award page
- **Recipient** (company or organization) name and **UEI**
- **Award amount** and total outlays (or loan value and subsidy cost for loans)
- **Awarding and funding agency** and sub-agency
- **Start, end and base obligation dates**, and last modified date
- **NAICS** and **PSC** codes with descriptions (contracts), and **assistance listing / CFDA** programs (grants and loans)
- Place of performance: state, ZIP and country
- Award description

Filter by **keyword, award type (contracts, IDVs, grants, loans), date range, recipient, agency, sub-agency, NAICS, PSC, state and amount**.

### Who is it for?

- **Government contractors and BD teams**: see which competitors win in your NAICS codes, with which agencies, and for how much.
- **Pairs with SAM.gov opportunities**: use the **SAM.gov Contract Opportunities Scraper** (listed below) for open bids, and this tool for past winners and incumbents.
- **Grant writers and nonprofits**: see who gets funded under each grant program, and how much.
- **Sales and lead generation**: build lists of companies that just won large federal contracts.
- **Journalists, analysts and investors**: track federal spending by agency, state or company.

### How to use it

1. Enter **keywords** and/or filters (agency, recipient, NAICS, state, amount).
2. Pick **award types** and a **date range** (default: the last 12 months).
3. Click **Start** and export to Excel, CSV or JSON.

### Input example

```json
{
  "keywords": ["cybersecurity"],
  "awardTypes": ["contracts"],
  "awardingAgencies": ["Department of Veterans Affairs"],
  "naicsCodes": ["541512"],
  "placeOfPerformanceStates": ["TX"],
  "startDate": "2025-10-01",
  "sortBy": "amount",
  "maxResults": 500
}
```

### Output example

```json
{
  "awardCategory": "contract",
  "awardId": "FA862118F6251",
  "recipientName": "LOCKHEED MARTIN CORPORATION",
  "recipientUei": "KDT2YLB34NT6",
  "awardAmount": 666315748.84,
  "awardType": "DELIVERY ORDER",
  "description": "AFSOC ACTS AWARD OF CONTRACT FOR CLS, ENGINEERING, INSTRUCTION, CYBERSECURITY...",
  "startDate": "2018-02-08",
  "endDate": "2027-01-31",
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Department of the Air Force",
  "naicsCode": "336413",
  "pscCode": "J069",
  "placeOfPerformanceState": "FL",
  "url": "https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700"
}
```

### How much does it cost?

Pay-per-event: a small fee **per award** returned, plus a tiny per-run start fee, with no subscription and no separate platform usage costs. For example, 1,000 awards cost about $2. Searches with no matches are **not charged**. Set **Max awards** or **Maximum cost per run** to cap your spending.

### Good to know

- The date range matches awards with activity (new awards or modifications) in that period, the same way the USAspending.gov search does.
- USAspending returns up to 10,000 awards per search and award type. Narrow the dates or filters to get more.
- Direct payments and other assistance to individuals are excluded on purpose.

### Use it through the API, integrations or AI agents

Run it from the Apify API, on a schedule, or connect it to Make, Zapier, n8n or Google Sheets. AI agents can call it through the Apify MCP server.

### FAQ

**Is it legal?** Yes. USAspending.gov is an official public U.S. government database, and this tool uses its official public API.

**Found a bug or need a feature?** Open an issue. We usually reply within 24 hours.

### More tools from this developer

- [SAM.gov Contract Opportunities Finder & Bid Alerts](https://apify.com/pankajbhatia/sam-gov-contract-opportunities): federal contract opportunities and bid alerts
- [Sitemap & URL Extractor](https://apify.com/pankajbhatia/sitemap-url-extractor): get every URL of a website from its sitemaps
- [Website to Markdown for AI & RAG](https://apify.com/pankajbhatia/website-to-markdown): turn web pages into clean Markdown for LLMs
- [Tech Stack Detector](https://apify.com/pankajbhatia/tech-stack-detector): find what any website is built with
- [Apple App Store Reviews Scraper](https://apify.com/pankajbhatia/app-store-reviews): App Store reviews and ratings for any app
- [ATS Jobs Scraper](https://apify.com/pankajbhatia/ats-jobs-scraper): jobs from Greenhouse, Lever, Ashby, Workable and more
- [Website Screenshot](https://apify.com/pankajbhatia/website-screenshot): full-page, mobile and PDF screenshots in bulk
- [PDF to Text & Markdown Extractor](https://apify.com/pankajbhatia/pdf-text-extractor): extract text from PDFs for AI and search
- [Domain WHOIS, DNS & SSL Checker](https://apify.com/pankajbhatia/domain-whois-dns-ssl-checker): bulk domain, DNS, email security and SSL checks
- [SEO Meta Tags & On-Page Audit](https://apify.com/pankajbhatia/seo-meta-tags-checker): bulk on-page SEO audit with fixes
- [Bulk URL Status & Broken Link Checker](https://apify.com/pankajbhatia/url-status-broken-link-checker): status codes, redirect chains and broken links
- [RSS & Atom Feed Reader](https://apify.com/pankajbhatia/rss-feed-reader): merge and filter many news feeds
- [Hacker News Scraper](https://apify.com/pankajbhatia/hacker-news-scraper): HN stories, comments and Who is hiring jobs
- [Academic Paper Search](https://apify.com/pankajbhatia/academic-paper-search): papers from Crossref, arXiv and PubMed
- [SEC EDGAR Filings & Financials](https://apify.com/pankajbhatia/sec-edgar-filings-financials): 10-K, 10-Q, 8-K filings and company financials
- [Apple Podcasts Scraper](https://apify.com/pankajbhatia/apple-podcasts-scraper): podcast details and full episode lists
- [App Store Top Charts & App Search](https://apify.com/pankajbhatia/app-store-top-charts): top free, paid and grossing app rankings
- [ClinicalTrials.gov Scraper](https://apify.com/pankajbhatia/clinicaltrials-gov-scraper): search and export clinical trials
- [Grants.gov Opportunities](https://apify.com/pankajbhatia/grants-gov-opportunities): open and forecasted federal grants

# Actor input Schema

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

Words in the award description, e.g. cybersecurity, janitorial, broadband (min 3 characters).

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

Which kinds of awards to search.

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

Awards with activity on or after this date (YYYY-MM-DD). Default: 1 year ago. Earliest: 2007-10-01.

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

Default: today.

## `recipients` (type: `array`):

Find awards won by specific companies, e.g. Booz Allen, or a UEI.

## `awardingAgencies` (type: `array`):

Exact top-level agency names, e.g. Department of Defense, Department of Veterans Affairs, General Services Administration.

## `awardingSubAgencies` (type: `array`):

Exact sub-agency names, e.g. Department of the Air Force.

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

Industry codes (contracts), e.g. 541512. 2-digit to 6-digit prefixes work.

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

Product/service codes (contracts), e.g. D302.

## `placeOfPerformanceStates` (type: `array`):

Two-letter state codes, e.g. TX, VA.

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

Only awards worth at least this much.

## `maxAmount` (type: `integer`):

Only awards worth at most this much.

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

Largest awards first, newest start date first, or most recently updated first.

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

0 = all (USAspending returns up to 10,000 per search).

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardTypes": [
    "contracts"
  ],
  "sortBy": "amount",
  "maxResults": 50
}
```

# Actor output Schema

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

One row per federal award.

# 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 = {
    "keywords": [
        "cybersecurity"
    ],
    "awardTypes": [
        "contracts"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("pankajbhatia/usaspending-federal-awards").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 = {
    "keywords": ["cybersecurity"],
    "awardTypes": ["contracts"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("pankajbhatia/usaspending-federal-awards").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 '{
  "keywords": [
    "cybersecurity"
  ],
  "awardTypes": [
    "contracts"
  ],
  "maxResults": 50
}' |
apify call pankajbhatia/usaspending-federal-awards --silent --output-dataset

```

## MCP server setup

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

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/BmUj0cpcLA8NjmI3h/builds/g381IdUZjvgCYMRgZ/openapi.json
