# USAspending Federal Awards - Contracts, Grants, Loans (`jpopendata/us-federal-spending`) Actor

U.S. federal spending awards from the official USAspending.gov API: recipient (companies and organizations only), UEI, agency, award type, obligated/outlayed amounts, dates, NAICS, PSC, Assistance Listing, county/city of performance. No API key. Unofficial; not affiliated with the U.S. Treasury.

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

## Pricing

from $2.00 / 1,000 results

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 Federal Awards - Contracts, Grants, Loans

Get U.S. federal spending awards — **who received the money, from which agency, how much, for what and where** — from the official public [USAspending.gov](https://www.usaspending.gov) API. One row per award: contracts, contract vehicles (IDVs), grants, direct payments, loans and other financial assistance.

- **No API key, no login.** Only the documented public API at `api.usaspending.gov` is used.
- **Several award types in one run**, merged into one ordered list (largest first, newest first or most recently modified first).
- **Nothing silently cut off.** Large result sets are paged with USAspending's own sequential cursor (plain page numbers stop being exact after 10,000 results), and every run reports how many awards matched in total.
- **Agency names the way people write them**: "DoD", "Defense", "VA", "HHS", "NASA", or sub-agencies such as "National Institutes of Health" or "Department of the Army".
- **Flat, analysis-ready columns**: recipient and UEI, awarding and funding agency and sub-agency with codes, obligated and outlayed amounts (face value and subsidy cost for loans), dates, NAICS and PSC with descriptions, Assistance Listing (CFDA) number and title, place of performance down to **state, county (with FIPS) and city**, and links to the award and recipient pages on USAspending.gov.
- **Companies and organisations only.** People and sole proprietors are never named (see below).

The natural companion of a SAM.gov opportunities feed: SAM.gov tells you what the government plans to buy; USAspending tells you who won and what was actually obligated and paid.

### Quick start — verified input

```json
{
  "awardTypes": ["contracts", "grants"],
  "agencies": ["NASA"],
  "daysBack": 30,
  "maxItems": 20
}
```

This returns NASA's 20 largest contracts and grants with activity in the last 30 days, in under a minute. An empty input (`{}`) returns the 100 largest contracts and grants of all agencies with activity in the last 30 days.

More examples:

```json
{ "awardTypes": ["contracts"], "naicsCodes": ["541512"], "states": ["VA", "MD"], "dateType": "new", "sortBy": "newest", "daysBack": 60, "maxItems": 500 }
```

```json
{ "awardTypes": ["grants"], "agencies": ["National Institutes of Health"], "dateFrom": "FY2025", "dateTo": "FY2025", "minAmount": 1000000 }
```

```json
{ "awardTypes": ["contracts", "idvs"], "recipientName": "Booz Allen Hamilton", "dateFrom": "2024-10-01", "maxItems": 1000 }
```

### Input

| Field | What it does |
|---|---|
| `awardTypes` | `contracts`, `idvs`, `grants`, `direct_payments`, `loans`, `other`, `assistance` (all four assistance types) or `all`. Single codes work too: `A` BPA call, `B` purchase order, `C` delivery order, `D` definitive contract, `02`–`05` grants, `06`/`10` direct payments, `07`/`08` loans, `09`/`11` other. Default: contracts and grants. |
| `keywords` | Words USAspending searches across the award (description, award ID, recipient, programme). Any of them matches. At least 3 characters each. |
| `recipientName` | Part of a company or organisation name, or its UEI. |
| `agencies`, `agencyRole` | Agencies or sub-agencies (names or abbreviations); `awarding` (signed the award, default) or `funding` (whose money it is). |
| `states` | Place-of-performance states or territories (codes or names). |
| `naicsCodes` | 2–6 digit NAICS codes or prefixes (contracts and IDVs). |
| `pscCodes` | 4-character Product and Service Codes (contracts and IDVs). |
| `assistanceListings` | Assistance Listing (CFDA) numbers, e.g. `93.778`. |
| `awardIds` | Contract numbers (PIID), grant numbers (FAIN) or URIs, matched by USAspending's award ID search. |
| `minAmount`, `maxAmount` | Award amount range in dollars. |
| `daysBack`, `dateFrom`, `dateTo` | The window. Dates as `YYYY-MM-DD`, `MM/DD/YYYY`, `today`, or fiscal years (`FY2025`). Earliest: 2007-10-01. |
| `dateType` | `active` (any activity in the window — USAspending's default), `new` (first signed in the window) or `modified`. |
| `sortBy` | `amount` (largest first), `newest` (base obligation date) or `lastModified`. |
| `maxItems` | Rows to return (1–100,000). |
| `verifyRecipients`, `maxRecipientLookups` | Business-type check for unclear recipient names (one request per recipient, cached). |
| `maxApiRequests` | Hard request budget; `0` = automatic. |

### Output example

```json
{
  "awardId": "NAS1510000",
  "awardKey": "CONT_AWD_NAS1510000_8000_-NONE-_-NONE-",
  "awardCategory": "contract",
  "awardType": "DEFINITIVE CONTRACT",
  "recipientName": "THE BOEING COMPANY",
  "recipientUei": "HLWWEH2CCXW5",
  "recipientId": "690fafd3-ecd8-1228-92a0-07aa28dd1ee2-C",
  "recipientWithheld": false,
  "recipientWithheldReason": null,
  "recipientNameBasis": "business_type",
  "awardingAgency": "National Aeronautics and Space Administration",
  "awardingAgencyCode": "080",
  "awardingSubAgency": "National Aeronautics and Space Administration",
  "awardingSubAgencyCode": "8000",
  "fundingAgency": "National Aeronautics and Space Administration",
  "fundingAgencyCode": "080",
  "fundingSubAgency": "National Aeronautics and Space Administration",
  "fundingSubAgencyCode": "8000",
  "obligatedAmount": 22653589199.84,
  "outlayedAmount": 2714678720.61,
  "loanFaceValue": null,
  "loanSubsidyCost": null,
  "startDate": "1993-11-15",
  "endDate": "2031-09-30",
  "baseObligationDate": "1993-11-15",
  "lastModifiedDate": "2026-10-05",
  "lastDateToOrder": null,
  "loanIssuedDate": null,
  "naicsCode": "336414",
  "naicsDescription": "GUIDED MISSILE AND SPACE VEHICLE MANUFACTURING",
  "pscCode": "AR62",
  "pscDescription": "R&D- SPACE: STATION (APPLIED RESEARCH/EXPLORATORY DEVELOPMENT)",
  "assistanceListingNumber": null,
  "assistanceListingTitle": null,
  "assistanceListings": [],
  "placeOfPerformanceCountryCode": "USA",
  "placeOfPerformanceCountry": "UNITED STATES",
  "placeOfPerformanceState": "TX",
  "placeOfPerformanceStateName": "Texas",
  "placeOfPerformanceCounty": "HARRIS",
  "placeOfPerformanceCountyFips": "48201",
  "placeOfPerformanceCity": "HOUSTON",
  "placeOfPerformanceCongressionalDistrict": "36",
  "description": "INTERNATIONAL SPACE STATION",
  "usaspendingUrl": "https://www.usaspending.gov/award/CONT_AWD_NAS1510000_8000_-NONE-_-NONE-",
  "recipientProfileUrl": "https://www.usaspending.gov/recipient/690fafd3-ecd8-1228-92a0-07aa28dd1ee2-C/latest",
  "source": "USAspending.gov (U.S. Department of the Treasury, Bureau of the Fiscal Service) - official public API",
  "sourceUrl": "https://www.usaspending.gov",
  "license": "Source: USAspending.gov, U.S. Department of the Treasury, Bureau of the Fiscal Service, https://www.usaspending.gov. ...",
  "retrievedAt": "2026-10-12T22:25:37.661Z"
}
```

Amounts are U.S. dollars as published (`obligatedAmount` is the award's total obligation and can be negative after de-obligations; loans carry `loanFaceValue` and `loanSubsidyCost` instead). A run summary (`RUN_SUMMARY` in the key-value store) lists, per award type, how many awards matched, how many were read, and why a run stopped early if it did.

### Recipients: companies and organisations only

USAspending itself redacts individuals who receive financial assistance ("REDACTED DUE TO PII") and publishes some programmes as county-level aggregates ("MULTIPLE RECIPIENTS"). Contracts and loans can still go to sole proprietors under their personal names. This Actor names a recipient only when it is clearly an organisation:

- a legal form in the name (LLC, Inc., Corp., Ltd., L.P., P.C., P.A., N.A., GmbH, S.A. ...), or an unmistakable public body or institution (University, County, City of, Department, Tribe, School District, Authority, Credit Union ...), or
- for unclear names ("THE BOEING COMPANY", "XYZ CONTRACTING"), the recipient's business type on USAspending: corporations, LLCs, non-profits, universities and governments are named; sole proprietorships and individuals are not.

When a recipient is not named, `recipientName`, `recipientUei`, `recipientId`, `recipientProfileUrl` and `description` are `null`, `recipientWithheld` is `true` and `recipientWithheldReason` says why: `redacted_by_source`, `aggregate_record`, `individual_or_sole_proprietor`, `not_verified_as_organization` or `dnb_open_data`. The award facts (agency, amount, dates, codes, place) stay. **With a keyword or recipient search, awards whose recipient may be a person are left out entirely**, because the search text could be that person's name; the run summary counts them (`excludedForPrivacy`).

Recipient names of awards last modified before **2022-04-04** are withheld (`dnb_open_data`): records from before the federal switch from DUNS to UEI may contain Dun & Bradstreet data, which USAspending's licence restricts. DUNS numbers and recipient addresses are never collected.

### Empty results?

- **DoD and Army Corps of Engineers contracts appear with a 90-day delay** on USAspending; use a longer window (`daysBack: 180`).
- **Grants and other assistance are reported by agencies in batches**, often weeks after the action date: a 7-day window can be empty for an agency that has thousands of awards over 90 days.
- NAICS and PSC codes exist only on contracts and IDVs; Assistance Listings only on grants, loans, direct payments and other assistance.
- A short window plus several filters can simply match nothing — widen `daysBack` or drop a filter.
- Under a keyword search, awards to individuals are left out (see above), so a keyword that only appears in such awards returns 0 rows.
- An agency name USAspending does not know stops the run with the closest matching names — copy one of them.

### Common input mistakes

| Wrong | Right |
|---|---|
| `"awardTypes": ["subawards"]` | Subawards are not included; use `contracts`, `idvs`, `grants`, `direct_payments`, `loans`, `other` |
| `"states": ["Los Angeles"]` | `"states": ["CA"]` (states or territories only) |
| `"naicsCodes": ["5415121"]` | `"naicsCodes": ["541512"]` (2–6 digits) |
| `"keywords": ["AI"]` | `"keywords": ["artificial intelligence"]` (3+ characters) |
| `"assistanceListings": ["93778"]` | `"assistanceListings": ["93.778"]` |
| `"dateFrom": "2005-01-01"` | USAspending search starts at `2007-10-01` (FY2008) |

### Speed and limits

Requests are made one at a time, at least 1.5 seconds apart, 100 awards per page, plus one business-type lookup per unclear recipient. Roughly: 100 rows ≈ 10–30 seconds, 10,000 rows ≈ 5 minutes. USAspending publishes no rate limit; the Actor honours `Retry-After`, backs off on errors and stops cleanly (keeping the rows it has, `complete: false` with a reason) if the API stops answering. No proxy is needed.

### Data source, licence and disclaimer

- Source: **USAspending.gov, U.S. Department of the Treasury, Bureau of the Fiscal Service, https://www.usaspending.gov** (the citation USAspending suggests). Every row carries this attribution in `source`, `sourceUrl`, `license` and `retrievedAt`.
- USAspending.gov states that its data "is available to copy, adapt, redistribute, or otherwise use for non-commercial or for commercial purposes, subject to the Limitation on Permissible Use of Dun & Bradstreet, Inc. Data" (https://www.usaspending.gov/db_info). Any D\&B Open Data that may remain in older records is attributed to Dun & Bradstreet, Inc.; do not use it in bulk.
- **Unofficial.** This Actor is not affiliated with, endorsed by or sponsored by the U.S. Department of the Treasury, the Bureau of the Fiscal Service or any U.S. Government agency. Data is provided as published by USAspending.gov, without warranty; for contract data FPDS is the authoritative source.
- Only publicly available data is collected, through the official public API. You are responsible for using the data lawfully and in line with USAspending.gov's terms, including the D\&B limitation.
- Personal data: the Actor is built not to output personal data (no names of individuals or sole proprietors, no addresses, no contact details). If you combine the output with other data, GDPR and similar laws may still apply to you.

# Actor input Schema

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

Which kinds of awards: contracts, idvs (contract vehicles such as IDIQs and BPAs), grants, direct_payments, loans, other (insurance and other assistance), assistance (= grants + direct payments + loans + other) or all. Single USAspending codes work too, e.g. "A" (BPA call), "D" (definitive contract), "04" (project grant), "07" (direct loan). Empty = contracts and grants.

## `keywords` (type: `array`):

Optional. Words searched by USAspending across the award (description, award ID, recipient, programme...), at least 3 characters each, e.g. "cybersecurity", "wildfire", "broadband". An award matches if it contains ANY of them. Note: with a keyword search, awards whose recipient may be a person are left out entirely.

## `recipientName` (type: `string`):

Optional. Part of the recipient's name or its UEI, e.g. "Lockheed Martin", "Johns Hopkins" or "LUJEPCRRT377". Only companies and organisations are named in the output.

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

Optional. Federal agencies or sub-agencies, by name or abbreviation, e.g. "Department of Defense", "DoD", "NASA", "VA", "HHS", "National Institutes of Health", "Department of the Army", "FEMA". Any of them counts. Unknown names stop the run with the closest matches.

## `agencyRole` (type: `string`):

Whether the agencies above must be the awarding agency (the one that signed the award) or the funding agency (the one whose money it is).

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

Optional. U.S. states or territories where the work is done, as codes or names, e.g. "VA", "Texas", "DC", "Puerto Rico". Any of them counts.

## `naicsCodes` (type: `array`):

Optional. 2 to 6 digit NAICS codes or prefixes, e.g. "541512" (computer systems design) or "54" (all professional services). Applies to contracts and IDVs; assistance awards have no NAICS.

## `pscCodes` (type: `array`):

Optional. 4-character Product and Service Codes, e.g. "D302" (IT systems development), "R425" (engineering support), "7030" (software).

## `assistanceListings` (type: `array`):

Optional. Assistance Listing numbers for grants, loans and other assistance, e.g. "93.778" (Medicaid), "20.205" (highway planning and construction), "10.551" (SNAP).

## `awardIds` (type: `array`):

Optional. Contract numbers (PIID), grant numbers (FAIN) or URIs, e.g. "DENA0003525" or "UM1AI068619", matched by USAspending's award ID search.

## `minAmount` (type: `integer`):

Optional. Smallest award amount in whole dollars, e.g. 1000000 (obligated amount; face value for loans).

## `maxAmount` (type: `integer`):

Optional. Largest award amount in dollars, e.g. 25000000.

## `daysBack` (type: `integer`):

Window length in days ending today (or on Date to). Ignored when Date from is set.

## `dateFrom` (type: `string`):

Optional. First day of the window, YYYY-MM-DD, e.g. "2025-10-01". MM/DD/YYYY, "today", "yesterday" and fiscal years ("FY2025" = 2024-10-01) work too. The earliest date USAspending searches is 2007-10-01.

## `dateTo` (type: `string`):

Optional. Last day of the window, YYYY-MM-DD ("FY2025" = 2025-09-30). Empty = today.

## `dateType` (type: `string`):

active: awards with any activity (an obligation or modification) in the window - USAspending's own default. new: only awards first signed in the window. modified: awards whose record changed in the window.

## `sortBy` (type: `string`):

Order of the rows (the run returns the first maxItems in this order): largest amount first (obligated amount; face value for loans), newest award first (base obligation date) or most recently modified first.

## `maxItems` (type: `integer`):

Maximum number of award rows to return (1..100000). Pages are read 100 awards at a time, at least 1.5 seconds apart.

## `verifyRecipients` (type: `boolean`):

When a recipient name does not show whether it is a company or a person (e.g. "THE BOEING COMPANY", "SMITH CONTRACTING"), look up its business type on USAspending once per recipient: companies and organisations are named, sole proprietors and people are withheld. Off = unclear recipients are withheld.

## `maxRecipientLookups` (type: `integer`):

Upper limit on business-type lookups per run (0..5000). Each lookup is one extra request. Recipients beyond the limit are withheld.

## `maxApiRequests` (type: `integer`):

Hard cap on requests to the USAspending API in this run. 0 = automatic (enough for maxItems plus lookups).

## `proxyConfiguration` (type: `object`):

Not needed: the USAspending API answers Apify datacenter IPs directly. Leave off.

## Actor input object example

```json
{
  "awardTypes": [
    "contracts",
    "grants"
  ],
  "keywords": [],
  "recipientName": "",
  "agencies": [],
  "agencyRole": "awarding",
  "states": [],
  "naicsCodes": [],
  "pscCodes": [],
  "assistanceListings": [],
  "awardIds": [],
  "daysBack": 30,
  "dateFrom": "",
  "dateTo": "",
  "dateType": "active",
  "sortBy": "amount",
  "maxItems": 100,
  "verifyRecipients": true,
  "maxRecipientLookups": 200,
  "maxApiRequests": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

One row per U.S. federal award with the USAspending.gov attribution (source, sourceUrl, license, retrievedAt) on every item.

# 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 = {
    "awardTypes": [
        "contracts",
        "grants"
    ],
    "keywords": [],
    "recipientName": "",
    "agencies": [],
    "agencyRole": "awarding",
    "states": [],
    "naicsCodes": [],
    "pscCodes": [],
    "assistanceListings": [],
    "awardIds": [],
    "daysBack": 30,
    "dateFrom": "",
    "dateTo": "",
    "dateType": "active",
    "sortBy": "amount",
    "maxItems": 100,
    "verifyRecipients": true,
    "maxRecipientLookups": 200,
    "maxApiRequests": 0,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jpopendata/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 = {
    "awardTypes": [
        "contracts",
        "grants",
    ],
    "keywords": [],
    "recipientName": "",
    "agencies": [],
    "agencyRole": "awarding",
    "states": [],
    "naicsCodes": [],
    "pscCodes": [],
    "assistanceListings": [],
    "awardIds": [],
    "daysBack": 30,
    "dateFrom": "",
    "dateTo": "",
    "dateType": "active",
    "sortBy": "amount",
    "maxItems": 100,
    "verifyRecipients": True,
    "maxRecipientLookups": 200,
    "maxApiRequests": 0,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("jpopendata/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 '{
  "awardTypes": [
    "contracts",
    "grants"
  ],
  "keywords": [],
  "recipientName": "",
  "agencies": [],
  "agencyRole": "awarding",
  "states": [],
  "naicsCodes": [],
  "pscCodes": [],
  "assistanceListings": [],
  "awardIds": [],
  "daysBack": 30,
  "dateFrom": "",
  "dateTo": "",
  "dateType": "active",
  "sortBy": "amount",
  "maxItems": 100,
  "verifyRecipients": true,
  "maxRecipientLookups": 200,
  "maxApiRequests": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call jpopendata/us-federal-spending --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jpopendata/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/BmDdL441WIbUltJHJ/builds/3vFmrB1eHJMLSen1P/openapi.json
