# USAspending & Grants.gov API (Unofficial) (`graylabs/federal-awards-grants`) Actor

Federal contract, IDV and grant awards from USAspending.gov plus posted and forecasted Grants.gov opportunities in one schema. Filter by agency, NAICS, state, keyword and Assistance Listing. Organisation recipients only, awards from April 4, 2022. Not affiliated with any US government agency.

- **URL**: https://apify.com/graylabs/federal-awards-grants.md
- **Developed by:** [Gray Labs](https://apify.com/graylabs) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 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/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 & Grants.gov API (Unofficial)

Get **US federal contract and grant awards from USAspending.gov** and **posted and forecasted grant opportunities from Grants.gov** in one clean, flat schema, with no API key.

- **Awards:** contracts, IDVs (GWACs, BPAs, IDIQs) and grants or cooperative agreements, with amount, outlays, agency and sub-agency, recipient organisation and UEI, place of performance, NAICS, PSC, Assistance Listings and dates.
- **Opportunities:** number, title, agency, open and close dates, award ceiling and floor, estimated funding, expected number of awards, eligible applicants and synopsis.
- **Filters:** agency, NAICS, state, minimum amount, keyword, recipient name or UEI, Assistance Listing (CFDA) number, Grants.gov agency code, funding category and eligibility.
- **Date windows** (for example, the last 2 days) so a scheduled run picks up new awards and opportunities.
- **Organisation recipients only.** Awards to individuals and sole proprietorships are dropped, and no contact names, emails or phone numbers are output.
- Every row links back to its page on USAspending.gov or Grants.gov.

> This is an independent tool. It is not affiliated with, endorsed by or certified by the U.S. Department of the Treasury, the Bureau of the Fiscal Service, USAspending.gov, Grants.gov, the U.S. Department of Health and Human Services or any other US government agency.
>
> This product uses the Grants.gov API but is not endorsed or certified by the U.S. Department of Health and Human Services.

### What you get

- **USAspending awards** (`recordType: "award"`): contracts, IDVs (GWACs, BPAs, IDIQs) and grants or cooperative agreements, with award ID, amount, outlays, awarding agency and sub-agency, recipient organisation name, UEI, city/state/country, place of performance, NAICS, PSC, Assistance Listings, start/end dates and description.
- **Grants.gov opportunities** (`recordType: "opportunity"`): posted and forecasted funding notices with number, title, agency, open and close dates, award ceiling and floor, estimated total funding, expected number of awards, cost sharing, eligible applicants, funding instruments and categories, and the synopsis text.
- **Organisation recipients only.** Awards to individuals and sole proprietorships are dropped, and so are rows the source marks as individual, redacted or aggregated. No contact names, emails or phone numbers are output.
- **One run, both sources**, with a run summary (`RUN_SUMMARY`) showing how many rows each source returned, saved and dropped.

### Use cases

- A daily feed of new federal contract and grant awards in your industry (NAICS) or state.
- Track which agencies are funding a topic, and how much.
- Watch Grants.gov for new opportunities in your funding category, with deadlines and award sizes.
- Market and competitor research on public federal spending.

### Input

| Field                                                           | What it does                                                                                        |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `includeAwards`, `includeOpportunities`                         | Pick one or both sources.                                                                           |
| `awardCategories`                                               | `contracts`, `idvs`, `grants`.                                                                      |
| `awardDateType`                                                 | `new` (base obligation date in the window) or `modified` (awards changed in the window).            |
| `awardsLastNDays` / `awardsStartDate` / `awardsEndDate`         | The awards date window.                                                                             |
| `awardingAgencies`                                              | Top-tier agency names, e.g. `Department of Energy`.                                                 |
| `recipientSearch`                                               | Recipient organisation name or UEI text.                                                            |
| `naicsCodes`                                                    | NAICS codes for contracts and IDVs.                                                                 |
| `placeOfPerformanceStates`                                      | Two-letter state codes.                                                                             |
| `minAwardAmount`                                                | Smallest award amount to include.                                                                   |
| `keywords`                                                      | Free text, used for both sources.                                                                   |
| `assistanceListings`                                            | Assistance Listing (CFDA) numbers like `93.213`, for grants and opportunities.                      |
| `opportunityStatuses`                                           | `posted`, `forecasted`, `closed`, `archived`.                                                       |
| `opportunitiesPostedLastNDays`                                  | Only opportunities posted recently (0 = no limit).                                                  |
| `grantsGovAgencyCodes`, `fundingCategories`, `eligibilityCodes` | Grants.gov filters, using Grants.gov codes (e.g. `HHS-NIH11`, `HL`, `23`).                          |
| `includeOpportunityDetails`                                     | Adds synopsis text, award sizes and eligibility (one extra request per opportunity). On by default. |
| `maxRecords`                                                    | Total rows to save, split evenly across the selected sources and award categories.                  |
| `maxRequests`                                                   | Safety cap on API calls.                                                                            |

Example: new contracts in IT services in Virginia and Maryland, plus open health grants.

```json
{
    "awardCategories": ["contracts"],
    "awardsLastNDays": 14,
    "naicsCodes": ["5415"],
    "placeOfPerformanceStates": ["VA", "MD"],
    "opportunityStatuses": ["posted"],
    "fundingCategories": ["HL"],
    "maxRecords": 500
}
```

More examples are in the `examples/` folder.

### Output

One flat row per record. Fields that don't apply to a record type are `null` (or an empty list).

```json
{
    "recordKey": "award:ASST_NON_R21AG095652_075",
    "recordType": "award",
    "identifier": "R21AG095652",
    "title": "NONINVASIVE MEASUREMENT OF CEREBRAL ARTERIAL COMPLIANCE USING FAST 3D BLACK-BLOOD ...",
    "category": "grants",
    "awardType": "PROJECT GRANT (B)",
    "agency": "Department of Health and Human Services",
    "subAgency": "National Institutes of Health",
    "amount": 192500,
    "recipientName": "UNIVERSITY OF UTAH",
    "recipientUei": "LL8GLEVH6MG3",
    "recipientState": "UT",
    "placeOfPerformanceState": "UT",
    "assistanceListings": ["93.866"],
    "postedDate": "2026-09-29",
    "startDate": "2026-09-30",
    "endDate": "2029-06-30",
    "url": "https://www.usaspending.gov/award/ASST_NON_R21AG095652_075",
    "source": "USAspending.gov API"
}
```

```json
{
    "recordKey": "opportunity:364124",
    "recordType": "opportunity",
    "identifier": "DHS-26-MT-029-000-98",
    "title": "Fiscal Year 2026 Flood Mitigation Assistance",
    "status": "posted",
    "agency": "Department of Homeland Security",
    "subAgency": "Department of Homeland Security - FEMA",
    "estimatedTotalFunding": 400000000,
    "expectedNumberOfAwards": 40,
    "costSharingRequired": true,
    "eligibleApplicants": ["State governments", "County governments", "City or township governments"],
    "postedDate": "2026-10-22",
    "closeDate": "2027-02-26",
    "url": "https://www.grants.gov/search-results-detail/364124",
    "source": "Grants.gov API"
}
```

### Pricing

Pay per result: **$0.004 per saved record** ($4.00 per 1,000 records) plus **$0.01 per run start**. You pay only for rows saved to the dataset; dropped rows (individuals, duplicates) are free. Example: 1,000 records cost $4.01. A run with a $0.05 maximum cost saves up to 10 records and then stops cleanly.

### Privacy

- Awards whose recipient USAspending classifies as **individuals** or **sole proprietorships** are dropped. The check runs for every page; if it cannot run, that page is dropped rather than output unchecked.
- Rows marked by the source as individual, redacted or aggregated (for example "INDIVIDUAL RECIPIENT", "MULTIPLE RECIPIENTS", "MISCELLANEOUS FOREIGN AWARDEES", "REDACTED DUE TO PII") are dropped.
- Not output: recipient street addresses, ZIP+4, DUNS numbers, and all Grants.gov agency contact names, emails, phones and addresses.
- Description text has emails and phone numbers replaced with placeholders, and names after contact cues ("Program Officer: …", "contact …") removed. Names are found by context, so a name without such a cue can remain; business names can contain a person's name (for example a professional corporation).

### Data limits

- **No Dun & Bradstreet (D\&B) data is included.** No DUNS numbers, no recipient street addresses or ZIP+4 codes, and no awards with a first obligation date before April 4, 2022.
- **Earliest award date: 2022-04-04.** Recipient names and addresses on older federal award records can be Dun & Bradstreet data, which USAspending.gov says may not be used in bulk. From April 4, 2022 the government uses its own Unique Entity ID (UEI), so this tool returns only awards whose base obligation date is on or after that day and never outputs DUNS numbers.
- Agencies report grants to USAspending.gov with a delay of a few weeks; short windows can return few grants.
- USAspending.gov contracts usually appear within days of signing.
- Grants.gov search returns summary fields only; turn on `includeOpportunityDetails` for award sizes, eligibility and text.
- This tool reads the official public APIs only (`api.usaspending.gov`, `api.grants.gov`). It does not log in, does not use proxies, and paces its requests.

### Data source and licence

- **USAspending.gov**, U.S. Department of the Treasury, Bureau of the Fiscal Service. USAspending.gov states that its data "is available to copy, adapt, redistribute, or otherwise use for non-commercial or for commercial purposes", subject to its Dun & Bradstreet data limitation (see Data limits). Each award row links to its USAspending.gov page.
- **Grants.gov**, U.S. Department of Health and Human Services. Used under the Grants.gov API Terms of Service. This product uses the Grants.gov API but is not endorsed or certified by the U.S. Department of Health and Human Services.
- Suggested citation: USAspending.gov, U.S. Department of Treasury, Bureau of the Fiscal Service, https://www.usaspending.gov. Accessed \[date].

### FAQ

**Is this the official USAspending.gov or Grants.gov tool?** No. It is an independent tool that reads their public APIs. It is not affiliated with any US government agency.

**Do I need an API key?** No. Both APIs are public and keyless.

**Why are some awards missing?** Awards to individuals and sole proprietorships are dropped on purpose, and awards before 2022-04-04 are not returned. The run summary shows how many rows were dropped and why.

**Can I get only new records each day?** Schedule a daily run with `awardsLastNDays: 1` (or 2 to allow for late reporting) and `opportunitiesPostedLastNDays: 1`.

**Can I get awards from before 2022?** No. The Actor returns only awards whose first obligation date is on or after April 4, 2022, when the government's own Unique Entity ID replaced DUNS. No Dun & Bradstreet (D\&B) data is included.

**Does it tell me what changed since my last run?** It doesn't keep a history between runs. Use a short date window instead (`awardsLastNDays: 2`, `opportunitiesPostedLastNDays: 1`), or `awardDateType: "modified"` to catch modified awards.

**Why do I get few grants for the last week?** Agencies report grant awards to USAspending.gov a few weeks late. Contracts usually appear within days.

**Does it include SAM.gov contract opportunities?** No. This Actor covers awards and grant opportunities. For open federal contract solicitations, see our separate SAM.gov Contract Opportunities API actor on the Apify Store.

**What does it cost?** $0.01 per run plus $0.004 per saved record ($4.00 per 1,000). Dropped rows are free.

# Changelog

This Actor's version history is a separate document: https://apify.com/graylabs/federal-awards-grants/changelog.md

# Actor input Schema

## `includeAwards` (type: `boolean`):

Include federal contract, IDV and grant awards from USAspending.gov. Awards to individuals and sole proprietorships are never included.

## `includeOpportunities` (type: `boolean`):

Include posted and forecasted funding opportunities from Grants.gov.

## `awardCategories` (type: `array`):

Which USAspending award types to include. contracts = definitive contracts, purchase orders, delivery and task orders; idvs = indefinite delivery vehicles (GWACs, BPAs, IDIQs); grants = block, formula and project grants and cooperative agreements.

## `awardDateType` (type: `string`):

new = awards whose first (base) obligation falls in the window. modified = awards last changed in the window (includes modifications to older awards).

## `awardsLastNDays` (type: `integer`):

Window ending today. Ignored when you set a start date. Agencies report grants with a delay of a few weeks, so short windows can return few grants.

## `awardsStartDate` (type: `string`):

Optional, YYYY-MM-DD. Overrides "last N days". The earliest date returned is 2022-04-04 (see README).

## `awardsEndDate` (type: `string`):

Optional, YYYY-MM-DD. Defaults to today.

## `awardingAgencies` (type: `array`):

Exact top-tier agency names as shown on USAspending.gov, e.g. "Department of Energy". Leave empty for all.

## `recipientSearch` (type: `array`):

Text matched against recipient organisation names and UEIs.

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

2 to 6 digit NAICS codes, e.g. 541512. Applies to contracts and IDVs only.

## `placeOfPerformanceStates` (type: `array`):

Two-letter US state codes, e.g. CA, TX.

## `minAwardAmount` (type: `integer`):

Only awards with at least this amount (US dollars).

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

Free-text keywords. USAspending matches any of them; Grants.gov is searched once per keyword.

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

Assistance Listing (formerly CFDA) numbers such as 93.213. Filters USAspending grants and Grants.gov opportunities.

## `opportunityStatuses` (type: `array`):

Grants.gov opportunity statuses to include.

## `opportunitiesPostedLastNDays` (type: `integer`):

0 = no date limit (all opportunities with the chosen statuses, newest first).

## `grantsGovAgencyCodes` (type: `array`):

Grants.gov agency codes, e.g. HHS, HHS-NIH11, DOE, USDA-NIFA.

## `fundingCategories` (type: `array`):

Grants.gov funding activity category codes, e.g. HL (Health), ST (Science and Technology), ED (Education), AG (Agriculture).

## `eligibilityCodes` (type: `array`):

Grants.gov eligibility codes, e.g. 20 (private institutions of higher education), 23 (small businesses), 12 (nonprofits with 501(c)(3)).

## `includeOpportunityDetails` (type: `boolean`):

Adds the synopsis text, award ceiling and floor, estimated funding, expected number of awards, eligibility and funding instruments. Makes one extra request per opportunity.

## `maxRecords` (type: `integer`):

Maximum rows to save across both sources. Split evenly across the selected sources and award categories; unused room passes to the next one.

## `maxRequests` (type: `integer`):

Safety cap on API calls per run, retries included.

## Actor input object example

```json
{
  "includeAwards": true,
  "includeOpportunities": true,
  "awardCategories": [
    "contracts",
    "grants"
  ],
  "awardDateType": "new",
  "awardsLastNDays": 30,
  "awardingAgencies": [],
  "recipientSearch": [],
  "naicsCodes": [],
  "placeOfPerformanceStates": [],
  "keywords": [],
  "assistanceListings": [],
  "opportunityStatuses": [
    "posted",
    "forecasted"
  ],
  "opportunitiesPostedLastNDays": 0,
  "grantsGovAgencyCodes": [],
  "fundingCategories": [],
  "eligibilityCodes": [],
  "includeOpportunityDetails": true,
  "maxRecords": 10,
  "maxRequests": 1500
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "awardCategories": [
        "contracts",
        "grants"
    ],
    "awardsLastNDays": 30,
    "opportunityStatuses": [
        "posted",
        "forecasted"
    ],
    "maxRecords": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("graylabs/federal-awards-grants").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 = {
    "awardCategories": [
        "contracts",
        "grants",
    ],
    "awardsLastNDays": 30,
    "opportunityStatuses": [
        "posted",
        "forecasted",
    ],
    "maxRecords": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("graylabs/federal-awards-grants").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 '{
  "awardCategories": [
    "contracts",
    "grants"
  ],
  "awardsLastNDays": 30,
  "opportunityStatuses": [
    "posted",
    "forecasted"
  ],
  "maxRecords": 10
}' |
apify call graylabs/federal-awards-grants --silent --output-dataset

```

## MCP server setup

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

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/fgFsEtRch0pWPyfBm/builds/Rwn6VE6caVcBSfwPi/openapi.json
