# Grants.gov Scraper 💰 (`shahidirfan/grants-gov-scraper`) Actor

Extract federal grant opportunities from Grants.gov with funding details, agencies, eligibility, deadlines, award amounts, opportunity numbers, and application links. Ideal for grant research, funding discovery, nonprofit intelligence, and government opportunity tracking.

- **URL**: https://apify.com/shahidirfan/grants-gov-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

### What does Grants.gov Scraper do?

Grants.gov Scraper collects public U.S. government funding opportunities from Simpler.Grants.gov and saves them as clean records in an Apify dataset. Enter a keyword, browse without a keyword, or combine a search with filters for status, agency, category, eligibility, funding type, dates, and cost sharing.

The results are useful for grant research, funding alerts, nonprofit planning, public-sector analysis, proposal preparation, and data workflows. Each opportunity includes its public source URL so important deadlines and eligibility details can be checked before taking action.

### Why use Grants.gov Scraper?

- **Find relevant funding faster** - Search opportunities by topic, phrase, agency, or assistance listing number.
- **Keep research organized** - Save consistent opportunity records instead of copying information manually.
- **Track time-sensitive opportunities** - Filter recently posted grants or sort by closing date.
- **Support funding analysis** - Compare award ranges, agencies, categories, applicant types, and fiscal years.
- **Automate repeat research** - Schedule runs in Apify and connect the dataset to downstream workflows.
- **Get clean output** - Empty values are omitted from each record instead of being stored as `null` or blank properties.

### What data can you extract from Simpler.Grants.gov?

| Field                               | Description                                              |
| ----------------------------------- | -------------------------------------------------------- |
| `opportunity_id`                    | Stable identifier for the opportunity.                   |
| `opportunity_number`                | Public opportunity number.                               |
| `opportunity_title`                 | Name of the funding opportunity.                         |
| `opportunity_status`                | Status such as posted, forecasted, closed, or archived.  |
| `agency_code`                       | Funding agency code.                                     |
| `agency_name`                       | Funding agency name.                                     |
| `top_level_agency_name`             | Top-level agency name when available.                    |
| `category`                          | Primary funding category.                                |
| `category_explanation`              | Explanation of the funding category.                     |
| `funding_instruments`               | Funding type, such as grant or cooperative agreement.    |
| `funding_categories`                | Funding category values associated with the opportunity. |
| `post_date`                         | Date the opportunity was posted.                         |
| `close_date`                        | Closing date when available.                             |
| `archive_date`                      | Archive date when available.                             |
| `forecasted_post_date`              | Expected posting date for forecasted opportunities.      |
| `forecasted_close_date`             | Expected closing date for forecasted opportunities.      |
| `forecasted_award_date`             | Expected award date when available.                      |
| `forecasted_project_start_date`     | Expected project start date when available.              |
| `is_cost_sharing`                   | Whether cost sharing is required.                        |
| `expected_number_of_awards`         | Expected number of awards.                               |
| `estimated_total_program_funding`   | Estimated total funding for the opportunity.             |
| `award_floor`                       | Minimum expected award amount.                           |
| `award_ceiling`                     | Maximum expected award amount.                           |
| `applicant_types`                   | Eligible applicant types.                                |
| `applicant_eligibility_description` | Applicant eligibility details.                           |
| `opportunity_assistance_listings`   | Related assistance listing numbers.                      |
| `agency_contact_description`        | Agency contact information.                              |
| `agency_email_address`              | Agency contact email address.                            |
| `fiscal_year`                       | Fiscal year associated with the opportunity.             |
| `summary_description`               | Opportunity summary.                                     |
| `additional_info_url`               | Additional information link.                             |
| `url`                               | Public opportunity page URL.                             |

Fields that are unavailable for a particular opportunity are omitted from that record.

### How to use Grants.gov Scraper

1. Open the Actor in Apify Console.
2. Enter a keyword, or leave `keyword` empty to browse opportunities.
3. Add optional filters and choose the sort field and order.
4. Set `results_wanted` and `max_pages` for the run.
5. Start the Actor and open the default dataset when the run completes.
6. Export the records or connect the dataset to your workflow.

### Input Parameters

All parameters are optional. When `filters.status` is omitted, posted and forecasted opportunities are searched by default.

