DEV Community

Rowsift
Rowsift

Posted on Originally published at rowsift.co.uk

TED API v3: 6 gotchas when pulling EU public tenders (with a script that works)

TED (Tenders Electronic Daily) publishes every above-threshold public tender in the EU, and its search API (POST https://api.ted.europa.eu/v3/notices/search) needs no API key. That makes it the obvious source for a weekly bid feed. It also has a handful of behaviours that fail silently or with a vague 400. Here are the six I hit, each checked against the live API this week.

1. A week of notices is bigger than the paging window

With "paginationMode": "PAGE_NUMBER", page × limit may not exceed 15,000:

{"message": "Value (15250) of parameter 'Window size (page x limit)' exceeds maximum allowed value (15000)",
 "error": {"type": "SEARCH_WINDOW_TOO_WIDE", "maxResultWindow": 15000}}
Enter fullscreen mode Exit fullscreen mode

That sounds like a lot until you count: TED published 17,038 notices between 18 and 24 Nov 2026. A "get last week" job using page numbers stops short without warning if you swallow errors.

Fix: use "paginationMode": "ITERATION" and pass back iterationNextToken from each response. Iterating the same week returned all 17,038.

2. limit tops out at 250

limit: 251 returns SEARCH_EXCEEDS_MAX_LIMIT. Use 250 and iterate.

3. Country codes are ISO 3166 alpha-3

buyer-country IN (DE) returns 400 QUERY_UNSUPPORTED_FIELD_VALUE. It has to be DEU, FRA, POL, IRL and so on. The response uses alpha-3 too ("buyer-country": ["DEU"]), so map once at the edge of your code.

4. CPV prefixes need a wildcard

To get IT services (CPV division 72) you need classification-cpv IN (72*). Plain 72 is rejected with the same QUERY_UNSUPPORTED_FIELD_VALUE error.

5. "Tenders" is not one notice type, and corrigenda double-count

TED's eForms notice types split calls for competition into several codes. For "open calls for bids" I use:

cn-standard cn-social cn-desg pin-cfc-standard pin-cfc-social qu-sy subco
Enter fullscreen mode Exit fullscreen mode

For 18–24 Nov that gives 8,364 notices out of the 17,038 total. The rest are prior information notices, award notices, modifications and so on.

Set "onlyLatestVersions": true. Without it the same query returned 8,712, because a changed notice appears once per version.

6. Titles come back in up to 24 languages

notice-title is an object keyed by three-letter language code (eng, deu, hun …), not a string. Pick eng and fall back to whatever is there.

A script that handles all six

Standard library only:

import json, urllib.request

URL = "https://api.ted.europa.eu/v3/notices/search"
TENDER_TYPES = "cn-standard cn-social cn-desg pin-cfc-standard pin-cfc-social qu-sy subco"

def search(query, fields):
    body = {"query": query, "fields": fields, "limit": 250, "scope": "ALL",
            "onlyLatestVersions": True, "paginationMode": "ITERATION"}
    while True:
        req = urllib.request.Request(URL, data=json.dumps(body).encode(),
                                     headers={"Content-Type": "application/json"})
        page = json.load(urllib.request.urlopen(req, timeout=60))
        yield from page["notices"]
        token = page.get("iterationNextToken")
        if not token or not page["notices"]:
            break
        body["iterationNextToken"] = token

def title(n, lang="eng"):
    t = n.get("notice-title") or {}
    return t.get(lang) or next(iter(t.values()), None)

q = (f"publication-date>=20261118 AND publication-date<=20261124 "
     f"AND notice-type IN ({TENDER_TYPES}) "
     f"AND buyer-country IN (IRL) AND classification-cpv IN (72*)")
rows = list(search(q, ["publication-number", "notice-title", "buyer-name"]))
print(len(rows))
for n in rows[:3]:
    print(n["publication-number"], title(n)[:90])
Enter fullscreen mode Exit fullscreen mode

Run on 25 Nov, this printed 16 Irish IT tenders from 18–24 Nov, for example "Ireland – IT services: consulting, software development, Internet and support – Renewal of …".

What last week looked like

New tender-stage notices on TED, 18–24 Nov 2026 (onlyLatestVersions: true):

Buyer country Notices
Germany 1,638
Poland 1,265
France 996
Spain 496
Italy 332
Netherlands 235
Ireland 104
All countries 8,364

By sector: 1,652 construction works (CPV 45*) and 573 IT services (CPV 72*).

If you'd rather not maintain it

I wrote a longer walkthrough of the query syntax in the TED API guide. I also packaged the script above (iteration, alpha-3 mapping, English titles, open-only filter, estimated values) as an Apify actor with ready-made country feeds, for example Poland and Italy. It charges per result. The script in this post is free to copy.

Disclosure: I built the Rowsift guide and the actor linked above. TED data is reusable under Commission Decision 2011/833/EU with the source acknowledged.

Top comments (0)