# BOAMP, DECP & TED Scraper — EU Tender Renewal Radar (`vesper_studio/eu-public-tender-renewal-radar`) Actor

Detect public procurement contracts approaching expiry (3-18 months before renewal) across France (BOAMP, DECP) and Europe (TED v3). Extracts buyer IDs, incumbent winners, CPV codes, reconstructed end dates, and optional PDF contract durations for B2B GovTech & sales teams.

- **URL**: https://apify.com/vesper_studio/eu-public-tender-renewal-radar.md
- **Developed by:** [Xavier Richard](https://apify.com/vesper_studio) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 expiring public contract records

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

## EU Public Tender Renewal Radar (BOAMP, DECP, TED)

**Win public contracts before your competitors even see the RFP.**

Public buyers renew recurring service contracts (cleaning, security, IT managed services, building maintenance, waste, catering) on predictable 12–48 month cycles. Instead of waiting for a new tender to drop with a 30-day deadline, **EU Public Tender Renewal Radar** scans past contract award notices across **France (BOAMP + DECP)** and **Europe (TED v3)**, **reconstructs the true contract end date**, and flags contracts entering their **3–18 month pre-renewal prospecting window**.

***

### Why This Actor Is Built for B2B Sales & Bid Teams

- **End-Date Reconstruction Engine (not a raw API mirror)**: Combines explicit JSON durations/dates, contract amendment extensions (`DECP`), renewal clauses (`cac:ContractExtension`), multilingual **FR / EN / DE** regex extraction on notice descriptions, and optional **PyMuPDF PDF parsing** when durations are buried in official PDFs.
- **Actionable Renewal Windows**:
  - `urgent_0_6m` — Expiring in **0–6 months**: RFP drafting or incumbent review is imminent; prioritize immediate buyer outreach.
  - `pipeline_6_12m` — Expiring in **6–12 months**: Ideal window for pre-tender qualification, capability briefings, and incumbent displacement.
  - `watch_12_18m` — Expiring in **12–18 months**: Long-cycle strategic pipeline and multi-year account mapping.
- **Transparent Confidence Scoring**:
  - `high` — Explicit end date or structured duration from official JSON (`explicit_end_date`, `explicit_json`).
  - `medium` — Extracted via multilingual FR/EN/DE regex from notice text or parsed PDF (`notice_text_regex`, `pdf_regex`).
  - `low` — Estimated via sector CPV duration heuristics (`cpv_heuristic`).
- **Incumbent Competitor & Buyer Intelligence**: Extracts structured **`buyer_id` (100% fill rate)** and **`winner_ids` (95–96% fill rate)** from TED API v3 (`buyer-identifier`, `winner-identifier`, `BT-58/536/537-Lot`) and BOAMP eForms (`cbc:CompanyID`), alongside `winner_names`, contract amount in EUR (`amount_eur`), `buyer_name`, CPV codes, and direct notice/PDF links.
- **100% HTTP/2 & Official APIs**: Zero browser overhead, concurrent PDF parsing (`concurrency=8`), runs comfortably in **512 MB RAM** (2x leaner than 1 GB TED scrapers) with exponential backoff + `Retry-After` handling.

***

### Official Data Sources

| Source | Coverage | API / Standard | Notes |
| :--- | :--- | :--- | :--- |
| **`boamp`** | France (national & EU notices) | BOAMP DILA OpenDataSoft v2.1 | Parses `EFORMS`, `FNSimple`, and legacy notices; resolves official `boamp.fr` PDF URLs. |
| **`decp`** | France (all public contracts ≥ €40k & sub-threshold) | Bercy `decp-2022-marches-valides` | Includes `dureemois`, `dureemoismodification`, `datenotification`, `montant`; optionally resolves SIRET IDs to organization names via `recherche-entreprises.api.gouv.fr`. |
| **`ted`** | EU / EEA above-threshold | TED API v3 (`api.ted.europa.eu`) | Covers `FR`, `DE`, `BE`, `ES`, `IT`, `NL`, `PL`, etc.; extracts multi-language titles, winners, values, and PDF links. |

***

### High-Value CPV Sectors for Prospection

| Sector | `cpvCodes` Prefix Examples | Typical Cycle |
| :--- | :--- | :--- |
| **Cleaning & Janitorial** | `9091` (building/office/industrial cleaning) | 36–48 months |
| **Private Security & Guarding** | `7971` (security, alarm monitoring, surveillance) | 36–48 months |
| **IT Services & Software** | `7200`, `7220`, `7250` (consulting, dev, support) | 24–48 months |
| **Facility & HVAC Maintenance** | `5000`, `5070`, `5080` (repair & maintenance) | 36–48 months |
| **Catering & Grounds** | `5552`, `7731` | 36 months |

***

### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `sources` | `array` | `["boamp", "decp", "ted"]` | Official APIs to scan. |
| `cpvCodes` | `array` | `["9091"]` | CPV code prefixes (2–8 digits). Leave empty to scan all sectors. |
| `countries` | `array` | `["FR"]` | ISO-2 country codes (`FR`, `DE`, `BE`, etc.). `boamp` and `decp` run only when `FR` is included. |
| `minAmountEur` | `integer` | `0` | Minimum contract value in EUR (excludes undisclosed amounts when `> 0`). |
| `expiryWindowMonths` | `integer` | `18` | Maximum months until `estimated_end_date` (`1–60`). |
| `minExpiryMonths` | `integer` | `0` | Minimum months until `estimated_end_date` (set `3` for strict J-3 to J-18 targeting). |
| `parsePdfDuration` | `boolean` | `false` | Download & parse official PDFs with PyMuPDF **only** when duration is missing from JSON/text (URL-cached). |
| `onlyNew` | `boolean` | `false` | Delta mode via Apify Key-Value Store (`seen_contracts`), checkpointed on completion and `aborting`. |
| `resolveSiretNames` | `boolean` | `true` | Resolve DECP buyer/winner SIRET IDs to legal names via the French Annuaire des Entreprises API. |
| `maxItems` | `integer` | `50` | Maximum expiring contract records to deliver (`1–10000`). |

***

### Output Schema (`ContractAward`)

Each dataset item follows a flat, CRM-ready schema (exportable as JSON, CSV, or XLSX for HubSpot, Pipedrive, Clay, Make, or n8n):

```json
{
  "source": "boamp",
  "source_id": "24-109517",
  "dedup_key": "boamp:24-109517",
  "country": "FR",
  "department_or_region": "45",
  "title": "Prestations de nettoyage des locaux administratifs",
  "buyer_name": "Ville d'Orléans",
  "buyer_id": "21450234600015",
  "winner_names": ["PROPRETE SERVICES SAS"],
  "winner_ids": ["48912345600021"],
  "cpv_codes": ["90911200"],
  "primary_cpv": "90911200",
  "amount_eur": 360000.0,
  "amount_original": 360000.0,
  "currency": "EUR",
  "award_date": "2024-06-15",
  "start_date": "2024-07-01",
  "explicit_end_date": null,
  "duration_months": 36,
  "renewal_count": 2,
  "renewal_description": "Reconductible 2 fois 12 mois",
  "estimated_end_date": "2027-07-01",
  "months_until_expiry": 7.6,
  "renewal_window": "pipeline_6_12m",
  "confidence": "high",
  "duration_source": "explicit_json",
  "pdf_parsed": false,
  "notice_url": "https://www.boamp.fr/pages/avis/?q=idweb:24-109517",
  "pdf_url": "https://www.boamp.fr/telechargements/FILES/PDF/2024/06/24-109517.pdf"
}
```

***

### Pay-Per-Event Pricing

This Actor supports Apify **Pay-Per-Event** with strict pre-flight and per-batch budget checks:

- **`contract-record`**: Charged once per delivered `ContractAward` pushed to the Dataset.
- **`pdf-parsed`**: Charged only when `parsePdfDuration` is enabled and a new PDF URL is downloaded and parsed via PyMuPDF (cached URLs are never billed twice).

***

### Local Development & Tests

```bash
python -m venv .venv
.venv/Scripts/activate   # or source .venv/bin/activate on Linux/macOS
pip install -r requirements.txt -r requirements-dev.txt
pytest -v
apify run
```

# Actor input Schema

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

Official public procurement APIs to query. BOAMP and DECP cover France (national + sub-threshold + EU notices); TED v3 covers all EU/EEA above-threshold notices.

## `cpvCodes` (type: `array`):

Target sector CPV prefixes (2 to 8 digits). Examples: 9091 (cleaning), 7971 (security), 7200 or 72 (IT services), 5000 or 5070 (maintenance). Leave empty to scan all sectors.

## `countries` (type: `array`):

ISO 3166-1 alpha-2 country codes (e.g. FR, DE, BE, ES, IT, NL, PL). BOAMP & DECP only apply when FR is included; TED filters by all specified countries.

## `minAmountEur` (type: `integer`):

Optional minimum contract value in EUR. Contracts without a published value are excluded when this threshold is set > 0.

## `expiryWindowMonths` (type: `integer`):

Maximum number of months from today until the estimated contract end date. Default 18 captures urgent_0_6m, pipeline_6_12m, and watch_12_18m windows.

## `minExpiryMonths` (type: `integer`):

Minimum months until expiry (use 3 for strict J-3 to J-18 prospecting, or 0 to include contracts expiring within the next 3 months too).

## `parsePdfDuration` (type: `boolean`):

When enabled, downloads official BOAMP/TED notice PDFs ONLY for contracts lacking explicit duration/end date in JSON and extracts duration/amount via multilingual FR/EN/DE regexes. Each parsed PDF bills one 'pdf-parsed' event.

## `onlyNew` (type: `boolean`):

Skip contracts already delivered in previous runs using the Apify Key-Value Store ('seen_contracts'). State is checkpointed on completion and on graceful abort.

## `resolveSiretNames` (type: `boolean`):

Look up buyer and winner names for DECP records via the official French Annuaire des Entreprises API (cached per SIRET).

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

Maximum number of expiring contract records to deliver across all selected sources. Each delivered contract bills one 'contract-record' event.

## Actor input object example

```json
{
  "sources": [
    "boamp",
    "decp",
    "ted"
  ],
  "cpvCodes": [
    "9091"
  ],
  "countries": [
    "FR"
  ],
  "minAmountEur": 0,
  "expiryWindowMonths": 18,
  "minExpiryMonths": 0,
  "parsePdfDuration": false,
  "onlyNew": false,
  "resolveSiretNames": true,
  "maxItems": 50
}
```

# Actor output Schema

## `contracts` (type: `string`):

Normalized ContractAward records with estimated_end_date, months_until_expiry, renewal_window, confidence score, buyer, incumbent winner, CPV codes, and notice/PDF URLs. Append ?format=csv or ?format=xlsx for CRM import.

# 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": [
        "boamp",
        "decp",
        "ted"
    ],
    "cpvCodes": [
        "9091"
    ],
    "countries": [
        "FR"
    ],
    "minAmountEur": 0,
    "expiryWindowMonths": 18,
    "minExpiryMonths": 0,
    "parsePdfDuration": false,
    "onlyNew": false,
    "resolveSiretNames": true,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("vesper_studio/eu-public-tender-renewal-radar").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": [
        "boamp",
        "decp",
        "ted",
    ],
    "cpvCodes": ["9091"],
    "countries": ["FR"],
    "minAmountEur": 0,
    "expiryWindowMonths": 18,
    "minExpiryMonths": 0,
    "parsePdfDuration": False,
    "onlyNew": False,
    "resolveSiretNames": True,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("vesper_studio/eu-public-tender-renewal-radar").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": [
    "boamp",
    "decp",
    "ted"
  ],
  "cpvCodes": [
    "9091"
  ],
  "countries": [
    "FR"
  ],
  "minAmountEur": 0,
  "expiryWindowMonths": 18,
  "minExpiryMonths": 0,
  "parsePdfDuration": false,
  "onlyNew": false,
  "resolveSiretNames": true,
  "maxItems": 50
}' |
apify call vesper_studio/eu-public-tender-renewal-radar --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vesper_studio/eu-public-tender-renewal-radar"
        }
    }
}
```

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/d4bttGDfpA9M9FjRM/builds/Jfsodb3ujgs7IrGRb/openapi.json