| Parameter            | Type    | Required | Default                      | Description                                                                                  |
| -------------------- | ------- | -------- | ---------------------------- | -------------------------------------------------------------------------------------------- |
| `keyword`            | String  | No       | Empty                        | Search words or a phrase. Leave empty to browse.                                             |
| `query_operator`     | String  | No       | `OR`                         | Use `OR` to match any keyword term or `AND` to match every term.                             |
| `filters`            | Object  | No       | Posted and forecasted status | Optional structured filters listed below.                                                    |
| `sort_by`            | String  | No       | `relevancy`                  | `relevancy`, `closeDate`, `postedDate`, `opportunityTitle`, `awardFloor`, or `awardCeiling`. |
| `sort_order`         | String  | No       | `desc`                       | Sort direction: `asc` or `desc`.                                                             |
| `results_wanted`     | Integer | No       | `20`                         | Number of unique opportunities to save.                                                      |
| `max_pages`          | Integer | No       | `5`                          | Number of result pages to request at most.                                                   |
| `proxyConfiguration` | Object  | No       | Disabled                     | Optional Apify Proxy settings.                                                               |

The `filters` object supports the following fields:

| Filter                    | Accepted values                                                      |
| ------------------------- | -------------------------------------------------------------------- |
| `status`                  | `forecasted`, `posted`, `closed`, or `archived`                      |
| `fundingInstrument`       | `cooperative_agreement`, `grant`, `procurement_contract`, or `other` |
| `eligibility`             | Applicant eligibility values                                         |
| `agency`                  | Agency codes such as `NASA-HQ`, `NSF`, or `DOC`                      |
| `category`                | Values such as `environment`, `education`, `health`, or `energy`     |
| `closeDate`               | Relative day window such as `7`, `30`, `90`, or `120`                |
| `postedDate`              | Relative day window such as `3`, `7`, `14`, `30`, or `60`            |
| `costSharing`             | `true` or `false`                                                    |
| `topLevelAgency`          | Top-level agency values                                              |
| `assistanceListingNumber` | Assistance listing numbers                                           |

Multi-value filters accept arrays, for example `"status": ["posted", "forecasted"]`.

### Output Data

The Actor saves one dataset item per unique funding opportunity. Common output fields are listed below.

| Field                             | Type    | Description                    |
| --------------------------------- | ------- | ------------------------------ |
| `opportunity_id`                  | String  | Stable opportunity identifier. |
| `opportunity_number`              | String  | Public opportunity number.     |
| `opportunity_title`               | String  | Opportunity title.             |
| `opportunity_status`              | String  | Current opportunity status.    |
| `agency_name`                     | String  | Funding agency name.           |
| `category`                        | String  | Primary funding category.      |
| `post_date`                       | String  | Posting date.                  |
| `close_date`                      | String  | Closing date when available.   |
| `is_cost_sharing`                 | Boolean | Cost-sharing requirement.      |
| `expected_number_of_awards`       | Number  | Expected award count.          |
| `estimated_total_program_funding` | Number  | Estimated total funding.       |
| `award_floor`                     | Number  | Minimum award amount.          |
| `award_ceiling`                   | Number  | Maximum award amount.          |
| `applicant_types`                 | String  | Eligible applicant types.      |
| `summary_description`             | String  | Opportunity summary.           |
| `additional_info_url`             | String  | Additional information URL.    |
| `url`                             | String  | Public opportunity URL.        |

### Usage Examples

#### Basic keyword search

Use a keyword to find relevant opportunities with the default status filter.

```json
{
    "keyword": "climate",
    "results_wanted": 20,
    "max_pages": 3
}
```

#### Narrow search with category and date filters

Combine an exact keyword match with education and recently posted filters.

```json
{
    "keyword": "education technology",
    "query_operator": "AND",
    "filters": {
        "status": ["posted"],
        "category": ["education"],
        "postedDate": "30"
    },
    "sort_by": "postedDate",
    "sort_order": "desc",
    "results_wanted": 50,
    "max_pages": 5
}
```

#### Find grants closing soon

Sort ascending by closing date to review urgent opportunities first.

```json
{
    "keyword": "water quality",
    "filters": {
        "status": ["posted"],
        "category": ["environment"],
        "fundingInstrument": ["grant"],
        "closeDate": "30",
        "costSharing": false
    },
    "sort_by": "closeDate",
    "sort_order": "asc",
    "results_wanted": 25,
    "max_pages": 4
}
```

#### Browse opportunities from one agency

Leave out the keyword and use an agency filter to browse its available opportunities.

```json
{
    "filters": {
        "status": ["posted", "forecasted"],
        "agency": ["NSF"]
    },
    "sort_by": "opportunityTitle",
    "sort_order": "asc",
    "results_wanted": 20,
    "max_pages": 2
}
```

### Sample Output

The exact fields vary by opportunity. A populated dataset item may look like this:

