# Grants.gov Opportunities Scraper - Federal Funding Data (`benthepythondev/grants-gov-opportunities-scraper`) Actor

Search the official Grants.gov API for posted and forecast federal funding opportunities, agencies, dates, numbers and assistance listings.

- **URL**: https://apify.com/benthepythondev/grants-gov-opportunities-scraper.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** Business, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Opportunities Scraper - Federal Funding Data

    Turn **Grants.gov Search API** into clean JSON, CSV or Excel rows without maintaining a custom integration. This Actor is designed for grant writers, nonprofits, universities, consultancies, startups and public-sector business-development teams. It uses the source's supported public feed, official API or open-data interface, keeps the default run intentionally small, and stores one normalized record per default-dataset item.

    The Actor is production-oriented rather than a demo. It includes bounded inputs, retries for transient service errors, explicit empty-result failures, a structured dataset view and source links that make each row traceable. Run it manually, call it through the Apify API, schedule it, or connect it to Make, Zapier and n8n.

    ## What this Actor returns

    Search the official Grants.gov API for posted and forecast federal funding opportunities, agencies, dates, numbers and assistance listings.

    Core output fields include:

    - `opportunity_id`
- `opportunity_number`
- `title`
- `agency_code`
- `agency`
- `open_date`
- `close_date`
- `status`
- `document_type`
- `assistance_listing_numbers`
- `opportunity_url`

    Additional source and search fields may be included when they improve traceability. Fields that are not available for a particular record are returned as `null` rather than guessed.

    ## Why use this data source?

    Grants.gov is the US government's central portal for federal grant opportunities. Its public search service exposes opportunity identifiers, agencies, status, dates and assistance listing numbers in structured JSON.

    Using the first-party interface matters. It reduces blocking and proxy cost, makes daily monitoring practical, and preserves identifiers that can be checked against the publisher. The Actor does not copy a competitor implementation or depend on a third-party resale database. It normalizes current responses from the named source.

    ## Common use cases

    ### Monitor new funding opportunities for a program area

The structured output makes this workflow repeatable: run it on demand, schedule it, or pass the rows to the next system without manually copying records. Keep the input narrow enough to produce relevant results and retain the source identifiers for verification.

#### Route matching grants to internal owners

The structured output makes this workflow repeatable: run it on demand, schedule it, or pass the rows to the next system without manually copying records. Keep the input narrow enough to produce relevant results and retain the source identifiers for verification.

#### Build a funding calendar with close dates

The structured output makes this workflow repeatable: run it on demand, schedule it, or pass the rows to the next system without manually copying records. Keep the input narrow enough to produce relevant results and retain the source identifiers for verification.

#### Analyze which agencies fund a market or technology

The structured output makes this workflow repeatable: run it on demand, schedule it, or pass the rows to the next system without manually copying records. Keep the input narrow enough to produce relevant results and retain the source identifiers for verification.

    ## Input

    | Field | Type | Description |
    | --- | --- | --- |
    | `keyword` | `string` | Keyword or phrase to search across federal funding opportunities. Default: `"climate"`. |
