# USAspending Scraper: Federal Spending Trends by Category (`fedsignals/federal-spending-signals`) Actor

Returns federal contract spending signals from USAspending.gov: category growth vs a year ago, the agencies driving it, top contractors and new entrants, one row per signal. Pick categories and window; no API key.

- **URL**: https://apify.com/fedsignals/federal-spending-signals.md
- **Developed by:** [FedSignals Data](https://apify.com/fedsignals) (community)
- **Categories:** Lead generation, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 signal rows

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 Scraper: Federal Spending Trends by Category

Find out which federal contract categories and agencies are **growing or shrinking**, who is winning the money, and which companies are **new entrants**. All of it is computed from official USAspending.gov contract obligations. You don't need an API key.

### What you get (one row per signal)

| signalType | What it tells you |
|---|---|
| `category_trend` | Category dollars in the window versus the same window a year earlier and the immediately prior window. Includes growth %, a rising/flat/falling label, rank, the top recipient and their share, and a concentration flag (one firm ≥25%). |
| `agency_driver` | The agencies adding or cutting the most dollars inside each category. |
| `top_recipient` | The top N contractors per category in the window. |
| `new_entrant` | Firms in a category's current top 100 that were absent from the prior 12 months' top 500. Matched by UEI or name. |

There are 13 plain-English categories, defined by PSC code families. They match the Federal Contract Opportunities Monitor's groups, minus Security & Guard Services, Equipment & Supplies and Other.

### Example input

```json
{ "categories": ["IT & Cyber", "Construction", "Telecom"], "windowDays": 90, "lagDays": 95, "growthThresholdPct": 15 }
```

`lagDays` shifts every window back, because agencies report obligations to USAspending late (DoD reports with an extra 90-day delay). Comparing a window that is still filling in would look like a false decline.

### Example output

```json
{
  "signalType": "category_trend", "category": "IT & Cyber",
  "currentAmount": 24644942996.4, "yearAgoAmount": 19304514264.0,
  "growthYoYPct": 27.7, "growthVsPriorPct": 25.4, "trend": "rising",
  "topRecipient": "DELL FEDERAL SYSTEMS L.P", "topRecipientSharePct": 5.7, "concentrated": false,
  "windows": {"current": ["2026-04-27","2026-07-25"], "yearAgo": ["2025-04-28","2025-07-26"]}
}
```

```json
{ "signalType": "agency_driver", "category": "IT & Cyber", "agency": "Department of Homeland Security",
  "currentAmount": 2541736182.53, "yearAgoAmount": 916904758.95, "growthYoYPct": 177.2, "trend": "rising" }
```

A live run on Oct 28, 2026 (90-day window ending Jul 25, 2026) returned 315 signals in about 90 seconds. Highlights: Construction +194% YoY, led by DHS; Telecom +90%; IT & Cyber +28% and broad-based; Medical & Health −32%.

### Use cases

- GovCon BD teams choosing which agencies and categories to target next quarter.
- Investors and analysts following defense, IT and construction contractors.
- Consultants and newsletter writers producing "where the federal money is moving" reports.

### Data source and caveats

The data comes from the **USAspending.gov API** (U.S. Department of the Treasury). It is public U.S. government data, and no key is required. Obligations include modifications and deobligations, so large one-off awards can swing a category. Recent periods are incomplete until agencies finish reporting. Category groupings are this Actor's own mapping of PSC codes. Recipient names come from USAspending as-is, so one parent company can appear under several entities. This is not investment advice.

### Scheduling

The underlying data changes slowly, so run it **weekly or monthly**. Keep `windowDays` at 90 for momentum or 365 for structural trends.

### How much does it cost?

Pay per event: you pay only for the events below plus Apify's $0.00005 run-start fee. Platform compute is included in the price.

- **$0.01 per signal row** delivered.

Real examples from our test runs:

- **Quick-start input** (Telecom, 3 agencies, 3 recipients): about 10 rows × $0.01 = **about $0.10**.
- **All 13 categories with default settings**: 315 rows in our Oct 28 test = **about $3.15**. Pick a few categories to spend less.
- Monthly is enough for most users: spending data changes slowly.

Use the filters above and Apify's per-run spending limit to cap spend; the Actor stops cleanly when the limit is reached.

### Limits

- Obligations include modifications and deobligations, so one large award can swing a category.
- Recent months are incomplete until agencies finish reporting.
- Signals only; there is no raw award search mode.

### FAQ

**Why does the window end about three months ago?**\
Agencies report obligations late (DoD adds a 90-day delay). `lagDays` (default 95) avoids comparing a period that is still filling in.

**Is this a raw award export?**\
No. It returns computed signals (trends, drivers, top recipients, new entrants), not individual award records.

**What do the categories mean?**\
13 plain-English groups defined by PSC code families. They match our SAM.gov opportunities Actor's groups, minus Security & Guard Services, Equipment & Supplies and Other.

**Can one company appear twice?**\
Yes. Recipient names come from USAspending as-is, so one parent company can appear under several entities.

### Reliability

Measured on Apify as of Oct 29, 2026: 3 of 3 of our own test runs succeeded (100%), with a median run time of 6 seconds (longest 9 s) on small test inputs. It is a small sample from a new Actor; we will update it as runs accumulate. Local tests: a full run (all categories, 90-day window) returned 315 signals in about 90 seconds with 0 API errors.

### Use it from AI agents (MCP)

Add this Actor as a tool in Claude Desktop, Cursor or any MCP client through the Apify MCP server:

```json
{
  "mcpServers": {
    "federal-spending-signals": {
      "url": "https://mcp.apify.com?tools=fedsignals/federal-spending-signals",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

### Use it from code (API)

One call runs the Actor and returns the dataset items. `maxTotalChargeUsd` caps what the run can charge.

Python:

```python
import requests

items = requests.post(
    "https://api.apify.com/v2/acts/fedsignals~federal-spending-signals/run-sync-get-dataset-items",
    params={"maxTotalChargeUsd": 1},
    headers={"Authorization": "Bearer YOUR_APIFY_TOKEN"},
    json={"categories": ["Telecom"], "agenciesPerCategory": 3, "topRecipientsPerCategory": 3, "newEntrantLookbackPages": 1},
    timeout=300,
).json()
print(len(items), "items")
```

JavaScript (Node 18+):

```js
const res = await fetch(
  "https://api.apify.com/v2/acts/fedsignals~federal-spending-signals/run-sync-get-dataset-items?maxTotalChargeUsd=1",
  {
    method: "POST",
    headers: { Authorization: "Bearer YOUR_APIFY_TOKEN", "Content-Type": "application/json" },
    body: JSON.stringify({"categories": ["Telecom"], "agenciesPerCategory": 3, "topRecipientsPerCategory": 3, "newEntrantLookbackPages": 1}),
  }
);
const items = await res.json();
console.log(items.length, "items");
```

### Related FedSignals Actors

- [SAM.gov Scraper: Federal Contract Opportunities Monitor](https://apify.com/fedsignals/federal-opportunities-monitor): new SAM.gov contract opportunities, filtered and deduplicated
- [Expiring Federal Contracts: Recompete Finder (USAspending)](https://apify.com/fedsignals/federal-recompete-finder): federal contracts expiring soon, with incumbents
- [SEC Form D Scraper: New Startup Funding Rounds](https://apify.com/fedsignals/sec-form-d-monitor): new private funding rounds from SEC Form D filings
- [Building Permits Scraper: New Construction Leads by City](https://apify.com/fedsignals/building-permits-monitor): new building permits as construction leads

### Feedback

Found a bug or need a filter or source? Open an issue on the Issues tab or email **fedsignals.alerts@gmail.com**.

This Actor is not affiliated with or endorsed by the U.S. government or USAspending.gov. Nothing here is investment advice.

# Actor input Schema

## `categories` (type: `array`):

Returns signals only for these category groups. Empty = all groups (150-320 rows).

## `windowDays` (type: `integer`):

Length of the current window in days. Each category is compared with the same window a year earlier and the window just before.

## `lagDays` (type: `integer`):

End the current window this many days before today. Recent federal contract data is incomplete (DoD data is published with a delay); 90+ keeps comparisons fair.

## `growthThresholdPct` (type: `integer`):

Growth above +X% is labeled rising, below -X% falling.

## `agenciesPerCategory` (type: `integer`):

Returns this many agency_driver rows per category (agencies with the largest dollar change).

## `topRecipientsPerCategory` (type: `integer`):

Returns this many top_recipient rows per category.

## `newEntrantLookbackPages` (type: `integer`):

Controls how many new_entrant rows are found. A recipient counts as a new entrant if it is in the current top 100 but not in the previous 12 months' top N\*100. 0 disables (faster).

## `minCategoryAmount` (type: `integer`):

Skip drill-downs and ranking for categories smaller than this in the current window.

## `awardingAgency` (type: `string`):

Exact top-tier name, e.g. Department of Veterans Affairs. Empty = all agencies.

## `minRequestIntervalSec` (type: `number`):

Polite delay between API calls.

## Actor input object example

```json
{
  "categories": [
    "Telecom"
  ],
  "windowDays": 90,
  "lagDays": 95,
  "growthThresholdPct": 15,
  "agenciesPerCategory": 3,
  "topRecipientsPerCategory": 3,
  "newEntrantLookbackPages": 1,
  "minCategoryAmount": 50000000,
  "minRequestIntervalSec": 0.4
}
```

# Actor output Schema

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

Category trends, agency drivers, top recipients and new entrants. One item per row; field definitions are in the dataset schema.

## `summary` (type: `string`):

JSON summary of the run (counts scanned, pushed and skipped).

# 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 = {
    "categories": [
        "Telecom"
    ],
    "agenciesPerCategory": 3,
    "topRecipientsPerCategory": 3,
    "newEntrantLookbackPages": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("fedsignals/federal-spending-signals").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 = {
    "categories": ["Telecom"],
    "agenciesPerCategory": 3,
    "topRecipientsPerCategory": 3,
    "newEntrantLookbackPages": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("fedsignals/federal-spending-signals").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 '{
  "categories": [
    "Telecom"
  ],
  "agenciesPerCategory": 3,
  "topRecipientsPerCategory": 3,
  "newEntrantLookbackPages": 1
}' |
apify call fedsignals/federal-spending-signals --silent --output-dataset

```

## MCP server setup

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

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/9bV0l0Gf39pZs8anc/builds/uEGqeOzecUXDUix7M/openapi.json
