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.
404NOT_FOUNDNo tender or organisation with that id. Only Get Tender and Get Organisation return this.
500INTERNAL_ERRORSomething failed on our side. Retry later. The message is always Something went wrong.

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.

python
import requests

res = requests.post(
    "https://api.tenderapi.eu/api/v1/tenders/search",
    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: { "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);
}

Beta. Free to use, no API key required.