APEXReference

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

FieldRequiredRule
itemsyesArray of 0 to 500 items
items[].indexyesInteger. Your own key for the item; it is echoed back.
items[].requestyesThe 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"
      }
    }
  ]
}
EntryMeaning
result with a match_level other than noneAn 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.
errorA 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.

On this page