APEXReference

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

FieldRequiredTypeRule
loading_countryyesstringExactly 2 characters
unloading_countryyesstringExactly 2 characters
distance_kmyesnumberGreater than 0
loading_postal_codenostringAny string
unloading_postal_codenostringAny string

The body is strict: an unknown field, such as distanceKm, is 422 validation_failed.

Matching ruleEffect
CountriesCompared 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 codesCompared character for character. 50-148 and 50148 are different places.
A postal code left outMatches only a place stored without a postal code. The postal_prefix level needs both postal codes.
postal_prefixUses the first 2 characters of each postal code as sent, with no per-country rule.

Response

FieldTypeValue
estimated_price_eurnumbermedian_price_per_km × distance_km, rounded to 2 decimals
estimated_price_per_kmnumberEqual to median_price_per_km
p25_price_per_kmnumber25th percentile, EUR per km, not rounded
median_price_per_kmnumberMedian, EUR per km, not rounded
p75_price_per_kmnumber75th percentile, EUR per km, not rounded
confidence_scorenumber0 to 1, 2 decimals. See Confidence.
quality_statusstringHIGH, MEDIUM, LOW; INSUFFICIENT_DATA only inside a 422 or a batch item
observation_countintegerObservations at the matched level, each counted once
data_freshness_hoursintegerHours since the newest observation used, rounded to a whole number
match_levelstringexact, 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.

FieldTypeValue
methodstring or nullAlways corridor_median: the median price per km of the matched observations, times distance_km
method_versionstringThe 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_daysinteger or nullOnly observations from this many days back are used. null when no window applies
filter_band_eur_per_kmobject or null{ "min", "max" }: only observations with a price per km in this band are used. null when no band applies
newest_observation_atstring or nullISO 8601 time of the newest observation used
oldest_observation_atstring or nullISO 8601 time of the oldest observation used
matched_corridorobject or nullThe 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_countsarray 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_basisstring or nullThe kind of price observed: asking, executed, mixed, or unknown. Today every source is asking
inputs_usedarray or nullWhat the estimate reads from the request: ["lane", "distance_km"]
distinct_source_countinteger or nullHow 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_levelObservations usedMinimumMultiplier
exactThe lane from the loading place to the unloading place31.0
reverseThe lane from the unloading place to the loading place30.85
postal_prefixEvery lane between places in the two countries whose postal codes start with the two prefixes, in this direction50.7
country_pairEvery observation from the loading country to the unloading country100.6
noneNo 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_statusconfidence_score
HIGH0.5 or more
MEDIUM0.3 to under 0.5
LOWUnder 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.

On this page