# OCDS Tender Opportunity & Deadline Monitor (`exceptional_nugget/ocds-tender-opportunity-monitor`) Actor

Find relevant tenders in Contracts Finder or supplied OCDS release feeds. Filter keywords and CPV codes, inspect deadlines and detect new or updated notices.

- **URL**: https://apify.com/exceptional\_nugget/ocds-tender-opportunity-monitor.md
- **Developed by:** [LibriHouse](https://apify.com/exceptional_nugget) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 source checks

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

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

## OCDS Tender Opportunity & Deadline Monitor

For suppliers screening procurement notices for relevant opportunities.

Find relevant tenders in Contracts Finder or supplied OCDS release feeds. Filter keywords and CPV codes, inspect deadlines and detect new or updated notices.

### What it does

Reads releases, chooses the latest release per OCID within the fetched pages, extracts buyer, title, status, deadline, amount, currency and CPV. Partial rolling feeds can add or update validated records.

### Quick start

Paste the example below into Input, run the Actor, then open **REPORT** for a readable HTML report or **SUMMARY** for run coverage and history status. Dataset output has one row per supplied sources entry, with nested records and changes. Export JSON for full nested detail; CSV is best for summary fields.

```json
{
  "sources": [
    {
      "id": "uk-contracts",
      "provider": "contracts-finder",
      "lookbackDays": 7
    }
  ]
}
```

### Inputs

Each sources object requires id. Use provider contracts-finder with lookbackDays (1–30, default 7), or provider ocds with a public url returning an OCDS release package. Optional name. keywords and cpvPrefixes filter literal phrases and 2–8 digit CPV prefixes. onlyOpen defaults false. maxPages defaults 2 (1–10).

Supply 1–10 source objects. URLs must be public HTTP(S) on standard ports without credentials. `timeoutSecs` is 2–30 per request (default 15), `maxRedirects` 0–5 (default 3), and `delayMillis` 100–5000 between requests (default 250). Redirect destinations and DNS answers are validated; private and reserved network addresses are blocked. Response bodies are capped at 4 MB.

### Results and interpretation

`status` is observed, baseline, unchanged, changed or unknown. `sourceComplete` distinguishes complete coverage from partial/failed evidence. `records` contains observations; `facts` provides summary metrics; `issues` and the report explain limitations. `changeCounts` gives full counts; `changes` includes at most 100 detailed changes per input, with `changesTruncated` when capped. The HTML report previews 20 changes and 10 records. `SUMMARY.complete` means all inputs were attempted, while `coverageComplete` means all sources were reliable.

### Repeat runs and history

`monitor` defaults to true. Run the same watchlist with the same `monitorKey` to compare against the last reliable observation. The first run establishes a baseline and reports no invented changes. Change the key to start a new baseline. Changing source definitions or filter settings creates a separate scope. Keep stable IDs and source order.

History is stored in an Actor-owned named key-value store in your account, under limited permissions. Complete funded runs persist immutable snapshots; failed sources retain their prior records. Overlapping runs use start-ordered snapshots so a late older run cannot roll history back. Each run pins its baseline across restarts. Prefer schedules that do not overlap to avoid duplicate alerts from concurrent comparisons.

The most recent 20 snapshots are retained, with at most 2000 historical record IDs per source for rolling feeds and a 7 MB snapshot cap. Older retained IDs can appear new after eviction. `SUMMARY.history` says whether history was saved; split large watchlists if it reports a size limit. Partial budget runs do not advance history. `monitor: false` performs an observation without history.

### Pricing

**$30 per 1000 completed source checks** ($0.03 per `tender-source-checked` event), plus Apify platform usage and the listed Actor-start event. A completed check can return unknown or problem evidence; it still incurs the custom check event. Transport/security exceptions with an `error` have no custom check charge. The Actor-start event is $0.00005 per GB of allocated memory, minimum one event. Use the run spending limit to bound charges; the report identifies partial budget runs. The Apify pricing tab is authoritative.

### Coverage limits

Supports OCDS release packages with releases and optional links.next, not every procurement portal or compiled record package. Maximum 1000 observed OCIDs per source. Never infers withdrawal/removal from missing feed entries. Partial releases without tender details are skipped; source notices remain authoritative. Filters may exclude later closed notices when onlyOpen is enabled. No bid eligibility assessment.

HTTP requests only. No CAPTCHA bypass, credentials, proxy subscription, external AI key, notifications or outbound messages are included. Use Apify schedules and your own integrations to consume changes. Reports show source evidence, not guaranteed business outcomes.

### Troubleshooting and support

For unknown results, inspect `issues` and the source response before changing your workflow. Increase pagination limits only when needed. Retry rate limits later with a longer delay. Use a new monitor key when intentionally redefining a watchlist. Open an issue from this Actor's Issues tab with the run ID, expected behavior and a public reproducible input; omit tokens and personal data.

### Local development

Node.js 22+. Run `npm ci`, `npm test`, `npm run check`, then `npm start` with an Apify INPUT record. Tests cover source fixtures, incomplete coverage, history, HTTP safety, report escaping and charging boundaries. Cloud release evidence is recorded separately in RELEASE.md in the local project.

# Actor input Schema

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

Each sources object requires id. Use provider contracts-finder with lookbackDays (1–30, default 7), or provider ocds with a public url returning an OCDS release package. Optional name. keywords and cpvPrefixes filter literal phrases and 2–8 digit CPV prefixes. onlyOpen defaults false. maxPages defaults 2 (1–10).

## `monitor` (type: `boolean`):

Create/read an Actor-owned named history store. Disable for a stateless observation.

## `monitorKey` (type: `string`):

Use a distinct label for independent monitoring histories. Changes to source identities or extraction filters create a separate history.

## `timeoutSecs` (type: `integer`):

Deadline including DNS, in seconds.

## `maxRedirects` (type: `integer`):

Maximum redirects followed per request.

## `delayMillis` (type: `integer`):

Minimum delay between consecutive requests in the run.

## `keywords` (type: `array`):

OR match title and description.

## `cpvPrefixes` (type: `array`):

2–8 digit classification prefixes.

## `onlyOpen` (type: `boolean`):

Only active tenders without a past deadline. May exclude later closed updates.

## `maxPages` (type: `integer`):

Follow same-origin links.next; missing feed entries never imply removal.

## Actor input object example

```json
{
  "sources": [
    {
      "id": "uk-contracts",
      "provider": "contracts-finder",
      "lookbackDays": 7
    }
  ],
  "monitor": true,
  "monitorKey": "default",
  "timeoutSecs": 15,
  "maxRedirects": 3,
  "delayMillis": 250,
  "keywords": [],
  "cpvPrefixes": [],
  "onlyOpen": false,
  "maxPages": 2
}
```

# Actor output Schema

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

No description

## `report` (type: `string`):

No description

## `summary` (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 = {
    "sources": [
        {
            "id": "uk-contracts",
            "provider": "contracts-finder",
            "lookbackDays": 7
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("exceptional_nugget/ocds-tender-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 = { "sources": [{
            "id": "uk-contracts",
            "provider": "contracts-finder",
            "lookbackDays": 7,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("exceptional_nugget/ocds-tender-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 '{
  "sources": [
    {
      "id": "uk-contracts",
      "provider": "contracts-finder",
      "lookbackDays": 7
    }
  ]
}' |
apify call exceptional_nugget/ocds-tender-opportunity-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,exceptional_nugget/ocds-tender-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/3Ec6tpsMCHPHvxvxB/builds/QKxc94dCLNEtUL9uh/openapi.json
