# UK Government Tenders & Contracts Feed (`affable_ornament_8s8/uk-gov-tenders-feed`) Actor

Search and export UK public sector contract notices from the official Contracts Finder open-data API (OCDS). Open license, no login, no captcha.

- **URL**: https://apify.com/affable_ornament_8s8/uk-gov-tenders-feed.md
- **Developed by:** [Gortol Lai](https://apify.com/affable_ornament_8s8) (community)
- **Categories:** Lead generation, Business, Automation
- **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

## UK Government Tenders & Contracts Feed

Search and export **UK public-sector contract notices** (tenders *and* award notices) straight from the official
**Contracts Finder** open-data API (OCDS). No scraping, no HTML parsing, no login — this actor calls the
government's own JSON endpoint and returns clean, flat records you can drop into a spreadsheet, a CRM, or an agent's tool loop.

> Data source: `https://www.contractsfinder.service.gov.uk/Published/Notices/OCDS/Search`
> Licence: UK Open Government Licence (OGL). Attribution to the Crown. No terms-of-service conflict: the endpoint is
> published as open data and the actor only reads it.

### What it does

- Queries the official Contracts Finder OCDS search API by keyword, buyer, or date window
- Returns **both** notice types: `tender` (competition live) and `award` (who won, and for how much)
- Normalises each notice into one flat record: OCID, published date, notice type, title, buyer name,
  value in GBP, deadline, status, and a direct link to the source notice
- Stops cleanly at `maxItems` so a run never overshoots your budget

### What you can do with it

- **Bid pipeline** — pull live tenders matching your service keywords every morning and pipe them into a CRM or a Slack channel
- **Competitor intelligence** — award notices carry the winner and the contract value, so you can see who is actually winning your segment and at what price
- **Market sizing** — filter by buyer (council, NHS trust, central department) and date range to measure spend in a niche before you chase it
- **Agent tooling** — flat JSON with stable field names, designed to be consumed by an LLM agent without post-processing

### Example output

```json
{
  "ocid": "ocds-b5fd17-06291f8e-82ec-405e-87c2-1451a9f0aa93",
  "date": "2026-10-18T12:54:08+01:00",
  "type": "award",
  "title": "Observability-Tooling",
  "buyer_name": "DSIT",
  "value_amount": 249480,
  "value_currency": "GBP",
  "deadline": "2026-09-18T12:00:00+01:00",
  "status": "complete",
  "url": "https://www.contractsfinder.service.gov.uk/Notice/..."
}
```

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `query` | string | `""` | Free-text keyword matched against notice title/description |
| `maxItems` | integer | `50` | Hard cap on records returned (1–1000) |
| `noticeType` | string | `""` | `tender`, `award`, or empty for both |
| `buyerName` | string | `""` | Filter on buying organisation |
| `publishedAfter` | string | `""` | ISO date, e.g. `2026-10-01` |

### Example: call via API

```bash
curl -X POST https://api.apify.com/v2/acts/affable_ornament_8s8~uk-gov-tenders-feed/runs-sync \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"grounds maintenance","maxItems":20}'
```

Read the results from the run's default dataset:

```bash
curl "https://api.apify.com/v2/actor-runs/<RUN_ID>/dataset/items?format=json" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

### Use with AI agents (MCP)

This actor is a plain JSON-in / JSON-out tool, so it fits an agent loop without an adapter:

- **Apify MCP** — expose the Store actor list to your agent and call it as a tool; input schema above is the tool signature.
- **Any HTTP agent** — the `run-sync` call above returns the run object; pull the dataset items and feed them straight into a prompt.
- Keep `maxItems` small (10–50) inside an agent loop; the Contracts Finder corpus is large and the useful signal is in the newest notices.

### Pricing

Currently published **free** (Apify platform usage fees for the run still apply per your plan).
A per-result price will be added once monetisation is enabled on the account.

### Coverage and gaps

- Covers **Contracts Finder** only (central government is often elsewhere: the incumbent's own guidance points
  live contracts to `Find a Tender` / Playfair for above-threshold notices, and the Scottish/Welsh/Northern Ireland
  portals publish separately). If you need above-threshold central tenders or devolved portals, that is a different feed.
- Award values are as self-published by buyers; a meaningful share of notices carry no value field. Missing values
  are left as `null`, never invented.
- The upstream API ignores some filters and paginates inconsistently; the actor compensates by capping on
  `maxItems` client-side.

### Troubleshooting

- **Empty dataset** — the keyword matched nothing in the retained corpus; widen `publishedAfter` or drop `query`.
- **`429`/timeouts** — the upstream open API rate-limits bursts; lower `maxItems` or retry.

### Source

Data © Crown Copyright, released under the Open Government Licence. The actor redistributes notice metadata and
links back to the official notice URL in every record.

# Actor input Schema

## `query` (type: `string`):

Keywords to search contract/tender notices, e.g. 'cleaning', 'IT services', 'construction'.

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

Maximum number of notices to return (1-5000).

## `dateFrom` (type: `string`):

Only notices published on or after this date, ISO format e.g. 2026-10-01.

## `dateTo` (type: `string`):

Only notices published on or before this date, ISO format e.g. 2026-10-18.

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

Filter by notice type.

## Actor input object example

```json
{
  "query": "cleaning",
  "maxItems": 50
}
```

# Actor output Schema

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

Normalized UK public sector contract notices (tenders, awards, contracts) as JSON items.

# 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 = {
    "query": "cleaning",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("affable_ornament_8s8/uk-gov-tenders-feed").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 = {
    "query": "cleaning",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("affable_ornament_8s8/uk-gov-tenders-feed").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 '{
  "query": "cleaning",
  "maxItems": 50
}' |
apify call affable_ornament_8s8/uk-gov-tenders-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,affable_ornament_8s8/uk-gov-tenders-feed"
        }
    }
}
```

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/QrhwdE5ERmswWsYAb/builds/dZWpsLCuQwRyjHWsT/openapi.json