```json
{
    "opportunity_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "opportunity_number": "NSF-25-001",
    "opportunity_title": "Climate Research and Education Initiative",
    "opportunity_status": "posted",
    "agency_code": "NSF",
    "agency_name": "National Science Foundation",
    "top_level_agency_name": "National Science Foundation",
    "category": "environment",
    "post_date": "2025-01-15",
    "close_date": "2025-04-30",
    "is_cost_sharing": false,
    "expected_number_of_awards": 12,
    "estimated_total_program_funding": 6000000,
    "award_floor": 100000,
    "award_ceiling": 500000,
    "funding_instruments": "Grant",
    "funding_categories": "Environment",
    "applicant_types": "Local governments",
    "is_forecast": false,
    "fiscal_year": 2025,
    "url": "https://simpler.grants.gov/opportunity/NSF-25-001",
    "summary_description": "Supports research and education projects addressing climate resilience."
}
```

### Tips for Best Results

- Begin with a small `results_wanted` value while testing a search.
- Use `query_operator: "AND"` when a search with several terms is too broad.
- Add a `status` filter when you only want currently posted or forecasted opportunities.
- Combine `postedDate` or `closeDate` with the matching date sort for time-sensitive research.
- Use agency, category, eligibility, or assistance listing filters to keep broad searches focused.
- Review the public opportunity page before relying on a deadline, eligibility rule, or award amount.
- Schedule recurring runs when you need regular funding updates.

### Integrations

Apify datasets can be downloaded or connected to other services:

- **Google Sheets** - Review and share grant research in a spreadsheet.
- **CSV, Excel, JSON, and XML exports** - Use the format that fits your analysis tool.
- **Webhooks** - Trigger a workflow after a run completes.
- **Make or Zapier** - Send new results to notifications, databases, or internal tools.
- **Apify API** - Retrieve dataset items from your own application.
- **Slack and email workflows** - Notify a team when a scheduled run finds relevant records.

### Frequently Asked Questions

#### Do I need a Grants.gov API key?

No. The Actor does not ask for a Grants.gov API key.

#### Can I search without a keyword?

Yes. Leave `keyword` empty and use filters such as agency, category, status, or assistance listing number.

#### Can I search for only posted opportunities?

Yes. Set `filters.status` to `["posted"]`. You can also search forecasted opportunities with `["forecasted"]`.

#### Why are some fields missing from an item?

Grant notices do not all publish the same information. When a value is unavailable, the field is omitted instead of being returned as `null` or an empty string.

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

Yes. Apify datasets support CSV, Excel, JSON, XML, and other export formats.

#### Can I run the Actor on a schedule?

Yes. Create a schedule in Apify Console to run it hourly, daily, weekly, or on another interval.

#### Can I use a proxy?

Yes. Configure `proxyConfiguration` when you want to route requests through Apify Proxy. It is optional for normal searches.

#### How many records can I collect?

Set `results_wanted` to the number of unique opportunities you want and use `max_pages` to control pagination. The Actor stops when a requested limit is reached or when no new records are available.

### Related Actors

- [NGOBase Scraper](https://apify.com/shahidirfan/ngobase-scraper) - Collect NGO, nonprofit, charity, and humanitarian organization data for grant prospecting and partnership research.
- [NGOBase Grants & Funders Scraper](https://apify.com/shahidirfan/ngobase-grants-funders-scraper) - Find grantmakers, funding agencies, eligibility criteria, deadlines, and funding requirements from NGOBase.

### Support

If you find a source-data issue or need an input option that is not currently available, use the Issues tab on the Actor page and include a reproducible search configuration.

### Legal Notice

This Actor is an independent tool for working with publicly available grant information. Use it responsibly, respect Simpler.Grants.gov and Grants.gov terms, follow applicable laws, avoid excessive request rates, and verify important deadlines and eligibility requirements on the official opportunity page. The Actor is not affiliated with or endorsed by Grants.gov, Simpler.Grants.gov, or any government agency.

# Actor input Schema

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

Words or phrases to search in grant opportunities. Leave empty to browse opportunities.

## `query_operator` (type: `string`):

How multiple keyword terms should be combined.

## `filters` (type: `object`):

Optional filters. Values may be a string or an array of strings. Status defaults to forecasted and posted when it is omitted.

## `sort_by` (type: `string`):

The opportunity field used for sorting.

## `sort_order` (type: `string`):

Ascending or descending order for the selected sort field.

## `results_wanted` (type: `integer`):

Maximum number of unique grant opportunities to save.

## `max_pages` (type: `integer`):

Maximum number of export pages to request.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy settings. A proxy is useful for high-volume or repeated runs.

## Actor input object example

```json
{
  "keyword": "climate",
  "query_operator": "OR",
  "sort_by": "relevancy",
  "sort_order": "desc",
  "results_wanted": 20,
  "max_pages": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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": "climate"
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/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": "climate" }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shahidirfan/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/q2JkDwwcHddhrWxls/builds/gAUTheyxhY2wIoeWn/openapi.json
