Batch estimate
POST /api/v1/estimate/batch. Up to 500 lanes in one request, each answered with its own index, and how a lane without data comes back.
POST /api/v1/estimate/batch returns estimates for up to 500 lanes in one request. Scope
estimate. It writes nothing, ignores Idempotency-Key, and counts as one request against your
limits.
Request
| Field | Required | Rule |
|---|---|---|
items | yes | Array of 0 to 500 items |
items[].index | yes | Integer. Your own key for the item; it is echoed back. |
items[].request | yes | The body of a single estimate, with the same rules |
Both levels are strict: an unknown field anywhere is 422 validation_failed, and one invalid
item fails the whole request. An empty items array answers {"results": []}.
curl -X POST https://tovr.eu/api/v1/estimate/batch \
-H "Authorization: Bearer $TOVR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "index": 0, "request": { "loading_country": "BG", "loading_postal_code": "1000", "unloading_country": "DE", "unloading_postal_code": "80331", "distance_km": 1050 } },
{ "index": 1, "request": { "loading_country": "BG", "unloading_country": "PT", "distance_km": 3300 } }
]
}'Response
200 with one entry in results per item. Each entry has index and either result or
error.
{
"results": [
{
"index": 0,
"result": {
"estimated_price_eur": 1837.5,
"estimated_price_per_km": 1.75,
"p25_price_per_km": 1.6,
"median_price_per_km": 1.75,
"p75_price_per_km": 1.95,
"confidence_score": 0.37,
"quality_status": "MEDIUM",
"observation_count": 40,
"data_freshness_hours": 48,
"match_level": "country_pair"
}
},
{
"index": 1,
"result": {
"estimated_price_eur": 0,
"estimated_price_per_km": 0,
"p25_price_per_km": 0,
"median_price_per_km": 0,
"p75_price_per_km": 0,
"confidence_score": 0,
"quality_status": "INSUFFICIENT_DATA",
"observation_count": 0,
"data_freshness_hours": 0,
"match_level": "none"
}
}
]
}| Entry | Meaning |
|---|---|
result with a match_level other than none | An estimate, as for a single lane |
result with quality_status: "INSUFFICIENT_DATA" | No level had enough observations. In a batch this is a result, not a 422. |
error | A string naming why APEX refused the item. TOVR validates every item first, so a valid request does not get one. |
Match on index, not on position. Levels, confidence and filters are the same as for a single
estimate.
Related
Estimate
POST /api/v1/estimate. The request fields and how they are matched, the response fields, the match levels, the confidence formula and the insufficient-data response.
Market analytics
GET /api/v1/market/overview. The period parameter, every field of the response and how it is computed, and how the window is anchored.