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.
POST /api/v1/estimate returns APEX's estimate for one directed lane. Scope estimate. It
writes nothing and ignores Idempotency-Key.
Request
| Field | Required | Type | Rule |
|---|---|---|---|
loading_country | yes | string | Exactly 2 characters |
unloading_country | yes | string | Exactly 2 characters |
distance_km | yes | number | Greater than 0 |
loading_postal_code | no | string | Any string |
unloading_postal_code | no | string | Any string |
The body is strict: an unknown field, such as distanceKm, is 422 validation_failed.
| Matching rule | Effect |
|---|---|
| Countries | Compared as sent. Only the length is validated, so bg is accepted but matches no place stored as BG. Send upper-case ISO 3166-1 alpha-2 codes. |
| Postal codes | Compared character for character. 50-148 and 50148 are different places. |
| A postal code left out | Matches only a place stored without a postal code. The postal_prefix level needs both postal codes. |
postal_prefix | Uses the first 2 characters of each postal code as sent, with no per-country rule. |
Response
| Field | Type | Value |
|---|---|---|
estimated_price_eur | number | median_price_per_km × distance_km, rounded to 2 decimals |
estimated_price_per_km | number | Equal to median_price_per_km |
p25_price_per_km | number | 25th percentile, EUR per km, not rounded |
median_price_per_km | number | Median, EUR per km, not rounded |
p75_price_per_km | number | 75th percentile, EUR per km, not rounded |
confidence_score | number | 0 to 1, 2 decimals. See Confidence. |
quality_status | string | HIGH, MEDIUM, LOW; INSUFFICIENT_DATA only inside a 422 or a batch item |
observation_count | integer | Observations at the matched level, each counted once |
data_freshness_hours | integer | Hours since the newest observation used, rounded to a whole number |
match_level | string | exact, reverse, postal_prefix, country_pair; none with INSUFFICIENT_DATA |
How the estimate was reached
Every response also carries these eleven fields, INSUFFICIENT_DATA included. A value that does not
exist is null.
| Field | Type | Value |
|---|---|---|
method | string or null | Always corridor_median: the median price per km of the matched observations, times distance_km |
method_version | string | The estimator's version, such as 2026-11.1. It changes whenever the levels, filters, weights or confidence formula change. unversioned when APEX did not report one |
window_days | integer or null | Only observations from this many days back are used. null when no window applies |
filter_band_eur_per_km | object or null | { "min", "max" }: only observations with a price per km in this band are used. null when no band applies |
newest_observation_at | string or null | ISO 8601 time of the newest observation used |
oldest_observation_at | string or null | ISO 8601 time of the oldest observation used |
matched_corridor | object or null | The lane that answered: loading_country, loading_postal, unloading_country, unloading_postal. Full postal codes at exact, the swapped lane at reverse, the 2-character prefixes at postal_prefix, null postal codes at country_pair. null when no level answered |
source_counts | array or null | { "source", "observations" } per source, each observation counted once, largest first. source is an anonymous rank label (source_1, source_2, …) given per answer: it does not name a data provider. null when fewer than three sources contributed, so that a split cannot be read as one provider against another; distinct_source_count still gives the number |
pool_basis | string or null | The kind of price observed: asking, executed, mixed, or unknown. Today every source is asking |
inputs_used | array or null | What the estimate reads from the request: ["lane", "distance_km"] |
distinct_source_count | integer or null | How many distinct sources contributed observations; 0 when none did. null when APEX did not report sources |
- The observations are asking prices. They are prices offered before a deal: a shipper's target price on Transporeon, a rate LKW Walter posts. They are not rates a load moved at.
- Only the lane and the distance are considered. Equipment, weight, load type and date do not change the estimate.
Example
curl -X POST https://tovr.eu/api/v1/estimate \
-H "Authorization: Bearer $TOVR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "loading_country": "BG", "loading_postal_code": "1000", "unloading_country": "DE", "unloading_postal_code": "80331", "distance_km": 1050 }'{
"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",
"method": "corridor_median",
"method_version": "2026-11.1",
"window_days": 365,
"filter_band_eur_per_km": { "min": 0.5, "max": 5.0 },
"newest_observation_at": "2026-11-10T06:12:00Z",
"oldest_observation_at": "2025-12-01T00:00:00Z",
"matched_corridor": {
"loading_country": "BG",
"loading_postal": null,
"unloading_country": "DE",
"unloading_postal": null
},
"source_counts": null,
"pool_basis": "asking",
"inputs_used": ["lane", "distance_km"],
"distinct_source_count": 1
}Here the closer levels had too few observations, and 40 Bulgaria → Germany observations answered. 1.75 × 1,050 km = EUR 1,837.50.
Match levels
match_level | Observations used | Minimum | Multiplier |
|---|---|---|---|
exact | The lane from the loading place to the unloading place | 3 | 1.0 |
reverse | The lane from the unloading place to the loading place | 3 | 0.85 |
postal_prefix | Every lane between places in the two countries whose postal codes start with the two prefixes, in this direction | 5 | 0.7 |
country_pair | Every observation from the loading country to the unloading country | 10 | 0.6 |
none | No level reached its minimum |
APEX tries the levels in this order and answers from the first that reaches its minimum. At every level it uses only observations that have an observed price, a price per km from EUR 0.50 to EUR 5.00, no outlier mark and a date within the last 365 days. LKW Walter observations weigh three times in the percentiles.
Confidence
volume = min(observation_count ÷ 100, 1)
freshness = max(1 − data_freshness_hours ÷ 720, 0.1)
base = round(0.6 × volume + 0.4 × freshness, 2)
confidence_score = round(base × multiplier, 2)quality_status | confidence_score |
|---|---|
HIGH | 0.5 or more |
MEDIUM | 0.3 to under 0.5 |
LOW | Under 0.3 |
Insufficient data
When no level reaches its minimum, the endpoint answers 422 insufficient_market_data. The
zero estimate is in error.details.estimate:
{
"error": {
"type": "invalid_request_error",
"code": "insufficient_market_data",
"message": "There is not enough market data to price this lane. The partial estimate is in `details.estimate`; its `match_level` and `observation_count` say how far the search reached.",
"details": {
"estimate": {
"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",
"method": "corridor_median",
"method_version": "2026-11.1",
"window_days": 365,
"filter_band_eur_per_km": { "min": 0.5, "max": 5.0 },
"newest_observation_at": null,
"oldest_observation_at": null,
"matched_corridor": null,
"source_counts": null,
"pool_basis": null,
"inputs_used": ["lane", "distance_km"],
"distinct_source_count": 0
}
},
"request_id": "req_…",
"doc_url": "https://tovr.eu/docs/tovr/reference/errors#insufficient_market_data"
}
}The other statuses are in Errors.