Skip to content

Errors ​

When something goes wrong, the API responds with an HTTP error status and a small JSON body.

json
{
  "type": "INVALID_REQUEST",
  "message": "unknown source: \"TED\""
}
FieldTypeDescription
typestringMachine readable error category.
messagestringHuman readable explanation. Use it for debugging, not for matching in code.

Status codes ​

StatustypeWhen
400INVALID_REQUESTThe request is malformed or a value is not allowed. See common causes below.
401API_KEY_MISSINGNo Authorization: Bearer header. See Authentication.
401API_KEY_INVALIDThe key is wrong or was deleted. Check for copy mistakes, or create a new key in the dashboard.
401API_KEY_EXPIREDThe key passed its expiry date. Create a new key in the dashboard.
403PLAN_UPGRADE_REQUIREDYour plan doesn't include this feature, for example Organisation Tenders on the free plan. Upgrade your plan.
404NOT_FOUNDNo tender or organisation with that id. Only Get Tender and Get Organisation return this.
429RATE_LIMITEDToo many requests this minute. Wait for the number of seconds in the Retry-After header. See Rate Limits.
429QUOTA_EXCEEDEDYour monthly quota is used up. It resets on the 1st of the month. See Rate Limits.
500INTERNAL_ERRORSomething failed on our side. Retry later. The message is always Something went wrong.

Too many requests with invalid keys from one IP address are also answered with 429 RATE_LIMITED.

Common 400 causes ​

MessageFix
Failed parsing JSON requestThe body is not valid JSON, or a field has the wrong type. Check quotes and that lists are arrays.
Failed parsing query parametersA query parameter has the wrong type, for example limit=abc.
unknown source: "TED"Values are case sensitive. Use the exact lowercase identifiers from Portals.
unknown country: "DE"Countries use three letter codes like DEU. See country codes.
unknown status: "...", unknown sortBy: "..."Use one of the values listed on Search Tenders.
invalid CPV code "4500": expected 8 digitsCPV codes must be exactly 8 digits.
publishedAt.from must not be after publishedAt.untilSwap the dates.
estimatedValue.minValue must not exceed estimatedValue.maxValueSwap the values.
estimatedValue.currency is required, unknown currency: "..."Always send currency with a value filter, using a supported ISO 4217 code like EUR or USD.
invalid cursorThe cursor was changed, or the filters differ from the request that produced it. Start from the first page. See Pagination.
invalid tender id, invalid organisation idIds are UUIDs, for example 0195f1c2-7b3e-7a10-9c4d-3f2a8e6b1d05.

Handling errors ​

Check the HTTP status first. Anything other than 200 means the body is an error object, not a result. For 429 RATE_LIMITED, wait and retry as shown in Rate Limits.

python
import os
import requests

res = requests.post(
    "https://api.tenderapi.eu/api/v1/tenders/search",
    headers={"Authorization": f"Bearer {os.environ['TENDERAPI_KEY']}"},
    json={"sources": ["TED"]},
)
if res.status_code != 200:
    err = res.json()
    print(res.status_code, err["type"], err["message"])
ts
const res = await fetch("https://api.tenderapi.eu/api/v1/tenders/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TENDERAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ sources: ["TED"] }),
});
if (!res.ok) {
  const err = await res.json();
  console.error(res.status, err.type, err.message);
}