# Grants.gov Finder (`publicrecords/grants-gov-scraper`) Actor

Grants.gov Finder — federal grant opportunities from the official Grants.gov search2 API. Keyword, agency, posted-within & date filters → flat FOA JSON.

- **URL**: https://apify.com/publicrecords/grants-gov-scraper.md
- **Developed by:** [Marc M](https://apify.com/publicrecords) (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 $4.00 / 1,000 result 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

## Grants.gov Opportunities Scraper

### What does Grants.gov Opportunities Scraper do?

**Grants.gov Opportunities Scraper** searches **U.S. federal funding opportunities** on [Grants.gov](https://www.grants.gov) using the official public **`search2`** API and returns **flat FOA rows** (opportunity number, agency, open/close dates, ALN/CFDA, detail URL).

Built for **nonprofits, universities, grant writers, and consultants** who want structured opportunity monitors without browser automation.

> This product uses the Grants.gov API but is **not endorsed or certified** by the U.S. Department of Health and Human Services.

#### Why this Actor?

- 🇺🇸 **Official Grants.gov API** — `POST api.grants.gov/v1/api/search2` (no key)
- 📅 **Real posted-date lookback** — `postedWithinDays` → API `dateRange` (7/28/90/365…)
- 🎯 **Open/close date filters** — client-side when you need custom windows
- 🔁 **Deduped** by `opportunityId`
- 📄 **Optional detail hydrate** — `fetchOpportunity` synopsis still **one** charge per opportunity
- 💵 **$0.004 per successful opportunity**. **Error rows are not charged.**

#### What data can you extract?

| Field | Description |
|-------|-------------|
| `opportunityId`, `opportunityNumber` | Grants.gov IDs |
| `title`, `agencyCode`, `agencyName` | Opportunity + agency |
| `openDate`, `closeDate`, `oppStatus`, `docType` | Timing & status |
| `aln` | CFDA / ALN list (pipe-joined) |
| `detailUrl` | Human Grants.gov detail page |
| Optional | `synopsis`, funding instrument, cost sharing (when `fetchDetails`) |

***

### How to scrape Grants.gov opportunities

1. Open **Grants.gov Opportunities Scraper**.
2. Enter a **Keyword** (e.g. `education`) and/or **Agency** (e.g. `NSF`, `EPA`, `HHS`).
3. Set **Status** (`posted`, `forecasted`, etc.).
4. Optionally set **Posted within N days** (server-side) and/or open/close date filters.
5. Set **Max items**; toggle **Fetch details** only if you need synopsis text.
6. Run and export.

***

### Input

| Field | Required | Default | Description |
|-------|----------|---------|-------------|
| `keyword` | no | `""` | Search keyword |
| `agency` | no | `""` | → API `agencies` |
| `status` | no | `forecasted\|posted` | → `oppStatuses` |
| `postedWithinDays` | no | — | → `dateRange` lookback days |
| `openDateFrom` / `openDateTo` | no | — | Client-side on `openDate` |
| `closeDateFrom` / `closeDateTo` | no | — | Client-side on `closeDate` |
| `maxItems` | no | `50` | Cap (deduped) |
| `fetchDetails` | no | `false` | Hydrate via `fetchOpportunity` |

#### Example input

```json
{
  "keyword": "climate",
  "agency": "EPA",
  "status": "posted",
  "postedWithinDays": 90,
  "maxItems": 50
}
```

#### Canary-style input

```json
{
  "keyword": "education",
  "status": "posted",
  "maxItems": 5
}
```

***

### Billing note

Only default-dataset **success** opportunities are charged. **Error rows are not charged** (named `errors` dataset / logs).

### Sample output

```json
{
  "recordType": "opportunity",
  "opportunityId": "334326",
  "opportunityNumber": "21-595",
  "title": "Tribal Colleges and Universities Program (TCUP)",
  "agencyCode": "NSF",
  "agencyName": "U.S. National Science Foundation",
  "openDate": "06/24/2021",
  "closeDate": "10/14/2026",
  "oppStatus": "posted",
  "docType": "synopsis",
  "aln": "47.076",
  "detailUrl": "https://www.grants.gov/search-results-detail/334326"
}
```

***

### How much does it cost?

| Event | Price |
|-------|-------|
| Actor start | ~$0.00005 |
| Dataset item (**successful** opportunity only) | **$0.004** |
| Error / diagnostic rows | **Not charged** |

| Run | Approx. cost |
|-----|----------------|
| 1 start + 50 opportunities | ≈ **$0.20** |
| 1 start + 500 opportunities | ≈ **$2.00** |

`fetchDetails=true` does **not** double-bill (still one item per opportunity). Mark-approved prices from `PPE_PRICING.md`. **Error rows are not charged.**

***

### Use cases

- 🎓 **University / research admin** — FOA monitors by agency
- 🤝 **Grant consultants** — keyword pipelines into CRM
- 🏘 **Nonprofits** — posted + forecasted opportunity watches
- 🤖 **Agents** — scheduled pulls + webhooks

***

### Limitations

- Public **FOA metadata** only — no applicant workspace / submissions
- Not **Simpler Grants** (`api.simpler.grants.gov`) — production `api.grants.gov` only
- Custom open/close ranges are **client-side** (API ignores custom MM/DD pipes)
- Response `token` / `accessKey` are ignored and never persisted
- Do not harvest PI personal emails from attachments

***

### Legal & attribution

**Required notice (Grants.gov API Terms):**

> This product uses the Grants.gov API but is not endorsed or certified by the U.S. Department of Health and Human Services.

- Terms: https://grants.gov/api/terms-conditions
- API guide: https://www.grants.gov/api/api-guide
- You may identify Grants.gov as the source; do not imply HHS endorsement

***

### FAQ

#### Do I need an API key?

No for `search2` / public `fetchOpportunity` used here.

#### Posted within vs open/close dates?

`postedWithinDays` is a **server** lookback on posted date. Open/close fields filter after fetch.

#### Forecasted vs posted?

Use `status` — e.g. `posted` or `forecasted|posted`.

***

### SEO keywords

grants.gov scraper, grants.gov api, federal grant opportunities, FOA scraper, NSF EPA HHS grants, grant opportunity monitor, CFDA ALN scraper, federal funding opportunities

# Actor input Schema

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

Search keyword (e.g. education, cybersecurity). Leave empty for all.

## `agency` (type: `string`):

Mapped to API body agencies (e.g. HHS, EPA, NSF).

## `status` (type: `string`):

Mapped to API oppStatuses. Use forecasted|posted|closed|archived or pipe-joined.

## `postedWithinDays` (type: `integer`):

Server-side filter mapped to search2 dateRange (posted-date lookback). Verified values: 3,7,14,21,28,35,42,49,56,90,180,365. Omit for no posted-date filter.

## `openDateFrom` (type: `string`):

Client-side filter on openDate. Accepts MM/DD/YYYY or YYYY-MM-DD. Inclusive.

## `openDateTo` (type: `string`):

Client-side filter on openDate. Inclusive.

## `closeDateFrom` (type: `string`):

Client-side filter on closeDate. Inclusive. Useful for 'still open' windows.

## `closeDateTo` (type: `string`):

Client-side filter on closeDate. Inclusive.

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

Cap on opportunity rows (deduped by opportunityId).

## `fetchDetails` (type: `boolean`):

Hydrate synopsis via fetchOpportunity. Still one PPE charge per opportunity.

## Actor input object example

```json
{
  "keyword": "",
  "agency": "",
  "status": "posted",
  "maxItems": 50,
  "fetchDetails": 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 = {
    "keyword": "",
    "status": "posted"
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords/grants-gov-scraper").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": "",
    "status": "posted",
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords/grants-gov-scraper").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": "",
  "status": "posted"
}' |
apify call publicrecords/grants-gov-scraper --silent --output-dataset

```

## MCP server setup

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

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/gt17rxLQFknDcdFIN/builds/yW3hJnZrpxGftLuR4/openapi.json
