# UK Tender Monitor (Find a Tender + Contracts Finder) (`luoyanpeng/uk-tender-monitor`) Actor

Monitor new UK public tenders from Find a Tender and Contracts Finder via official OCDS APIs. Clean, deduplicated notices with buyer, CPV, value, deadline and links. Optional AI English summaries. Pay only per notice.

- **URL**: https://apify.com/luoyanpeng/uk-tender-monitor.md
- **Developed by:** [yanpengluo](https://apify.com/luoyanpeng) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 notices

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

## UK Tender Monitor: Find a Tender + Contracts Finder (OCDS)

Monitors UK public procurement notices from two official Cabinet Office OCDS APIs. No API key is needed.

- **Find a Tender (FTS)**: `GET /api/1.0/ocdsReleasePackages`, using `updatedFrom`/`updatedTo` and a cursor (`links.next`).
- **Contracts Finder (CF)**: `GET /Published/Notices/OCDS/Search`, using `publishedFrom`/`publishedTo` and a cursor.

The output uses the same normalized schema as the TED and SAM actors. It adds `ocid` and `releaseDate`.

### How it fetches

- Each source runs on a single thread, with at most 1 request per second (≥1.1 s apart).
- On 429 or 5xx it backs off and retries at most 3 times, and honours Retry-After.
- It sends an honest User-Agent and uses no proxies. On 403 or a captcha it stops.

### Deduplication

- One record per **OCDS `ocid`** per run, across both sources. The newest release wins, because APIs return newest first.
- Across runs, an `ocid` already output in the same `dedupeScope` is skipped.
- RUN_SUMMARY reports `crossSourceDuplicates` and `olderReleasesOfSameOcid`.

### Field rules

- `estimatedValue` comes from `tender.value`. If that is missing, it is the sum of lot values, but only when every lot has a value and all lots share one currency. It is **null for award/contract releases**, because there `tender.value` may be the awarded value. No currency conversion is done.
- Money fields are always `{amount, currency}` or `null`.
- `awardValue` is the sum of `awards[].value` (net `amount`) in a single currency. If there are none, it is the sum of `contracts[].value`. Mixed currencies give null.
- `deadlineAt` = `tender.tenderPeriod.endDate`, but only if it has a time and a UTC offset. Otherwise it is null.
- `cpv` comes from tender, items and additional classifications (CPV scheme only).
- `titleEn` is the original title (`titleEnSource: "original"`). Notices are published in English, but some may be in Welsh.
- `parties` / contact points are not output, and contact blocks are stripped from the optional raw records. Emails and phones are scrubbed.
- `cpvPrefixes` and `keywords` filter on the client side: every release in the time window is still fetched.

### Licence and attribution

Contains public sector information licensed under the Open Government Licence v3.0 — https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

- FTS and CF data are published under the OGL v3.0. Every output record's `licenseAttribution` contains the statement above, the licence link, and the source service (Find a Tender or Contracts Finder).
- If you republish, keep this attribution and do not suggest official endorsement.
- AI summaries are optional (DeepSeek, budget-capped). They are derived content, not official text.

### Sources and quota split

- `sources` takes `["fts","cf"]` (default), `["fts"]` or `["cf"]`. `uk-fts`/`uk-cf` are also accepted.
- With both sources, `maxItems` is split half/half; the first listed source gets the odd item. Any share a source doesn't use rolls over to the other one, in either direction. The cursor resumes, so nothing is fetched twice.
- RUN_SUMMARY reports `quotaShares` and `outputBySource`.

### Pricing (pay-per-event)

| Event | Price (USD) | When |
|---|---|---|
| `actor-start` | $0.005 | once per run |
| `notice` | $0.0025 ($2.5 / 1,000) | per record written to the dataset |
| `notice-summary` | $0.01 | per newly generated AI summary (optional) |

No charge for failed records, duplicates, or for cached, skipped or failed summaries. Config: `.actor/pay_per_event.json`; local simulation: `scripts/ppe-local.sh`.

# Actor input Schema

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

Which sources to query: 'fts' (Find a Tender) and/or 'cf' (Contracts Finder). With both, maxItems is split half/half; unused share rolls over.

## `from` (type: `string`):

FTS: updatedFrom, CF: publishedFrom. Default: 24h ago

## `to` (type: `string`):

Default: now

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

e.g. 72 or 4800 (client-side filter)

## `keywords` (type: `string`):

All words must appear in title/description (client-side)

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

Each page of up to 1000 uses one API call of your daily quota

## `dedupe` (type: `boolean`):

Skip notices output in earlier runs

## `dedupeScope` (type: `string`):

Dedupe scope

## `enableSummaries` (type: `boolean`):

DeepSeek

## `summaryBudgetUsd` (type: `number`):

hard max 2

## `includeRaw` (type: `boolean`):

Store raw API records

## `mockSummaries` (type: `boolean`):

(dev) mock LLM, local only

## Actor input object example

```json
{
  "sources": [
    "fts",
    "cf"
  ],
  "maxItems": 50,
  "dedupe": true,
  "dedupeScope": "default",
  "enableSummaries": false,
  "summaryBudgetUsd": 0.2,
  "includeRaw": false,
  "mockSummaries": false
}
```

# Actor output Schema

## `notices` (type: `string`):

Normalized public procurement notices with source and licence attribution.

# 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": [
        "fts",
        "cf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("luoyanpeng/uk-tender-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": [
        "fts",
        "cf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("luoyanpeng/uk-tender-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": [
    "fts",
    "cf"
  ]
}' |
apify call luoyanpeng/uk-tender-monitor --silent --output-dataset

```

## MCP server setup

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