# USAspending Federal Awards Feed + Changes (`thoob/federal-spending-feed`) Actor

Clean, flat federal award records from the official USAspending.gov API, filtered by date, award type, agency, recipient, place, and amount, with a what-changed-since-last-run mode. Billed only per delivered award, no start fee.

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

## Pricing

$0.02 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Federal Awards Feed

Clean, flat federal award records from the official USAspending.gov API. Filter by date, award type, agency, recipient, place of performance, and dollar amount, get one useful row per award, and run a changes-only mode that returns just what is new, updated, or re-obligated since your last run.

You pay only for a delivered award. There is no actor-start fee. Filtered-out rows, unchanged rows in changes mode, and malformed records cost nothing.

### What a record is

One flat row per award, pulled from the USAspending award record:

- identity: `generatedInternalId` (the stable award id), `awardId`, award page URL
- recipient: `recipientName`, `recipientId`
- money: `awardAmount`, `totalOutlays`
- who and what: `awardingAgency`, `awardingSubAgency`, `fundingAgency`, `fundingSubAgency`, `description`
- type: `awardType`, `contractAwardType`
- timeline: `startDate`, `endDate`, `lastModifiedDate`
- place: `placeOfPerformanceStateCode`, `placeOfPerformanceCountryCode`
- contract codes: `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription`
- provenance: `sourceUrl`, `retrievedAt`, `confidence`, `jurisdiction`, `dataSource`, and in changes mode `changeType`

Every value appears verbatim at the award page in `sourceUrl`. Nothing is guessed.

### Sample output

A real slice, large Department of Defense contracts (abbreviated):

| awardId | recipientName | awardAmount | awardingAgency | sourceUrl |
|---|---|---|---|---|
| N0001917C0001 | LOCKHEED MARTIN CORPORATION | 35135514910.20 | Department of Defense | usaspending.gov/award/CONT_AWD_N0001917C0001_9700_-NONE-_-NONE- |
| HT940216C0001 | HUMANA GOVERNMENT BUSINESS INC | 51269205263.03 | Department of Defense | usaspending.gov/award/CONT_AWD_HT940216C0001_9700_-NONE-_-NONE- |
| DEAC0494AL85000 | LOCKHEED MARTIN CORP | 48063763681.32 | Department of Energy | usaspending.gov/award/CONT_AWD_DEAC0494AL85000_8900_-NONE-_-NONE- |

### Two modes

- **full**: every award matching your filter.
- **changes**: only awards that are new, carry a newer last-modified date, or have a changed amount since this account's last run. The state is tracked per account, so it is your timeline. The first changes run has no baseline, so it returns everything matching once, then tracks deltas from there. An award held back by the delivery cap is delivered on a later run, never billed twice.

### Filters

- **startDate, endDate**: the award action date window, YYYY-MM-DD. The API holds data back to 2007-10-01. Leave empty for the last 365 days.
- **awardTypes**: friendly groups (contracts, idvs, grants, loans, direct_payments, other_financial_assistance, all_contracts, all_assistance).
- **awardTypeCodes**: exact USAspending codes for precise control (A, B, C, D, IDV_A, 02, 03, and the rest).
- **recipientSearch**: keep only awards whose recipient matches these terms.
- **agencies**: top-tier awarding agency names.
- **placeOfPerformanceStates**: two-letter US state codes.
- **keyword**: a free-text term, matched by the API and re-checked on the returned row.
- **awardAmountMin, awardAmountMax**: a dollar range.
- **maxRecords**: a cap on how many records a run delivers and bills. 0 means no cap; the platform spend cap is honored regardless.

Date, type, recipient, agency, place, keyword, and amount are applied by the API; the amount range and keyword are re-checked on the returned row.

### What to expect

