# Government Opportunity Finder (`moving_beacon-owner1/government-opportunity-finder`) Actor

Government Opportunity Aggregator — combines public grants, procurement, and spending opportunities from US, UK, and EU government APIs into one deduplicated dataset with keyword matching and optional new-opportunity monitoring.

- **URL**: https://apify.com/moving\_beacon-owner1/government-opportunity-finder.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.99 / 1,000 results

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

## Government Opportunity Finder

Aggregate **public procurement, grant and spending opportunities** from a set of **keyless public government APIs** into one clean, deduplicated dataset. Every record is an officially published opportunity — the Actor collects and normalises only public data and never invents conclusions. Each opportunity ships with a `matchReason` explaining why it surfaced for your keyword, and the Actor can flag newly appeared opportunities between runs.

### What does this Actor do?

It queries the following **keyless, public** sources and merges the results:

- **Grants.gov** — US federal grant opportunities (`search2` API).
- **USAspending** — US federal awards / spending (`spending_by_award` API).
- **GOV.UK** — UK government publications and announcements (search API).
- **TED** — European Union public procurement tenders (TED notices API).

Results are normalised to a single canonical shape, annotated with a match reason, and deduplicated by `(source, identifier)`.

### Why use it?

- Sales, grants and bid teams get a **single, structured feed** across US and EU public opportunities without juggling four different APIs.
- Every opportunity is backed by a **citable, public record** and a URL you can open.
- Optional **change monitoring** flags what is genuinely new since your last run — ideal for scheduled scans.

### How to use it

1. Enter a **keyword** (e.g. `cybersecurity`).
2. Pick your **sources** (default `grants_gov`).
3. Optionally set `agency`, grant `statuses`, `maxResults`, and enable `monitorChanges`.
4. Run the Actor and download the dataset as JSON, CSV or Excel.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `keyword` | string (required) | Keyword to search opportunities for. |
| `sources` | array | `grants_gov`, `usaspending`, `gov_uk`, `ted_eu` (default `["grants_gov"]`). |
| `country` | string | Informational context only — does not filter; choose sources instead. |
| `agency` | string | Optional agency filter (grants.gov). |
| `statuses` | array | Grant statuses: `posted`, `forecasted`, `closed`, `archived` (default `["posted"]`). |
| `maxResults` | integer | Max opportunities to return (default 100). |
| `monitorChanges` | boolean | Flag newly appeared opportunities vs. the previous run (default false). |
| `proxyConfiguration` | object | Proxy settings (usually optional — the APIs are keyless). |

#### Input example

```json
{
  "keyword": "renewable energy",
  "sources": ["grants_gov", "ted_eu"],
  "statuses": ["posted"],
  "maxResults": 100,
  "monitorChanges": true
}
```

### Output

One record per opportunity. Canonical fields:

| Field | Description |
| --- | --- |
| `title` | Opportunity title. |
| `agency` | Publishing agency / buyer. |
| `description` | Description when the source provides one. |
| `eligibility` | Eligibility notes when available. |
| `deadline` | Close / submission date when available. |
| `value` | Award ceiling / estimated value when available. |
| `status` | Source status / notice type. |
| `url` | Link to the official listing. |
| `source` | `grants_gov`, `usaspending`, `gov_uk`, or `ted_eu`. |
| `identifier` | Source-native identifier (used for dedupe). |
| `matchReason` | Why this record matched your keyword. |
| `isNew` | Present when `monitorChanges` is on — `true` for newly appeared opportunities. |

#### Output example

```json
{
  "title": "Community Renewable Energy Program",
  "agency": "Department of Energy",
  "status": "posted",
  "value": 5000000,
  "deadline": "2026-10-01",
  "source": "grants_gov",
  "identifier": "DE-FOA-0001234",
  "url": "https://www.grants.gov/search-results-detail/123456",
  "matchReason": "keyword 'renewable energy' matched title",
  "isNew": true
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Change monitoring

When `monitorChanges` is enabled the Actor stores each run's opportunity list as a snapshot in the **Apify key-value store** (via the shared `ChangeMonitor`). On the next run it diffs the current list against that snapshot by `(source, identifier)` and marks freshly appeared opportunities with `isNew: true`. Schedule the Actor to receive a running feed of only what changed.

### Sources & configuration

- All four sources are **keyless public APIs** — no credentials required.
- **Environment variables** — none required. The Apify Proxy password is injected by the platform when a proxy is configured.

### Local execution

```bash
pip install -r requirements.txt
## put input in storage/key_value_stores/default/INPUT.json
python src/main.py
```

### Apify execution

Deploy with `apify push`, then run from the Console or via the API. Schedule it to re-scan a market on a cadence and use `monitorChanges` to surface only new opportunities.

### Limitations & legal

- Only **publicly accessible** government data is processed. No authentication is bypassed and no private data is collected.
- Field coverage varies by source — some APIs omit descriptions, deadlines or values.
- Respect each source's Terms of Service and applicable laws in your jurisdiction.

# Actor input Schema

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

Keyword to search procurement/grant/spending opportunities for, e.g. 'cybersecurity' or 'renewable energy'.

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

Which keyless public government APIs to query.

## `country` (type: `string`):

Optional country context. Informational only — it does not filter results; pick sources instead.

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

Optional agency code/name to narrow grants.gov results (e.g. 'HHS').

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

Opportunity statuses to include (applies to grants.gov).

## `maxResults` (type: `integer`):

Maximum number of opportunities to return (per source, before dedupe).

## `monitorChanges` (type: `boolean`):

Compare this run's opportunities against the previous run (stored in the key-value store) and flag newly appeared items with isNew=true.

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

Proxy settings. The government APIs are keyless and public; a proxy is usually optional.

## `cookies` (type: `string`):

Optional Cookie header string replayed on every request.

## Actor input object example

```json
{
  "keyword": "renewable energy",
  "sources": [
    "grants_gov"
  ],
  "statuses": [
    "posted"
  ],
  "maxResults": 100,
  "monitorChanges": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

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

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

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/government-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": "renewable energy"
}' |
apify call moving_beacon-owner1/government-opportunity-finder --silent --output-dataset

```

## MCP server setup

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