# US Federal Grants Aggregator (Grants.gov) (`preservable_mocha/us-federal-grants-aggregator`) Actor

Search Grants.gov and get clean, unified JSON: agency, status, open/close dates, CFDA codes, links. Keyless official open data.

- **URL**: https://apify.com/preservable\_mocha/us-federal-grants-aggregator.md
- **Developed by:** [Onur Hadzhaoglu](https://apify.com/preservable_mocha) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## US Federal Grants Aggregator (Grants.gov)

Search **Grants.gov** — the official U.S. federal grants portal — and get back
**clean, unified JSON**: funding agency, opportunity status, open/close dates,
CFDA program codes and a direct link. Filter by keyword, status and CFDA number.

No API key, no scraping. The Grants.gov Search2 API is official, public and keyless.
This actor normalizes the response into one predictable, flat record per opportunity.

### What you get — one record per opportunity

```json
{
  "opportunityId": "279638",
  "opportunityNumber": "RDBCP-REAP-RES-EEI-2016",
  "title": "Renewable Energy Systems and Energy Efficiency Improvements Program",
  "agency": "Rural Business-Cooperative Service",
  "agencyCode": "USDA-RBCS",
  "status": "posted",
  "openDate": "10/13/2015",
  "closeDate": "",
  "cfdaList": ["10.868"],
  "grantUrl": "https://www.grants.gov/search-results-detail/279638",
  "source": "Grants.gov"
}
```

### Input

| Field | Type | Example | Meaning |
|-------|------|---------|---------|
| `keyword` | string | `"mental health"` | Free-text search. |
| `statuses` | list | `["posted"]` | Status filter. Empty = posted (open). |
| `cfda` | string | `"93.243"` | Optional CFDA program number. |
| `maxResults` | int | `50` | Max opportunities (1–100). |

### Who this is for

- **Grant writers & consultants** tracking new funding by topic.
- **Nonprofits & universities** monitoring relevant programs.
- **Researchers** watching agency and CFDA activity.
- **GovTech / funding-intelligence** products needing clean data.

### Pricing

Billed per returned opportunity (pay-per-event). Set your price in the Apify Console.

### Legal

Uses only the **official, public** Grants.gov Search2 API. No login-gated data.

### Developer notes

The fetch + normalize core is in `src/grants_source.py` with **no Apify SDK dependency**:

```bash
python -m src.grants_source
```

### Who uses this

- **Grant writers & consultants** — daily feed of newly posted opportunities in your keywords, straight to Sheets or email.
- **University research offices** — monitor federal funding in specific programs (CFDA) without portal logins.
- **Nonprofits** — never miss an open opportunity in your field.
- **GovTech products** — power a grants-discovery feature with clean JSON.

### Pricing — pay only for what you get

This actor uses Apify's **pay-per-event** model: you pay **$3 per 1,000 results** (plus a negligible $0.00005 per start). No subscription, no minimum.

Concretely: a daily 50-opportunity sweep costs about **$0.15/day** — one found grant pays for decades of runs.

Tip: start with `maxResults: 10` to see the data shape for ~$0.03, then scale up.

### Quick start

1. Click **Try for free** (Apify gives new accounts free usage credit).
2. Adjust the input (defaults already work) and press **Start**.
3. When the run finishes, open the **Dataset** tab and export as JSON, CSV or Excel — or fetch it via the Apify API on a schedule.

### Support

Found an issue or need an extra field / another data source? Open an issue on the actor's **Issues** tab — I actively maintain this actor and usually respond within a day.

# Actor input Schema

## `keyword` (type: `string`):

Free-text search, e.g. 'renewable energy', 'mental health'. Leave empty for all.

## `statuses` (type: `array`):

Filter by status. Empty = posted (currently open).

## `cfda` (type: `string`):

Optional CFDA program number filter, e.g. '10.868'.

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

Maximum number of opportunities to return (1-100).

## Actor input object example

```json
{
  "keyword": "renewable energy",
  "statuses": [
    "posted"
  ],
  "maxResults": 50
}
```

# Actor output Schema

## `opportunities` (type: `string`):

All matched grant opportunities as JSON items in the default dataset.

# 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 = {
    "keyword": "renewable energy",
    "statuses": [
        "posted"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("preservable_mocha/us-federal-grants-aggregator").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 = {
    "keyword": "renewable energy",
    "statuses": ["posted"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("preservable_mocha/us-federal-grants-aggregator").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 '{
  "keyword": "renewable energy",
  "statuses": [
    "posted"
  ],
  "maxResults": 50
}' |
apify call preservable_mocha/us-federal-grants-aggregator --silent --output-dataset

```

## MCP server setup

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

```

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/5g2qSUJcQnwoXaJ5F/builds/uzFKA3njXCFLYHTqe/openapi.json
