# Federal Grants & Contracts Finder (`utility-belt-labs/gov-opportunity-finder`) Actor

Search U.S. federal grants (Grants.gov) and government contract opportunities (SAM.gov) in one run.

- **URL**: https://apify.com/utility-belt-labs/gov-opportunity-finder.md
- **Developed by:** [Utility Belt Labs](https://apify.com/utility-belt-labs) (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?

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

## Federal Grants & Contracts Finder (Grants.gov + SAM.gov)

Find open US federal **grants** (Grants.gov, no key needed) and **contract opportunities** (SAM.gov, bring your own free API key) in one run, as clean JSON, CSV or Excel.

Official public APIs only. No scraping, no logins, no browser.

### What you get

- **Grants.gov:** title, opportunity number, agency, status (posted/forecasted), posted and close dates, CFDA/Assistance Listing numbers, link. Turn on *Fetch grant details* to add the plain-text description, award ceiling and floor, estimated total funding, expected number of awards, cost sharing, eligible applicant types, and agency contact email.
- **SAM.gov:** notice ID, solicitation number, title, agency path, notice type, posted date, response deadline, NAICS, PSC code, set-aside, place-of-performance state, award info (when present), contracting officer contacts, and a sam.gov link.

### Filters

Keyword, Grants.gov agency / eligibility / funding category codes, grant status, SAM.gov posted-within-N-days, NAICS, set-aside (SBA, 8A, WOSB, SDVOSBC, HZC...), notice type and state.

### Who it's for

Grant writers, nonprofits, schools and universities, small businesses chasing federal contracts, BD/capture teams, and AI agents (works over Apify MCP). Schedule it daily to get a feed of new opportunities.

### SAM.gov API key

SAM.gov requires a free personal API key: sign in at sam.gov, open Account Details, and request a Public API Key. Paste it into the *SAM.gov API key* field (stored as a secret input). Without a key the Actor still returns Grants.gov results and skips SAM.gov. SAM.gov rate-limits free keys, so keep runs modest.

### Pricing

Pay per opportunity returned. You are not charged for sources that fail or return nothing.

### Notes

Data comes straight from Grants.gov and SAM.gov and is only as current as those systems. Always confirm deadlines and requirements on the official listing before applying or bidding.

# Actor input Schema

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

Search terms, e.g. 'broadband', 'cybersecurity'.

## `sources` (type: `array`):

Which databases to search. SAM.gov needs your free API key below.

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

Maximum opportunities to return from each source.

## `grantStatuses` (type: `array`):

Grants.gov opportunity statuses to include.

## `agencies` (type: `string`):

Pipe-separated, e.g. 'HHS|DOE'.

## `eligibilities` (type: `string`):

Pipe-separated Grants.gov codes, e.g. '12' (nonprofits 501c3).

## `fundingCategories` (type: `string`):

Pipe-separated, e.g. 'ED|HL'.

## `includeDetails` (type: `boolean`):

Adds description, award ceiling/floor, total funding, eligible applicants (1 extra API call each).

## `samApiKey` (type: `string`):

Free key from sam.gov > Account Details > Public API Key.

## `daysBack` (type: `integer`):

Only SAM.gov notices posted in the last N days (max 364).

## `naics` (type: `string`):

6-digit NAICS code, e.g. 541511.

## `setAside` (type: `string`):

e.g. SBA, 8A, WOSB, SDVOSBC.

## `noticeType` (type: `string`):

o=solicitation, p=presolicitation, k=combined, r=sources sought.

## `state` (type: `string`):

2-letter code.

## Actor input object example

```json
{
  "keyword": "water",
  "sources": [
    "grants"
  ],
  "maxItems": 100,
  "grantStatuses": [
    "posted",
    "forecasted"
  ],
  "includeDetails": false,
  "daysBack": 30
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of matching federal grant and contract opportunities, each with source, title, agency, status, posted and close dates, award ceiling, set-aside and URL.

# 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": "water"
};

// Run the Actor and wait for it to finish
const run = await client.actor("utility-belt-labs/gov-opportunity-finder").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": "water" }

# Run the Actor and wait for it to finish
run = client.actor("utility-belt-labs/gov-opportunity-finder").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": "water"
}' |
apify call utility-belt-labs/gov-opportunity-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,utility-belt-labs/gov-opportunity-finder"
        }
    }
}
```

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/jpO1WLu8jjHtKLBt8/builds/bfOMi3ND6YTEBCb35/openapi.json
