# EU TED Award Integrity Feed — Winners & Normalized Values (`convenient_yarn/eu-ted-award-integrity-feed`) Actor

Convert official EU TED notices into stable contract-award winner rows with original values, optional provenance-backed EUR amounts, direct notice links, and missing-data integrity flags.

- **URL**: https://apify.com/convenient\_yarn/eu-ted-award-integrity-feed.md
- **Developed by:** [Travis Berman](https://apify.com/convenient_yarn) (community)
- **Categories:** Business, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 award rows

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## EU TED Award Integrity Feed

Turn official EU procurement notices into deterministic award/winner rows that are easier to validate and join.

This Actor queries the public, unauthenticated [TED Search API](https://docs.ted.europa.eu/api/latest/search.html), emits one row per winner, preserves notice provenance, and flags missing or suspect winner/amount/currency data. It does **not** guess values or claim legal completeness.

### Why use it?

Generic tender exports can be awkward for supplier analytics: winners may be absent, currencies are not directly comparable, and one notice may contain multiple winners. This feed provides:

- stable `rowId` values for repeatable joins and deduplication;
- one normalized row per notice/lot/winner;
- original award amount and currency without destructive conversion;
- optional EUR conversion only from a rate, date, and source URL you supply;
- `integrityStatus` and machine-readable `integrityFlags`;
- direct TED notice and API provenance;
- bounded official-source access: no login, cookies, browser scraping, or proxy.

### Input

For a live run, provide an inclusive publication range of at most 31 days:

```json
{
  "dataSource": "live",
  "dateFrom": "2026-07-01",
  "dateTo": "2026-07-07",
  "countries": ["DE", "FR"],
  "cpvCodes": ["72"],
  "maxNotices": 50,
  "maxRows": 100,
  "exchangeRatesToEur": []
}
````

Optional filters are country, CPV prefix, and buyer text. Hard caps are 500 notices and 2,000 rows. Set `dataSource` to `sample` to run the bundled synthetic demonstration without network access.

#### Currency rates

`exchangeRatesToEur` is a list of source-currency rates, each expressing the EUR value of one currency unit:

```json
[
  {
    "currency": "PLN",
    "rate": 0.232,
    "rateDate": "2026-07-09",
    "sourceUrl": "https://data-api.ecb.europa.eu/"
  }
]
```

The Actor does not fetch or infer rates. EUR uses an identity rate of 1. A non-EUR amount without complete supplied provenance remains `amountEur: null` and is flagged `FX_RATE_MISSING`.

### Output

```json
{
  "rowId": "90c8bba603de49b529f90046",
  "noticeId": "123457-2026",
  "lotId": "LOT-0002",
  "publicationDate": "2026-07-09",
  "awardDate": "2026-07-07",
  "title": "Municipal fleet maintenance",
  "buyerName": "Example City",
  "winnerName": "Warsaw Fleet Sp. z o.o.",
  "winnerCountry": "PL",
  "cpvCodes": ["50110000"],
  "amountOriginal": 2500000,
  "currencyOriginal": "PLN",
  "amountAllocation": "sole-winner",
  "amountEur": 580000,
  "fxProvenance": {
    "rate": 0.232,
    "rateDate": "2026-07-09",
    "sourceUrl": "https://data-api.ecb.europa.eu/",
    "method": "user-supplied"
  },
  "integrityFlags": [],
  "integrityStatus": "OK",
  "noticeUrl": "https://ted.europa.eu/en/notice/-/detail/123457-2026",
  "source": {
    "name": "TED Search API",
    "url": "https://api.ted.europa.eu/v3/notices/search"
  }
}
```

The repository fixture and examples are synthetic and are not represented as real procurement awards.

### Integrity flags

- `MISSING_NOTICE_ID`
- `MISSING_WINNER`
- `MISSING_AMOUNT`
- `INVALID_AMOUNT`
- `MISSING_CURRENCY`
- `FX_RATE_MISSING`
- `AMOUNT_SHARED_ACROSS_MULTIPLE_WINNERS` — the notice/lot amount is repeated only for provenance and must not be summed across winner rows; inspect `amountAllocation`.
- `LOT_WINNER_ALIGNMENT_UNRESOLVED` — TED returned multiple lot identifiers but its flattened search fields did not provide a safe one-to-one mapping to winners; `lotId` is `MULTIPLE_OR_UNRESOLVED` rather than a guessed lot.

`REVIEW` means at least one flag exists; it does not mean the underlying legal notice is wrong.

### Local development

```bash
npm install
npm test
npm run validate
```

For deterministic Actor storage, pre-seed `storage/key_value_stores/default/INPUT.json` with `examples/input.sample.json`, unset `APIFY_TOKEN` and `APIFY_IS_AT_HOME`, set `CRAWLEE_PURGE_ON_START=0`, then run `npm start` or `apify run`.

### Pricing and support

The proposed model is $0.004 per emitted `award-row`, with no start event. Pricing is not active until deployment/Store configuration. See [pricing](docs/PRICING.md) and [support](docs/SUPPORT.md).

### Important limitations

This is an analytics aid, not legal advice or a legally authoritative archive. TED source fields can be absent, multilingual, or revised. Always inspect `noticeUrl` before acting. Live compatibility must be sampled against the current TED response before release; local build completion alone is not a publication claim.

# Actor input Schema

## `dataSource` (type: `string`):

Use live for official TED data or sample for the deterministic bundled demonstration.

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

Inclusive ISO date. Required for live data; maximum window is 31 days.

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

Inclusive ISO date. Required for live data; maximum window is 31 days.

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

Optional two-letter EU country codes.

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

Optional 2–8 digit CPV prefixes.

## `buyerText` (type: `string`):

Optional buyer-name text filter; quote characters are safely escaped.

## `maxNotices` (type: `integer`):

Hard cap on source notices fetched.

## `maxRows` (type: `integer`):

Hard cap on emitted award/winner rows.

## `exchangeRatesToEur` (type: `array`):

Currency rates with provenance. Rate means 1 unit of the source currency in EUR. EUR is always 1. Unprovided currencies remain null and receive an integrity flag.

## Actor input object example

```json
{
  "dataSource": "live",
  "maxNotices": 100,
  "maxRows": 500,
  "exchangeRatesToEur": []
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("convenient_yarn/eu-ted-award-integrity-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("convenient_yarn/eu-ted-award-integrity-feed").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call convenient_yarn/eu-ted-award-integrity-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=convenient_yarn/eu-ted-award-integrity-feed",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "EU TED Award Integrity Feed — Winners & Normalized Values",
        "description": "Convert official EU TED notices into stable contract-award winner rows with original values, optional provenance-backed EUR amounts, direct notice links, and missing-data integrity flags.",
        "version": "0.1",
        "x-build-id": "Uf7Z8CT1ky6Xb26g9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/convenient_yarn~eu-ted-award-integrity-feed/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-convenient_yarn-eu-ted-award-integrity-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/convenient_yarn~eu-ted-award-integrity-feed/runs": {
            "post": {
                "operationId": "runs-sync-convenient_yarn-eu-ted-award-integrity-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/convenient_yarn~eu-ted-award-integrity-feed/run-sync": {
            "post": {
                "operationId": "run-sync-convenient_yarn-eu-ted-award-integrity-feed",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "dataSource"
                ],
                "properties": {
                    "dataSource": {
                        "title": "Data source",
                        "enum": [
                            "live",
                            "sample"
                        ],
                        "type": "string",
                        "description": "Use live for official TED data or sample for the deterministic bundled demonstration.",
                        "default": "live"
                    },
                    "dateFrom": {
                        "title": "Publication date from",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Inclusive ISO date. Required for live data; maximum window is 31 days."
                    },
                    "dateTo": {
                        "title": "Publication date to",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Inclusive ISO date. Required for live data; maximum window is 31 days."
                    },
                    "countries": {
                        "title": "Place-of-performance country codes",
                        "maxItems": 10,
                        "type": "array",
                        "description": "Optional two-letter EU country codes.",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                        }
                    },
                    "cpvCodes": {
                        "title": "CPV code prefixes",
                        "maxItems": 20,
                        "type": "array",
                        "description": "Optional 2–8 digit CPV prefixes.",
                        "items": {
                            "type": "string",
                            "pattern": "^[0-9]{2,8}$"
                        }
                    },
                    "buyerText": {
                        "title": "Buyer name contains",
                        "maxLength": 120,
                        "type": "string",
                        "description": "Optional buyer-name text filter; quote characters are safely escaped."
                    },
                    "maxNotices": {
                        "title": "Maximum notices",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Hard cap on source notices fetched.",
                        "default": 100
                    },
                    "maxRows": {
                        "title": "Maximum output rows",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Hard cap on emitted award/winner rows.",
                        "default": 500
                    },
                    "exchangeRatesToEur": {
                        "title": "Optional exchange rates to EUR",
                        "maxItems": 50,
                        "type": "array",
                        "description": "Currency rates with provenance. Rate means 1 unit of the source currency in EUR. EUR is always 1. Unprovided currencies remain null and receive an integrity flag.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "currency": {
                                    "title": "Currency",
                                    "description": "Three-letter source currency code.",
                                    "type": "string",
                                    "editor": "textfield",
                                    "pattern": "^[A-Z]{3}$"
                                },
                                "rate": {
                                    "title": "Rate to EUR",
                                    "description": "EUR value of one source-currency unit.",
                                    "type": "number",
                                    "editor": "number",
                                    "minimum": 1e-9
                                },
                                "rateDate": {
                                    "title": "Rate date",
                                    "description": "ISO date associated with this rate.",
                                    "type": "string",
                                    "editor": "textfield",
                                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                                },
                                "sourceUrl": {
                                    "title": "Source URL",
                                    "description": "HTTPS URL documenting the rate source.",
                                    "type": "string",
                                    "editor": "textfield",
                                    "pattern": "^https://"
                                }
                            },
                            "required": [
                                "currency",
                                "rate",
                                "rateDate",
                                "sourceUrl"
                            ]
                        },
                        "default": []
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
