# Grants.gov Opportunity Monitor (`ai-coding-radar/grants-gov-opportunity-monitor`) Actor

Monitor official Grants.gov opportunities by keyword, agency, eligibility, status, and funding category. Get new and changed records without duplicate results. Uses the public Grants.gov API; always verify eligibility on Grants.gov.

- **URL**: https://apify.com/ai-coding-radar/grants-gov-opportunity-monitor.md
- **Developed by:** [AI Coding Radar](https://apify.com/ai-coding-radar) (community)
- **Categories:** Automation, News, Open source
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.50 / 1,000 grant opportunities

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/platform/actors/running/actors-in-store#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

## Grants.gov Opportunity Monitor API

Search active U.S. federal grant opportunities through the official public
Grants.gov API, then emit only opportunities that are new or changed since the
previous run. The Actor needs no Grants.gov account, API key, login, cookie,
proxy, or browser automation.

- [Run the Actor on Apify](https://apify.com/ai-coding-radar/grants-gov-opportunity-monitor)
- Official source: [Grants.gov API Guide](https://www.grants.gov/api/api-guide)

Ready-made public examples:

- [Daily small-business federal grant alerts](https://apify.com/ai-coding-radar/grants-gov-opportunity-monitor/examples/daily-small-business-federal-grant-alerts)
- [Daily nonprofit federal grant alerts](https://apify.com/ai-coding-radar/grants-gov-opportunity-monitor/examples/daily-nonprofit-federal-grant-alerts)

This is a factual search and change feed. It does not decide whether an
organization is eligible, recommend an application, estimate the chance of an
award, or promise funding.

### Input

```json
{
  "keyword": "artificial intelligence",
  "statuses": ["posted", "forecasted"],
  "agencyCodes": [],
  "eligibilityCodes": [],
  "fundingCategoryCodes": [],
  "limit": 25,
  "monitorId": "ai-grants"
}
```

Use Grants.gov agency codes such as `NSF` or `HHS-NIH11`. Applicant eligibility
codes are the two-digit values returned by Grants.gov; for example, `23` is the
small-business code. Keep one stable `monitorId` for one exact set of filters.
Changing the query under the same ID fails before a source request so unrelated
searches cannot share a baseline.

### Monitoring semantics

1. The first run stores the current results and emits each one as `new`.
2. Later runs emit a `new` row for an unseen opportunity and one `changed` row
   when a watched summary field changes.
3. Unchanged opportunities create no dataset row and no result event charge.
4. Opportunities that leave the top result window are not called removed or
   closed; absence from a limited search is not proof of a status change.
5. Reuse the same `monitorId` in an Apify Task scheduled daily or weekly.

The watched facts are opportunity number, title, agency, open and close dates,
status, document type, and CFDA numbers. Every row links to the official
Grants.gov detail page and includes the local observation time. Search titles
and agency names are untrusted source text; the Actor does not send them to an
AI model or execute their contents.

### Copy-paste REST quickstart

Keep your Apify token in an environment variable and send it in a header:

```sh
curl -X POST \
  'https://api.apify.com/v2/actors/ai-coding-radar~grants-gov-opportunity-monitor/run-sync-get-dataset-items?clean=1' \
  -H "Authorization: Bearer $APIFY_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"keyword":"artificial intelligence","statuses":["posted","forecasted"],"limit":25,"monitorId":"ai-grants"}'
```

The generated API client's empty `{}` input is also safe: it uses the same
bounded `artificial intelligence`, `posted` plus `forecasted`, 25-result query
shown in the Store schema. Set a unique `monitorId` for every real alert.

The Grants.gov `search2` response includes service metadata that the Actor does
not persist or expose. It does not call the detail or attachment endpoints, so
it avoids downloading long descriptions, contact records, or application
files that are not needed for a change alert.

### No-code automation

Import the ready-made [n8n daily monitoring workflow](https://github.com/Jarvis-Dong/grants-gov-opportunity-monitor/blob/main/examples/n8n-grants-gov-monitor.json)
and follow the [n8n and Make setup recipe](https://github.com/Jarvis-Dong/grants-gov-opportunity-monitor/blob/main/examples/README.md).
The example uses a stable `monitorId` (`n8n-ai-grants`) and `limit: 10`. At the
current published event prices, even ten changed rows cost at most
`10 * $0.015 + $0.00005 = $0.15005` before tax or account-level charges. The
workflow does not run the Actor until you manually execute or activate it with
your own Apify token.
Connect its final node to a Slack, email, database, or private webhook that you
control. Do not put tokens or delivery credentials in the exported JSON.

### Pay-per-event setup

Suggested launch prices are explicit and only successful result events are
charged:

| Event | Meaning | Suggested price |
| --- | --- | ---: |
| `apify-actor-start` | One Actor start | `$0.00005` |
| `grant-opportunity` | One newly observed opportunity | `$0.0075` |
| `grant-change` | One previously observed opportunity whose summary changed | `$0.015` |

Source failures, invalid input, unchanged results, and total search hit counts
are not charged as opportunity or change events. Prices are configured in the
Apify publication wizard; this repository does not claim revenue.

### Source and boundaries

- Uses only `POST https://api.grants.gov/v1/api/search2`.
- Grants.gov documents `search2` as unrestricted and requiring no authentication.
- Does not download attachments or full opportunity descriptions.
- Does not apply, send messages, rank applicants, infer eligibility, or provide
  financial, legal, or grant-writing advice.
- Preserves source status and dates instead of treating an unavailable source
  as an unchanged monitor.

### Local checks

```sh
python3 -m unittest discover -s tests -v
python3 -m compileall -q grants_gov_opportunity_monitor
npx --yes apify-cli validate-schema
python3 -m grants_gov_opportunity_monitor.main --fixture tests/fixtures/search.json
```

# Actor input Schema

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

A Grants.gov keyword or phrase such as artificial intelligence, small business, health, or nonprofit.

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

Search current posted opportunities, forecasts, or both.

## `agencyCodes` (type: `array`):

Optional Grants.gov agency codes such as NSF or HHS-NIH11.

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

Optional two-digit Grants.gov applicant eligibility codes, for example 23 for small businesses.

## `fundingCategoryCodes` (type: `array`):

Optional Grants.gov funding activity category codes.

## `limit` (type: `integer`):

Maximum number of current search results to compare with the monitor baseline.

## `monitorId` (type: `string`):

A stable ID for this exact query. Reuse it on scheduled runs; use a new ID when filters change.

## Actor input object example

```json
{
  "keyword": "artificial intelligence",
  "statuses": [
    "posted",
    "forecasted"
  ],
  "limit": 25,
  "monitorId": "default"
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ai-coding-radar/grants-gov-opportunity-monitor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("ai-coding-radar/grants-gov-opportunity-monitor").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 '{}' |
apify call ai-coding-radar/grants-gov-opportunity-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ai-coding-radar/grants-gov-opportunity-monitor"
        }
    }
}

```

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/Qqlebaz7DBKhhAnrk/builds/QXwocqi02yzTgFqON/openapi.json
