# USAspending API — federal contracts & grants (no key) (`synthetic.ia/usaspending`) Actor

Search U.S. federal awards (contracts, grants, loans) by keyword, agency and time period, and list top-tier federal agencies with budget authority. Official USAspending.gov data. Clean HTTP API + MCP, no key. Pay per query.

- **URL**: https://apify.com/synthetic.ia/usaspending.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 usaspending queries

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 API — federal contracts & grants (no key)

Search **U.S. federal spending** — **contracts, grants, loans and direct payments** — behind a clean HTTP API (and MCP tool), from the official **USAspending.gov**. Find awards by keyword (a company, program or agency), filter by award type and time period, and list the **top-tier federal agencies** by budget. Great for govcon research, lead generation, compliance and agents. **No API key.** Pay per query.

- 💰 **Awards** — search federal awards by keyword: award id, recipient, amount, awarding agency, type and start date.
- 🏛️ **Agencies** — top-tier federal agencies with budget authority and obligated amounts.
- 🔧 **Filters** — award type (contracts/grants/loans/…), fiscal year or a custom date range.
- 🇺🇸 **Official & keyless** — straight from USAspending.gov, the government's spending transparency portal.
- 💵 Pay per query · no key.

### The use case it was built for

Who's winning federal contracts? Pull the biggest awards for a company, track grants in a program, or size an agency's budget — for sales intelligence (govcon lead-gen), journalism, research and compliance. Clean, typed rows straight from the source.

### Sample output (`awards`, keyword "NASA")

```json
{
  "ok": true, "keywords": ["NASA"], "awardType": "contracts", "count": 1,
  "awards": [
    { "awardId": "NNM07AB03C", "recipient": "THE BOEING COMPANY", "amount": 10517828993,
      "awardingAgency": "National Aeronautics and Space Administration",
      "awardType": "…", "startDate": "…" }
  ]
}
```

### How to use

- **HTTP API (Standby):** POST or GET `/awards`, `/agencies`. `GET /` returns help. Example: `GET /awards?keyword=Pfizer&awardType=grants&fiscalYear=2023`.
- **Normal run:** pass `{ operation, keyword, awardType, ... }`; results land in the dataset + key-value store.
- **MCP tool:** expose it to your agent via Apify's MCP server.

### Input

- **operation** — `awards` · `agencies`.
- **keyword** — company/program/agency to search. **awardType** — contracts/grants/loans/direct\_payments/idvs/all.
- **fiscalYear** or **start/end** — time filter. **limit** — cap rows.

### Pricing

**Per query** from **$0.006** (down to $0.002 on higher tiers). One call = one query (returns many awards or agencies at once).

### Related Actors

- **[SEC EDGAR API](https://apify.com/synthetic.ia/sec-edgar-api)** — company filings and financials.
- **[US Treasury Data](https://apify.com/synthetic.ia/us-treasury-data)** — national debt, FX and interest rates.

### FAQ

**Do I need a key?** No — USAspending.gov is keyless.

**Which award types?** Contracts, grants, loans, direct payments, IDVs — or all at once.

**How current?** USAspending is updated regularly from agency reporting.

### Notes & limits

Data from USAspending.gov. Award search is sorted by amount (largest first); use fiscal year or a date range to focus. Up to 100 awards per call.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/usaspending/changelog.md

# Actor input Schema

## `operation` (type: `string`):

What to do.

## `keyword` (type: `string`):

Company, program or agency to search, e.g. Lockheed Martin.

## `awardType` (type: `string`):

Which kind of award.

## `fiscalYear` (type: `integer`):

Restrict to a fiscal year, e.g. 2024.

## `start` (type: `string`):

YYYY-MM-DD (alternative to fiscal year).

## `end` (type: `string`):

YYYY-MM-DD.

## `limit` (type: `integer`):

Max rows (awards ≤100, agencies ≤200).

## Actor input object example

```json
{
  "operation": "awards",
  "keyword": "Lockheed Martin",
  "awardType": "contracts",
  "limit": 15
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `runs` (type: `string`):

No description

# 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 = {
    "keyword": "Lockheed Martin"
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/usaspending").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 = { "keyword": "Lockheed Martin" }

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/usaspending").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 '{
  "keyword": "Lockheed Martin"
}' |
apify call synthetic.ia/usaspending --silent --output-dataset

```

## MCP server setup

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

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/CZ17SEcmGdLQzdBtK/builds/PDcxmeSdH7EN6JLrp/openapi.json
