# USAspending API Scraper for Federal Contracts (`invaluable_rondeau/us-federal-contract-spending-intelligence`) Actor

Export normalized federal contract award data from the official USAspending.gov API for GovCon and procurement research.

- **URL**: https://apify.com/invaluable\_rondeau/us-federal-contract-spending-intelligence.md
- **Developed by:** [PROOFNEXA](https://apify.com/invaluable_rondeau) (community)
- **Categories:** AI, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## USAspending API scraper — federal contract data export

Turn USAspending.gov's complex federal-award search into one normalized, analysis-ready row per federal procurement contract. This is a new Actor, not an official USAspending or U.S. Government product.

Use it when a GovCon, research, or procurement team needs a filterable federal contract data export without rebuilding USAspending's POST filters and pagination.

### What is different from the free API

USAspending's free API requires POST filters, paginated result merging, capitalized field conventions, award-type codes, and data-model interpretation. This Actor applies those mechanics and returns a stable, one-row-per-award table. Optional BYOK AI adds a factual one-line description and exactly three tags, always tied to `descriptionRaw`.

### Output

Every dataset item has `awardId`, `recipientName`, `recipientUEI`, `awardingAgency`, `subAgency`, `awardAmount`, `currency`, `startDate`, `endDate`, `naicsCode`, `naicsDescription`, `placeOfPerformance`, `descriptionRaw`, `descriptionSummary`, `categoryTags`, `sourceUrl`, and `fetchedAt`.

`descriptionSummary` and `categoryTags` are objects with `value`, `sourceField: "descriptionRaw"`, and `status`. If no key is supplied, or the official record has no description, their values are null—never inferred. `sourceUrl` links to the official USAspending award-detail API record.

### Input example

```json
{
  "startDate": "2025-01-01",
  "endDate": "2025-12-31",
  "naicsCodes": ["541512"],
  "minAwardAmount": 100000,
  "awardingAgency": "Department of Defense",
  "maxItems": 100
}
```

The default award types are procurement contracts (`A`, `B`, `C`, `D`). `startDate` cannot be before 2007-10-01 under the USAspending search endpoint.

### AI is optional BYOK

Enter an OpenAI-compatible key only when you want the two AI fields. It is used for this run, is not written to the dataset, and only sees the first ten available `descriptionRaw` values. Without a key, normal award rows still return and AI fields stay null.

### Honest boundaries

- Uses only the official public USAspending API; it does not scrape webpages, use proxies, rotate IPs, spoof user agents, or bypass CAPTCHA.
- API field availability varies by award. Missing official source fields remain null.
- Results are historical award records, not current open solicitations. SAM.gov opportunities are intentionally not included because their official API requires each operator's own account API key.
- Validate data before bidding, outreach, or legal/commercial decisions.

### Pricing

Pay per event: `apify-default-dataset-item` at **$0.005 per normalized award row** (**$5.00 per 1,000 results**). Apify platform usage and any buyer-selected AI provider charges are separate.

### Actual-run output receipt

An \[own test] on 2026-08-01 requested 100 awards and produced 100 normalized output rows in 6 seconds. No AI key was supplied, so `descriptionSummary` and `categoryTags` were null as documented.

### Frequently asked questions

#### How do I export federal contract data from USAspending?

Set an award period and optional NAICS, agency, keyword, and award-value filters. The Actor retrieves official USAspending award records and returns one normalized row per award.

#### Is this a USAspending API scraper or an official government product?

It uses the public USAspending.gov API, but it is an independent Actor and not an official U.S. Government product.

#### Can I use this for GovCon competitor research?

It can filter historical federal award records by the supplied fields. It does not identify open solicitations or replace validation before a bid, outreach, or commercial decision.

# Actor input Schema

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

Required YYYY-MM-DD; USAspending award search supports 2007-10-01 onward.

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

Required YYYY-MM-DD.

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

1 to 1,000. Each saved row is one billable result.

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

Optional six- or two-digit codes, such as 541512.

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

Optional award-description search terms.

## `recipientSearchText` (type: `string`):

Optional text searched across recipient name, UEI, and DUNS.

## `awardingAgency` (type: `string`):

Optional exact official agency name, for example Department of Defense.

## `minAwardAmount` (type: `number`):

Optional inclusive lower bound in USD.

## `maxAwardAmount` (type: `number`):

Optional inclusive upper bound in USD.

## `awardTypeCodes` (type: `array`):

Optional. Defaults to federal procurement contracts A, B, C, D.

## `openAiApiKey` (type: `string`):

BYOK only for this run. Without it, AI fields are null and all award rows still return.

## `openAiModel` (type: `string`):

Optional model name accepted by the buyer's OpenAI-compatible endpoint.

## `openAiBaseUrl` (type: `string`):

Optional OpenAI-compatible endpoint base URL.

## Actor input object example

```json
{
  "startDate": "2025-01-01",
  "endDate": "2025-03-31",
  "maxItems": 10,
  "awardTypeCodes": [
    "A",
    "B",
    "C",
    "D"
  ]
}
```

# 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 = {
    "startDate": "2025-01-01",
    "endDate": "2025-03-31",
    "maxItems": 10,
    "awardTypeCodes": [
        "A",
        "B",
        "C",
        "D"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("invaluable_rondeau/us-federal-contract-spending-intelligence").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 = {
    "startDate": "2025-01-01",
    "endDate": "2025-03-31",
    "maxItems": 10,
    "awardTypeCodes": [
        "A",
        "B",
        "C",
        "D",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("invaluable_rondeau/us-federal-contract-spending-intelligence").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startDate": "2025-01-01",
  "endDate": "2025-03-31",
  "maxItems": 10,
  "awardTypeCodes": [
    "A",
    "B",
    "C",
    "D"
  ]
}' |
apify call invaluable_rondeau/us-federal-contract-spending-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=invaluable_rondeau/us-federal-contract-spending-intelligence",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Rp27dQ3D79FIiiQ2l/builds/UgwX27fsMx5HYUQ8d/openapi.json
