# Federal Contracts Spending Scraper - USAspending.gov (`punkrecordsdata/federal-contracts-spending-scraper`) Actor

Federal award and contract spending data: awards, transactions, subawards, funding, recipient profiles and spending breakdowns by agency, industry, product/service code, state and fiscal year. Export to CSV, Excel, JSON.

- **URL**: https://apify.com/punkrecordsdata/federal-contracts-spending-scraper.md
- **Developed by:** [PunkRecordsData](https://apify.com/punkrecordsdata) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.40 / 1,000 award records

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<p align="center">
  <img src="https://api.apify.com/v2/key-value-stores/AAm3a1h3Z9nYfrvh9/records/banner" alt="PunkRecordsData" width="100%" />
</p>

## 🏛️ Federal Contracts Spending Scraper: USAspending.gov Awards & Recipients, PunkRecordsData

> 🚀 **Every federal contract a company holds, plus its transaction history, subcontractors, funding sources and full spending profile, in one run.** Straight from USAspending.gov, the U.S. government's own official spending API. No login, no API key.

Scrape U.S. federal contract data straight from `api.usaspending.gov`, the government's own public spending transparency API: every contract awarded to a company, every modification and transaction on that contract, every subcontractor paid out of it, the federal accounts and agencies funding it, the recipient's full registration profile, and its total federal spending broken down by agency, industry (NAICS), product/service code (PSC), state and fiscal year. No login, no API key, no scraping SAM.gov's rendered pages, just the government's own structured data.

Built for the [Apify platform](https://apify.com): schedule a monthly run to track a competitor's new awards, screen a contractor's federal footprint before a partnership, or feed spending time series straight into a business-intelligence dashboard.

### 📋 What the Federal Contracts Spending Scraper does

Give it a company name (like "Lockheed Martin") and it returns one row per matching federal contract: award ID, amount, awarding agency, dates, and description. Turn on **Transaction history** for every modification on that contract, **Subawards** for every subcontractor paid out of it, and **Federal account funding** for the government accounts and agencies actually funding it. Turn on **Recipient profile** for the company's federal registration record (UEI, DUNS, business types, total federal transaction volume), and any of the four **spending breakdowns** (by agency, industry, product/service code, or state) plus **spending by fiscal year** for the company's full federal footprint, computed once per company and never re-billed twice for the same underlying fact.

> 💡 **Why it matters:** most federal-contract scrapers on the market return a flat list of awards and stop there. This one also resolves the transaction, subcontractor and funding detail behind each contract, and profiles the recipient's entire federal business across every agency and industry it works with, ten distinct real data types from the government's own numbers, not a single flat export.

### 📊 Output

Real sample fields from a verified run against "Lockheed Martin", one of two record types identified by `recordType`.

**`award-record`** (primary, one row per matched contract):

```json
{
  "awardId": "N0001917C0001",
  "recipientName": "LOCKHEED MARTIN CORPORATION",
  "awardAmount": 35135514910.2,
  "awardingAgency": "Department of Defense",
  "startDate": "2017-11-17",
  "endDate": "2031-03-31",
  "transactions": [{ "actionDate": "2026-04-15", "type": "DEFINITIVE CONTRACT", "modificationNumber": "P00112", "description": "UPDATE EXHIBIT M" }],
  "subawards": [{ "subawardNumber": "6574071033", "recipientName": "NTS TECHNICAL SYSTEMS, LLC", "amount": 64262 }],
  "funding": [{ "federalAccount": "057-3600", "accountTitle": "Research, Development, Test, and Evaluation, Air Force", "objectClassName": "Research and development contracts" }]
}
```

**`recipient-profile-record`** (one row per unique company, computed once regardless of how many of its contracts matched):

```json
{
  "recipientName": "LOCKHEED MARTIN CORP",
  "profile": { "uei": "FYHNA5WC8XD7", "duns": "926784042", "businessTypes": ["manufacturer_of_goods", "other_than_small_business"], "totalTransactionAmount": 3072753827.22, "totalTransactions": 334 },
  "agencyBreakdown": [{ "code": "DOD", "name": "Department of Defense", "amount": 812574874076.95 }],
  "naicsBreakdown": [{ "code": "336411", "name": "Aircraft Manufacturing", "amount": 377163683691.43 }]
}
```

Every extra you don't enable returns `"Not Requested"` instead of an empty field, and data a contract genuinely doesn't have (many contracts have no reported subawards) returns `"N/A"`. You always know why a field is empty, never guess.

### ✨ Why choose this Actor

- **Ten real data types from one government source, one run.** Awards, transactions, subawards, funding, recipient profile, and spending broken down by agency, industry, product/service code, state and fiscal year, no need to stitch together SAM.gov and USAspending yourself.
- **Company-level facts computed once, not re-billed per contract.** A company's spending breakdowns and registration profile are the same regardless of which of its 50 contracts you're looking at, so they're charged once per company, never duplicated across every award row.
- **No login, no API key.** USAspending.gov is public with no registration; nothing to expire or get rate-limited on your account, unlike SAM.gov's own API which requires weeks of entity registration for real usage limits.
- **Government's own numbers, not a scrape of a rendered page.** Every field comes straight from USAspending's structured JSON API.

### 📈 How it compares to alternatives

Measured against the closest published USAspending/SAM.gov actors on the Apify Store:

| Actor | Primary price | Billable events |
|---|---|---|
| Raw SAM.gov scraper (11 users/30d) | $3.00 / 1,000 | 1 |
| Raw USAspending scraper | $1.00 / 1,000 | 1 |
| AI-enriched competitor (recompete/PWin scoring) | $20.00 / 1,000 | 8, several AI-inferred |
| **This Actor** | $4.00 / 1,000 | **10** (award, transaction, subaward, funding, recipient profile, and 5 spending breakdowns), all raw government data, none inferred |

### 🚀 How to use

1. Create a free [Apify account](https://console.apify.com). New accounts get $5 in free credit.
2. Open the Federal Contracts Spending Scraper and enter a company name (e.g. "Lockheed Martin").
3. Toggle on the extras you need: transactions, subawards, funding, recipient profile, spending breakdowns.
4. Click **Start** and wait for the run to finish.
5. Download your data as CSV, Excel, JSON or XML, or pull it via the API.

### 💼 Business use cases

**Govcon business development & capture management**
Track a competitor's new awards and modifications, or screen a target company's full federal footprint before a teaming decision.

**Supply chain & subcontractor intelligence**
Pull the subaward chain behind a prime contract to map out who's actually doing the work.

**Investment research & market analysis**
Screen a contractor's spending mix by agency and industry to gauge diversification and government-revenue concentration risk.

**Compliance & due diligence**
Verify a company's federal registration status (UEI, DUNS, business type) and total federal transaction history before a partnership or acquisition.

### 🔌 Automating Federal Contracts Spending Scraper

Connect this Actor to **Make**, **Zapier**, **Slack** or **Airbyte** to push new awards or modifications into a spreadsheet, database or channel automatically. Schedule a weekly run per competitor or prospect to catch new contract activity as it's reported.

### 🌟 Beyond business use cases

**Research:** academic public-policy and government-spending research using real USAspending data.
**Personal projects:** check a company's federal contract history before applying to work there.
**Non-profit:** government-transparency and accountability projects tracking federal contract spending.
**Experimentation:** test spend-forecasting or anomaly-detection models against real structured award data.

### 🤖 Ask an AI assistant about this scraper

Paste this Actor's Store page into ChatGPT, Claude or Perplexity and ask: "Does this federal contracts scraper charge separately for a company's spending profile on every contract, or only once per company?" The README and input schema are structured so AI assistants can answer accurately from the page alone.

### ❓ Frequently Asked Questions

**Do I need a SAM.gov or USAspending API key?**
No. USAspending.gov's API is fully public with no registration required anywhere in this Actor.

**Why are spending breakdowns billed once per company, not once per contract?**
Because a company's spending-by-agency mix (or by industry, state, etc.) doesn't change based on which one of its contracts you happen to be viewing, it's the same underlying fact. Billing it on every contract row would charge you multiple times for one real number.

**Why does `subawards` return "N/A" for some contracts?**
Because not every prime contract has publicly reported subcontractors, subaward reporting coverage varies by contract type and age. "N/A" means the Actor checked and confirmed none are on record, not that it skipped the check.

**What happens if a company name doesn't match any awards?**
The Actor finishes with a clear status message telling you nothing matched, rather than silently returning nothing. Try a more exact or different name.

**Does this cover grants or loans, not just contracts?**
This version covers the four federal contract award types (definitive contracts, purchase orders, delivery orders, and BPA calls). Grants, loans and other financial-assistance award types use a different USAspending award-type family and are out of scope for this Actor.

**How fresh is the data?**
As fresh as USAspending.gov itself, most federal contract actions appear within days of being reported to the government.

### 🔌 Integrate with any app

Every run's output is available as CSV, Excel, JSON or XML, or through Apify's API and client libraries for Python and JavaScript.

### 🔗 Recommended Actors

Browse the rest of the [PunkRecordsData](https://apify.com/punkrecordsdata) catalog for more scrapers covering SEC filings, bank regulatory data, court records and sports data.

> 💡 **Pro Tip:** browse the complete [PunkRecordsData collection](https://apify.com/punkrecordsdata).

**🆘 Need Help?** contact.punkrecordsdata@gmail.com

> **⚠️ Disclaimer:** This is an independent tool, not affiliated with, endorsed by, or sponsored by the U.S. government or USAspending.gov. It collects only publicly available federal spending data from their own public API.

# Actor input Schema

## `companyName` (type: `string`):

Company or organization name to search (e.g. "Lockheed Martin"). Matched against USAspending.gov's own recipient names.

## `maxItems` (type: `integer`):

Maximum number of award-record rows to deliver. Free users: limited to 10 (preview). Paid users: optional, max 1,000,000.

## `includeTransactions` (type: `boolean`):

Every modification/transaction on the award, with date, type and description. Billed per transaction as transaction-record.

## `maxTransactions` (type: `integer`):

How many of the most recent transactions to pull per award when Transaction history is on.

## `includeSubawards` (type: `boolean`):

Subcontractors paid out of the award, with name, amount and description. Billed per subaward as subaward-record.

## `maxSubawards` (type: `integer`):

How many subawards to pull per award when Subawards is on.

## `includeFunding` (type: `boolean`):

Federal accounts and agencies funding the award, with object class. Billed per account record as federal-account-record.

## `maxFundingRecords` (type: `integer`):

How many federal account funding records to pull per award when Federal account funding is on.

## `includeRecipientProfile` (type: `boolean`):

The recipient's overall federal profile: UEI/DUNS, business types, location, total federal transaction amount and count. One row per unique recipient, billed as recipient-profile-record.

## `includeAgencyBreakdown` (type: `boolean`):

The recipient's total federal spending broken down by awarding agency. Billed per agency as agency-breakdown-record.

## `includeNaicsBreakdown` (type: `boolean`):

The recipient's total federal spending broken down by NAICS industry code. Billed per code as naics-breakdown-record.

## `includePscBreakdown` (type: `boolean`):

The recipient's total federal spending broken down by PSC product/service code. Billed per code as psc-breakdown-record.

## `includeStateBreakdown` (type: `boolean`):

The recipient's total federal spending broken down by state/territory of performance. Billed per state as state-breakdown-record.

## `includeSpendingByYear` (type: `boolean`):

The recipient's total federal spending as a fiscal-year time series. Billed per year as spending-by-year-record.

## Actor input object example

```json
{
  "companyName": "Lockheed Martin",
  "maxItems": 10,
  "includeTransactions": false,
  "maxTransactions": 20,
  "includeSubawards": false,
  "maxSubawards": 20,
  "includeFunding": false,
  "maxFundingRecords": 20,
  "includeRecipientProfile": false,
  "includeAgencyBreakdown": false,
  "includeNaicsBreakdown": false,
  "includePscBreakdown": false,
  "includeStateBreakdown": false,
  "includeSpendingByYear": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Key fields: recipient, award ID, amount, agency, dates

## `fullData` (type: `string`):

Complete dataset with every field, including nested transactions, subawards, funding and recipient spending breakdowns

# 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 = {
    "companyName": "Lockheed Martin",
    "maxItems": 10,
    "maxTransactions": 20,
    "maxSubawards": 20,
    "maxFundingRecords": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("punkrecordsdata/federal-contracts-spending-scraper").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 = {
    "companyName": "Lockheed Martin",
    "maxItems": 10,
    "maxTransactions": 20,
    "maxSubawards": 20,
    "maxFundingRecords": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("punkrecordsdata/federal-contracts-spending-scraper").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 '{
  "companyName": "Lockheed Martin",
  "maxItems": 10,
  "maxTransactions": 20,
  "maxSubawards": 20,
  "maxFundingRecords": 20
}' |
apify call punkrecordsdata/federal-contracts-spending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,punkrecordsdata/federal-contracts-spending-scraper"
        }
    }
}
```

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/NLYhuVgp39f7niUE0/builds/duurR2CoLb5mvPER0/openapi.json
