# USAspending New Federal Contract Awards Monitor (`hopeful_crabgrass/usaspending-new-awards`) Actor

Award-tracking feed of newly reported US federal contract awards in a caller-supplied date window (maximum 31 days), flattened from the documented USAspending API. This is research and monitoring, not a lead or prospect list.

- **URL**: https://apify.com/hopeful_crabgrass/usaspending-new-awards.md
- **Developed by:** [Juan Marcos](https://apify.com/hopeful_crabgrass) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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?

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 New Federal Contract Awards Monitor

An award-tracking feed of newly reported US federal contract awards in a caller-supplied date window (maximum 31 days), flattened from the documented USAspending API. This is research and monitoring, not a leads product, and not legal, procurement, or credit advice.

### What it does

It posts to `https://api.usaspending.gov/api/v2/search/spending_by_award/` for contract award types A–D, with `new_awards_only` and a required date window of at most 31 days. It returns a compact row per award: identifiers, amounts, NAICS, awarding agency, recipient name, and state of performance.

`stateOfPerformance` is the government-reported place of performance from USAspending, not a value inferred by this Actor.

`usaspendingUrl` is constructed as `https://www.usaspending.gov/award/<generatedInternalId>` from the identifier in the API response. The Actor never fetches that HTML page.

Optional `onlyNew` stores seen `generatedInternalId` values (identifiers only) in a named key-value store (`usaspending-seen-award-ids`) so a scheduled run is not re-billed for awards already returned.

Recipient names that are ALL CAPS firm names are kept. A name is blanked only when a person cue is present (for example a courtesy title, or a mixed-case personal-name pattern). Address and other contact fields are not requested or output.

### Input

| Field | Default | Description |
| --- | --- | --- |
| `sinceDays` | `7` | Used when `from`/`to` are empty. The resolved window cannot exceed 31 days. |
| `from` / `to` | empty | Inclusive YYYY-MM-DD action date window |
| `naics` | `[]` | Optional NAICS codes or prefixes |
| `states` | `[]` | Optional US state codes for place of performance |
| `agencies` | `[]` | Optional awarding-agency filters |
| `minAmount` | `10000` | Minimum award amount in USD. Many contract actions are delivery orders or modifications below this amount; raise or lower the floor to change how much of that volume you see. |
| `maxResults` | `100` | Hard cap |
| `onlyNew` | `false` | Skip already-seen award identifiers using the named store above |

### Pricing

Pay-per-event. The primary event is `award-row` at **$0.006** per award row actually pushed. The platform also bills a synthetic `apify-actor-start` event automatically; this Actor does not call `Actor.charge()` for that event. If the user sets a maximum total charge, the Actor stops when a charge is refused or the remaining budget cannot cover another result. Uncharged rows are not written.

### Licence and attribution

USAspending data may be copied and reused commercially, subject to the Dun & Bradstreet limitation on the USAspending homepage. D\&B Open Data must be attributed and must not be disseminated in bulk as a substitute for D\&B's product. Every output row carries the required D\&B attribution exactly.

### Support

Contact via the Apify Store Issues tab.

# Actor input Schema

## `sinceDays` (type: `integer`):

Used when from/to are not set. Default 7, maximum 31. Inclusive window ending today.

## `from` (type: `string`):

Inclusive start date (YYYY-MM-DD). Must be used with to. Maximum window 31 days.

## `to` (type: `string`):

Inclusive end date (YYYY-MM-DD).

## `naics` (type: `array`):

Optional NAICS codes to include.

## `states` (type: `array`):

Optional US state codes (two letters) for place of performance.

## `agencies` (type: `array`):

Optional awarding agency names (toptier), passed through to the documented API filter.

## `minAmount` (type: `number`):

Minimum obligated amount in USD. Default 10,000 so small delivery orders are not the default result set. Set 0 to include all amounts.

## `maxResults` (type: `integer`):

Hard cap on award rows returned. Default 100, maximum 1000. No bulk or whole-FY export.

## `onlyNew` (type: `boolean`):

If true, skip generated_internal_id values already stored in this Actor's key-value store.

## Actor input object example

```json
{
  "sinceDays": 7,
  "from": "",
  "to": "",
  "naics": [],
  "states": [],
  "agencies": [],
  "minAmount": 10000,
  "maxResults": 5,
  "onlyNew": false
}
```

# Actor output Schema

## `results` (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 = {
    "sinceDays": 7,
    "minAmount": 10000,
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("hopeful_crabgrass/usaspending-new-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 = {
    "sinceDays": 7,
    "minAmount": 10000,
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("hopeful_crabgrass/usaspending-new-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 '{
  "sinceDays": 7,
  "minAmount": 10000,
  "maxResults": 5
}' |
apify call hopeful_crabgrass/usaspending-new-awards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hopeful_crabgrass/usaspending-new-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/0OFu94GkRCSwelVYy/builds/VokvYcSndXQ2QEASb/openapi.json
