# US Federal Spending — Contracts, Grants & Loans (`sourcerow/us-federal-spending`) Actor

Search US federal contracts, grants and loans by recipient, agency or keyword — amounts awarded and actually paid, periods, agencies and place of performance, largest first.

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

## Pricing

$1.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?

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

Search US federal contracts, grants and loans by recipient, agency or keyword.
Who received them, how much was promised, how much was actually paid, by which
agency and for what.

### What it does

USAspending.gov is the official record of United States government spending.
This Actor searches it and returns one row per award with 22 fields, largest
first.

The distinction it preserves is between what was awarded and what was paid.
`amount_usd` is the obligation; `outlays_usd` is money that has actually left
the Treasury. A large award with outlays near zero has barely started.

### What you get

22 fields per row, including `award_id`, `recipient_name`, `amount_usd`,
`outlays_usd`, `outlay_ratio`, `awarding_agency`, `awarding_sub_agency`,
`award_type`, `start_date`, `end_date`, `place_state`, `description` and
`duration_days`.

The table view shows 12 of them; all 22 are in the JSON, CSV and Excel
downloads.

### Input

| Field | Meaning |
|---|---|
| `awardTypes` | `contracts`, `grants`, `loans`, `direct_payments`, `other`. |
| `recipient` | Recipient name. |
| `agency` | Awarding agency. |
| `keyword` | Free-text search. |
| `fromDate` / `toDate` | Restrict by award period. |
| `maxAwards` | Stop after this many. `0` removes the cap. |

```json
{
  "awardTypes": ["contracts"],
  "recipient": "Lockheed Martin",
  "maxAwards": 200
}
```

### Sample output

One record, trimmed to the fields shown in the table view:

```json
{
  "award_id": "DENA0003525",
  "recipient_name": "NATIONAL TECHNOLOGY & ENGINEERING SOLUTIONS OF SANDIA, LLC",
  "amount_usd": 42774168231.25,
  "outlays_usd": 26301056802.91,
  "outlay_ratio": 0.6149,
  "awarding_agency": "Department of Energy",
  "awarding_sub_agency": "Department of Energy",
  "award_type": "DEFINITIVE CONTRACT",
  "start_date": "2017-01-18",
  "end_date": "2027-04-30",
  "place_state": "NM",
  "issues": ""
}
```

### Pricing

| Event | Per 1,000 | Notes |
|---|---|---|
| Award | $1.00 | One charge per award returned |

There is no start fee and no per-row dataset fee.

### What it does not do

**This is not financial or legal advice.** It is the federal record, cleaned.
Amounts are reported by the awarding agencies and are corrected over time.

**Negative amounts are real.** De-obligations appear as negative outlays and
negative ratios. `issues` marks them `negative_amount`. Exclude them for gross
awards, include them for net spending, but decide which you mean.

**No sub-awards.** This returns prime awards. Money passed from a prime
contractor to subcontractors is reported separately and is not in these rows.

**Descriptions are often missing.** Agencies are inconsistent about filling
them. `issues` marks `no_description` rather than leaving a silent blank.

**Search is by the fields above, not full text over documents.** There is no
contract text here, only the award record.

### Notes

Sort by `outlay_ratio` rather than by amount to see what is actually being
spent. A large obligation with a ratio near zero has barely started.

`period_ended` separates finished contracts from live ones without comparing
dates by hand.

Search by recipient to map a competitor's federal revenue; by agency and keyword
to find who is winning work in a field.

### Support

Open the **Issues** tab with the `award_id` and the field that looks wrong.

### Licence and attribution

Award data from USAspending.gov, the official source of United States government
spending data, published by the Department of the Treasury. As a work of the US
federal government it carries no copyright under 17 U.S.C. 105. The Treasury
does not endorse this Actor.

# Actor input Schema

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

Contracts, grants, loans, direct payments or other assistance.

## `recipient` (type: `string`):

The company or organisation that received the money.

## `agency` (type: `string`):

The federal department that awarded it, e.g. "Department of Defense".

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

Free text searched across the award description.

## `fromDate` (type: `string`):

Start of the period, as YYYY-MM-DD. Defaults to one year ago.

## `toDate` (type: `string`):

End of the period, as YYYY-MM-DD. Defaults to today.

## `maxAwards` (type: `integer`):

Stop after this many. **0 removes the cap.** Results come largest first.

## Actor input object example

```json
{
  "awardTypes": [
    "contracts"
  ],
  "maxAwards": 200
}
```

# Actor output Schema

## `awards` (type: `string`):

No description

## `summary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("sourcerow/us-federal-spending").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("sourcerow/us-federal-spending").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 sourcerow/us-federal-spending --silent --output-dataset

```

## MCP server setup

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

```

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/JvXXaV6IwaHeaWYjC/builds/DTlSSle26JvyjgQF1/openapi.json
