# USAspending US Government Contracts - Federal Spending Data API (`captainhandsome/usaspending-federal-awards`) Actor

Search US federal contracts, grants, loans and direct payments from the official USAspending API. Procurement data with recipient, amount, agency, dates, place of performance and NAICS, PSC and CFDA codes as flat rows. No API key required.

- **URL**: https://apify.com/captainhandsome/usaspending-federal-awards.md
- **Developed by:** [Joseph McRell](https://apify.com/captainhandsome) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 94.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 results

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

## USAspending Federal Awards Search

Search official US federal contracts, grants, loans, direct payments, and IDVs by keyword, agency, state, NAICS code, date, and amount. No API key required. Results are returned as clean, typed dataset rows suitable for CSV, JSON, automation, and AI-agent workflows.

### What data can I extract?

Every run returns 81 columns per award. Core fields include `award_family`, `award_id`, `recipient_name`, `award_type`, `amount`, `total_outlays`, `subsidy_cost`, `awarding_agency`, `awarding_sub_agency`, `funding_agency`, `funding_sub_agency`, `start_date`, `end_date`, `base_obligation_date`, `pop_state`, `pop_city`, `pop_zip`, `naics_code`, `naics_description`, `psc_code`, `psc_description`, `cfda_number`, `cfda_program_title`, plus recipient identity and address (`recipient_uei`, `recipient_address`, `recipient_city`, `recipient_state`, `recipient_profile_url`) and emergency-appropriation splits (`def_codes`, `covid19_obligations`, `infrastructure_obligations`).

Turn on **Fetch full award details** to add the procurement columns a capture team filters on: `set_aside_type`, `extent_competed`, `other_than_full_and_open`, `number_of_offers_received`, `contract_pricing_type`, `solicitation_id`, `base_and_all_options`, `parent_award_id`, `parent_recipient_name`, `recipient_business_categories`, `subaward_count`, `pop_congressional_district`, `naics_sector_description`, `executive_compensation`, and more. It costs one extra request per award. The dataset schema documents every field before a run starts.

#### All 81 columns

**Identity** — `award_id`, `cfda_number`, `cfda_program_title`, `covid19_obligations`, `covid19_outlays`, `funding_opportunity_number`, `number_of_offers_received`, `parent_award_id`, `parent_recipient_name`, `recipient_name`, `set_aside_type`, `solicitation_id`, `subsidy_cost`, `top_executive_name`

**Status** — `award_type`, `award_type_code`, `contract_pricing_type`, `parent_award_type`, `psc_category_code`, `psc_category_description`

**Dates** — `base_obligation_date`, `date_signed`, `end_date`, `issued_date`, `last_date_to_order`, `last_modified_date`, `potential_end_date`, `start_date`

**Location** — `pop_city`, `pop_congressional_district`, `pop_country`, `pop_country_code`, `pop_county`, `pop_state`, `pop_zip`, `recipient_address`, `recipient_city`, `recipient_congressional_district`, `recipient_country`, `recipient_county`, `recipient_state`

**Money** — `amount`, `total_subaward_amount`

**Contact** — `recipient_profile_url`, `url`

**Counts and measures** — `subaward_count`, `total_funding`, `total_outlays`

**Other detail** — `assistance_listings`, `award_family`, `awarding_agency`, `awarding_agency_code`, `awarding_office`, `awarding_sub_agency`, `awarding_sub_agency_code`, `base_and_all_options`, `base_exercised_options`, `def_codes`, `description`, `executive_compensation`, `extent_competed`, `funding_agency`, `funding_agency_code`, `funding_office`, `funding_sub_agency`, `funding_sub_agency_code`, `infrastructure_obligations`, `infrastructure_outlays`, `naics_code`, `naics_description`, `naics_sector_code`, `naics_sector_description`, `non_federal_funding`, `other_than_full_and_open`, `parent_recipient_uei`, `psc_code`, `psc_description`, `recipient_business_categories`, `recipient_uei`, `solicitation_procedures`, `top_executive_compensation`

### Input example

```json
{
  "award_type": "contracts",
  "keywords": "cybersecurity",
  "place_of_performance_state": "VA",
  "min_amount": 1000000,
  "start_date": "2024-01-01",
  "max_items": 10,
  "include_details": true
}
```

`max_items` is a hard output and billing ceiling. Source fields may be null when the upstream public record does not provide them.

### Output example

Each dataset item is one normalized result. The field names shown under What data can I extract are emitted as typed JSON properties and can be exported as CSV, Excel, XML, or RSS.

### Common use cases

- Lead, market, compliance, and competitive research
- Scheduled monitoring and change detection
- CSV/JSON enrichment pipelines
- AI-agent retrieval and workflow automation

### Pricing and cost control

Output is billed per result at **$0.003 per result** (about $3.00 per 1,000 results), plus a $0.0005 Actor-start charge billed once per gigabyte of memory at run start. Use `max_items` to cap both output volume and charges. The price shown on the Apify Store listing is authoritative.

### Use with AI agents and MCP

Apify's MCP server can discover and call this Actor. Example intent:

> Find federal cybersecurity contracts performed in Virginia since 2024.

Use the JSON input above as the tool arguments, changing filters and `max_items` as needed. The strict input schema rejects unknown properties, and the typed dataset schema describes the returned tool data.

### Reliability

Runs use bounded retries, deduplication, hard result limits, and explicit failure handling. Browser-based sources are monitored by contract canaries and staged selector repair; official-API sources use deterministic contract canaries rather than DOM repair.

### Limitations and responsible use

- Publicly available source data only; coverage and field availability depend on the upstream source.
- A successful search can legitimately return no matching records.
- Point-in-time fields can change after collection.
- Use the data in accordance with applicable law and source terms.
- Do not use results for prohibited eligibility, discrimination, or sensitive-person profiling decisions.

### FAQ

#### What search phrases does this Actor support?

The input schema lists exact accepted fields and examples. Primary discovery terms: USAspending API, federal contracts search, government grants data, federal awards scraper.

#### Can I control cost?

Yes. Set `max_items`; it is enforced as the maximum number of output records.

#### Can an AI agent call it?

Yes. Use Apify MCP `search-actors`, inspect this Actor's schema, then call it with the same JSON accepted in Console.

#### Does it require an external API key?

No external API key is required. Searches query the official USAspending public records directly.

### Changes

See [CHANGELOG.md](./CHANGELOG.md) for contract and maintenance updates.

# Changelog

This Actor's version history is a separate document: https://apify.com/captainhandsome/usaspending-federal-awards/changelog.md

# Actor input Schema

## `award_type` (type: `string`):

Federal award family to return.

## `keywords` (type: `string`):

Free text matched across recipient names and award descriptions.

## `place_of_performance_state` (type: `string`):

Two-letter US state code where work occurs.

## `recipient_state` (type: `string`):

Two-letter state code where the recipient is based.

## `awarding_agency` (type: `string`):

Exact top-tier federal agency name.

## `naics_codes` (type: `array`):

NAICS industry codes for contracts and IDVs.

## `min_amount` (type: `number`):

Return awards with an amount at or above this value.

## `start_date` (type: `string`):

Inclusive start date, YYYY-MM-DD; earliest supported date is 2007-10-01.

## `end_date` (type: `string`):

Inclusive end date in YYYY-MM-DD format; defaults to today.

## `max_items` (type: `integer`):

Hard output and billing ceiling.

## `include_details` (type: `boolean`):

Open each award's detail record to add set-aside type, extent competed, offers received, contract pricing, ceiling value with all options, parent contract vehicle, parent company, recipient business categories, congressional districts and executive compensation. Adds one request per award, so runs take longer. Leave off for a fast award-and-amount export.

## Actor input object example

```json
{
  "award_type": "contracts",
  "keywords": "cybersecurity",
  "start_date": "2024-01-01",
  "max_items": 10,
  "include_details": false
}
```

# Actor output Schema

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

One flat 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("captainhandsome/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("captainhandsome/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 '{}' |
apify call captainhandsome/usaspending-federal-awards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,captainhandsome/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/fsAQKuyw0Vsl0r33t/builds/tUZa3sw2ggcamVg0e/openapi.json