- USAspending holds tens of millions of award records, updated daily. A filter narrows that to the slice you care about.
- The raw API is public and free directly from the Treasury. What this actor sells is the flat, joined record, the friendly filters, and the per-account change feed, so you do not have to build the POST search, page it, flatten the nested NAICS and PSC, or diff it yourself.
- The search endpoint returns at most 10,000 records per filter. For a deeper pull, narrow the window, the agency, or the recipient. The actor stops cleanly and tells you when it reaches that edge.
- An agency or recipient watch is a few cents; a daily changes feed is a fraction of a cent a run.

### Source and scope

- Source: the official USAspending.gov API v2 (`api.usaspending.gov`), a U.S. Department of the Treasury service, public domain, keyless, no anti-bot, paged with a declared identifying User-Agent.
- This is federal spending: who received federal money, at the award level. It is public record. The actor carries only that record and stamps `dataSource=USAspending.gov` and `jurisdiction=US`.
- This is a data tool, not legal, financial, or procurement advice. An award record is a disclosure, not a finding.

### See also

More clean, pay-only-for-results data tools from Pono Data:

- [SAM.gov Opportunities Feed](https://apify.com/thoob/sam-opportunities-feed) - federal contract opportunities, new since last run
- [Regulatory Change Monitor](https://apify.com/thoob/regulatory-change-monitor) - federal rulemaking from the Federal Register

Full catalog: https://apify.com/thoob

# Actor input Schema

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

Award action date window start, YYYY-MM-DD. The API accepts dates back to 2007-10-01; earlier values are clamped. Leave empty to use the last 365 days.
## `endDate` (type: `string`):

Award action date window end, YYYY-MM-DD. Leave empty to use today.
## `awardTypes` (type: `array`):

Friendly award groups to include: contracts, idvs, grants, loans, direct_payments, other_financial_assistance, all_contracts, all_assistance. Combined with any raw codes below. Leave both empty to default to contracts.
## `awardTypeCodes` (type: `array`):

Optional. Exact USAspending award type codes (for example A, B, C, D for contracts; 02, 03, 04, 05 for grants; IDV_A..IDV_E for IDVs). Use this for precise control instead of the groups above.
## `recipientSearch` (type: `array`):

Optional. Keep only awards whose recipient matches these terms (for example Lockheed, Johns Hopkins). Matched server-side by USAspending.
## `agencies` (type: `array`):

Optional. Top-tier awarding agency names to keep (for example Department of Defense, Department of Health and Human Services). Each entry is matched as an awarding top-tier agency.
## `placeOfPerformanceStates` (type: `array`):

Optional. Two-letter US state codes for the place of performance (for example CA, TX, NY). Leave empty for anywhere.
## `keyword` (type: `string`):

Optional. A free-text term matched by USAspending across the award, and re-checked here against recipient name and description.
## `awardAmountMin` (type: `integer`):

Optional. Keep only awards at or above this dollar amount.
## `awardAmountMax` (type: `integer`):

Optional. Keep only awards at or below this dollar amount.
## `mode` (type: `string`):

full returns every award matching your filter. changes returns only awards that are new, have a newer last-modified date, or have a changed amount since this account's last run, tracked per account. The first changes run has no baseline, so it returns everything matching once, then tracks deltas.
## `maxRecords` (type: `integer`):

Safety cap on how many awards this run delivers and bills. 0 means no cap. In changes mode, awards beyond the cap are not dropped: they are delivered on a later run, never billed twice. The platform spend cap (ACTOR_MAX_TOTAL_CHARGE_USD) is honored regardless.
## `pageSize` (type: `integer`):

How many awards to request per API page (1 to 100). The default is the API maximum.

## Actor input object example

```json
{
  "awardTypes": [
    "contracts"
  ],
  "awardTypeCodes": [],
  "recipientSearch": [],
  "agencies": [],
  "placeOfPerformanceStates": [],
  "mode": "full",
  "maxRecords": 0,
  "pageSize": 100
}
````

# Actor output Schema

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

One row per award matching your filter.

# 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": "",
    "endDate": "",
    "awardTypes": [
        "contracts"
    ],
    "awardTypeCodes": [],
    "recipientSearch": [],
    "agencies": [],
    "placeOfPerformanceStates": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("thoob/federal-spending-feed").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": "",
    "endDate": "",
    "awardTypes": ["contracts"],
    "awardTypeCodes": [],
    "recipientSearch": [],
    "agencies": [],
    "placeOfPerformanceStates": [],
}

# Run the Actor and wait for it to finish
run = client.actor("thoob/federal-spending-feed").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": "",
  "endDate": "",
  "awardTypes": [
    "contracts"
  ],
  "awardTypeCodes": [],
  "recipientSearch": [],
  "agencies": [],
  "placeOfPerformanceStates": []
}' |
apify call thoob/federal-spending-feed --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USAspending Federal Awards Feed + Changes",
        "description": "Clean, flat federal award records from the official USAspending.gov API, filtered by date, award type, agency, recipient, place, and amount, with a what-changed-since-last-run mode. Billed only per delivered award, no start fee.",
        "version": "0.0",
        "x-build-id": "K9HgwcniWsAqxQipb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thoob~federal-spending-feed/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thoob-federal-spending-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/thoob~federal-spending-feed/runs": {
            "post": {
                "operationId": "runs-sync-thoob-federal-spending-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/thoob~federal-spending-feed/run-sync": {
            "post": {
                "operationId": "run-sync-thoob-federal-spending-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Award action date window start, YYYY-MM-DD. The API accepts dates back to 2007-10-01; earlier values are clamped. Leave empty to use the last 365 days."
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "Award action date window end, YYYY-MM-DD. Leave empty to use today."
                    },
                    "awardTypes": {
                        "title": "Award type groups",
                        "type": "array",
                        "description": "Friendly award groups to include: contracts, idvs, grants, loans, direct_payments, other_financial_assistance, all_contracts, all_assistance. Combined with any raw codes below. Leave both empty to default to contracts.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "awardTypeCodes": {
                        "title": "Raw award type codes",
                        "type": "array",
                        "description": "Optional. Exact USAspending award type codes (for example A, B, C, D for contracts; 02, 03, 04, 05 for grants; IDV_A..IDV_E for IDVs). Use this for precise control instead of the groups above.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "recipientSearch": {
                        "title": "Recipient name contains",
                        "type": "array",
                        "description": "Optional. Keep only awards whose recipient matches these terms (for example Lockheed, Johns Hopkins). Matched server-side by USAspending.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "agencies": {
                        "title": "Awarding agencies",
                        "type": "array",
                        "description": "Optional. Top-tier awarding agency names to keep (for example Department of Defense, Department of Health and Human Services). Each entry is matched as an awarding top-tier agency.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "placeOfPerformanceStates": {
                        "title": "Place of performance states",
                        "type": "array",
                        "description": "Optional. Two-letter US state codes for the place of performance (for example CA, TX, NY). Leave empty for anywhere.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Optional. A free-text term matched by USAspending across the award, and re-checked here against recipient name and description."
                    },
                    "awardAmountMin": {
                        "title": "Minimum award amount (USD)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Optional. Keep only awards at or above this dollar amount."
                    },
                    "awardAmountMax": {
                        "title": "Maximum award amount (USD)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Optional. Keep only awards at or below this dollar amount."
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "full",
                            "changes"
                        ],
                        "type": "string",
                        "description": "full returns every award matching your filter. changes returns only awards that are new, have a newer last-modified date, or have a changed amount since this account's last run, tracked per account. The first changes run has no baseline, so it returns everything matching once, then tracks deltas.",
                        "default": "full"
                    },
                    "maxRecords": {
                        "title": "Max delivered records",
                        "minimum": 0,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Safety cap on how many awards this run delivers and bills. 0 means no cap. In changes mode, awards beyond the cap are not dropped: they are delivered on a later run, never billed twice. The platform spend cap (ACTOR_MAX_TOTAL_CHARGE_USD) is honored regardless.",
                        "default": 0
                    },
                    "pageSize": {
                        "title": "API page size",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "How many awards to request per API page (1 to 100). The default is the API maximum.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