| `statuses` | `array` | Grants.gov statuses to include. Common values are posted, forecasted, closed and archived. Default: `["posted", "forecasted"]`. |
| `maxResults` | `integer` | Maximum number of funding opportunity rows to save. Default: `10`. |

    The default `maxResults` is deliberately low so a first run finishes quickly and produces an inexpensive proof dataset. Increase it only after confirming that your filters return the records you need.

    ### Example input

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

    ## Output and export formats

    Every matching record is pushed separately to the default Apify dataset. From the Dataset tab you can download JSON, CSV, Excel, XML, RSS or JSONL. API clients can use the dataset-items URL returned by the run object. Because the schema is stable, the output can be loaded into a database, spreadsheet, data warehouse or agent workflow without scraping log text.

    A representative row contains the source identifier, human-readable title or name, the most useful status and date fields, and a direct source URL when the publisher exposes one. The exact fields are documented above and shown in the dataset table view.

    ## How it works

    1. The Actor validates and bounds the supplied input.
    2. It calls the supported **Grants.gov Search API** interface with a descriptive request identity.
    3. Transient timeouts, rate limits and server errors are retried with backoff.
    4. Source-specific nested fields are normalized into one flat business-friendly row.
    5. Each row is written to the default dataset, where Apify automatically applies the configured pay-per-event result charge.
    6. A zero-row response fails clearly instead of reporting a misleading successful run.

    The Actor runs with limited permissions and only requests permission to write its result dataset. It does not require access to your other Actors, key-value stores or account resources.

    ## Scheduling and automation

    Create an Apify Schedule to run the Actor hourly, daily or weekly. A schedule is useful for monitoring fresh records, while a one-off run is better for research or backfills. Keep inputs in the Task rather than hard-coding them in an external workflow so they can be reviewed and changed safely.

    In Make, Zapier or n8n, use the Apify integration to run this Actor and then iterate over default-dataset items. For custom code, call `POST /v2/acts/benthepythondev~grants-gov-opportunities-scraper/runs`, poll the run to a terminal state, and fetch items from the run's default dataset. Never place an Apify token in a public frontend.

    ## Pricing

    This Actor uses transparent pay-per-event pricing: `$0.00005` when a run starts and `$0.0030` for each record written to the default dataset. A run that returns 100 records therefore has a result charge of about `$0.30`, plus the small start event and normal Apify platform usage. The input limit controls both dataset size and result-event spend.

    ## Data quality and responsible use

    Search results are discovery records and may omit full eligibility, award ceiling or attachment details. Always open the official opportunity page and read the complete notice before preparing an application.

    Public does not mean context-free. Preserve attribution and source URLs, respect intellectual-property and privacy obligations, and do not use the data for prohibited discrimination, harassment or unsolicited bulk messaging. If a record drives a legal, financial, safety or compliance decision, verify it with the authoritative publisher and a qualified professional.

    The upstream service can add fields, revise records, enforce quotas or experience downtime. The Actor retries transient failures, but it cannot guarantee that the source is always available or that every upstream record is complete. Scheduled users should monitor failed runs and retain the source ID so changed rows can be reconciled.

    ## FAQ

    ### Do I need an account or API key?

    The default workflow uses a public, supported interface and does not require a user login. If the publisher changes its access policy in the future, the Actor will fail clearly rather than collecting data through an unrelated account.

    ### Can I export the results to CSV or Excel?

    Yes. Open the default dataset after a run and select the desired download format. JSON and JSONL are best for code, while CSV and Excel are convenient for review and enrichment.

    ### Can I run it on a schedule?

    Yes. Save a Task with the filters you want, then attach an Apify Schedule. Start with a daily run and adjust only after observing result volume, change frequency and cost.

    ### How are duplicates handled?

    The Actor returns records supplied by the source for the requested query. Where the source exposes stable identifiers, those identifiers are included so downstream systems can upsert instead of append. Some sources intentionally publish several rows for one broader case or process; the README limitations explain those situations.

    ### Why did my run return no rows?

    A filter may be too narrow, a date range may have no current records, or the source may be temporarily unavailable. Review the Actor log, broaden one filter at a time and keep `maxResults` small while testing.

    ### Is this an official product of the source publisher?

    No. This is an independent Apify Actor that reads a public interface and links back to the authoritative source. Source names are used only to describe compatibility.

    ### How do I get support?

    Open an issue on the Actor page with the run ID, a redacted input example and the field you expected. Do not post API tokens, personal credentials or private feed URLs in a public issue.

    ## You might also like

    - [federal-register-scraper](https://apify.com/benthepythondev/federal-register-scraper)
- [usaspending-contracts-intelligence](https://apify.com/benthepythondev/usaspending-contracts-intelligence)
- [world-bank-indicators-scraper](https://apify.com/benthepythondev/world-bank-indicators-scraper)

    If the Actor produced a useful dataset, please leave a short Apify Store review. Reviews help prioritize maintenance and show other users which workflows are working in production.

    **Keywords:** grants gov opportunities scraper, grants.gov search api, data API, public data scraper, Apify Actor, automation, structured dataset, JSON export, CSV export, scheduled monitoring, market research, business intelligence.

# Actor input Schema

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

Keyword or phrase to search across federal funding opportunities.
## `statuses` (type: `array`):

Grants.gov statuses to include. Common values are posted, forecasted, closed and archived.
## `maxResults` (type: `integer`):

Maximum number of funding opportunity rows to save.

## Actor input object example

```json
{
  "keyword": "artificial intelligence",
  "statuses": [
    "posted",
    "forecasted"
  ],
  "maxResults": 10
}
````

# 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": "artificial intelligence",
    "statuses": [
        "posted",
        "forecasted"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/grants-gov-opportunities-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": "artificial intelligence",
    "statuses": [
        "posted",
        "forecasted",
    ],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/grants-gov-opportunities-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "artificial intelligence",
  "statuses": [
    "posted",
    "forecasted"
  ],
  "maxResults": 10
}' |
apify call benthepythondev/grants-gov-opportunities-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=benthepythondev/grants-gov-opportunities-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Grants.gov Opportunities Scraper - Federal Funding Data",
        "description": "Search the official Grants.gov API for posted and forecast federal funding opportunities, agencies, dates, numbers and assistance listings.",
        "version": "1.0",
        "x-build-id": "vDfomAkfth8iie71W"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/benthepythondev~grants-gov-opportunities-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-benthepythondev-grants-gov-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/benthepythondev~grants-gov-opportunities-scraper/runs": {
            "post": {
                "operationId": "runs-sync-benthepythondev-grants-gov-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/benthepythondev~grants-gov-opportunities-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-benthepythondev-grants-gov-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "keyword": {
                        "title": "Funding keyword",
                        "type": "string",
                        "description": "Keyword or phrase to search across federal funding opportunities.",
                        "default": "climate"
                    },
                    "statuses": {
                        "title": "Opportunity statuses",
                        "type": "array",
                        "description": "Grants.gov statuses to include. Common values are posted, forecasted, closed and archived.",
                        "default": [
                            "posted",
                            "forecasted"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max opportunities",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of funding opportunity rows to save.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
