Get market prices from APEX
Price your own lanes with APEX through the TOVR REST API, one lane or 500 at a time, and find the places in TOVR that already show APEX prices.
APEX is internal, so you reach it through the TOVR REST API. This guide prices the Sofia → Munich lane, then many lanes at once, then reads the market overview.
Before you start: you need access to Settings → Developer, which an owner or admin of your organization has. For each lane you need the loading and unloading countries and the distance in km. Postal codes are optional but give a closer match.
-
Open Settings, then Developer, and create a client application. Under Scopes, tick Price estimates (scope
estimate), and Market analytics (scopemarket) if you want the market overview. The steps are in Create a client application. You see the client secret once. -
Exchange the client id and secret for a bearer token:
curl -X POST https://tovr.eu/api/v1/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=$TOVR_CLIENT_ID" \ -d "client_secret=$TOVR_CLIENT_SECRET"The response holds
access_token, valid for 3,600 seconds. -
Ask for one lane's estimate:
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 }'A
200returns the band and the total, for example a median of EUR 1.75 per km and anestimated_price_eurof 1837.5. The fields are in Estimate. -
Read
match_levelandquality_statusbefore you use the number. Acountry_pairmatch withLOWquality is a rough reference, not a lane price. See Confidence and quality. -
To price many lanes, send up to 500 in one
POST /api/v1/estimate/batch. Each item carries your ownindex, and the request counts as one against your limits. See Batch estimate. -
To see totals for the full-truck-load observations in the store, call
GET /api/v1/market/overview?period=30dwith a token that has themarketscope. See Market analytics.
Prices you already see in TOVR
You do not need the API to use APEX inside TOVR. These places call it for you:
| Where | What APEX supplies |
|---|---|
| The bid dialog on an exchange load | The p25, median and p75 for the lane, combined with your cost floor into a recommended bid. See Pricing a bid. |
| A chain's economics | A market band for the chain's loaded distance. It is asked with countries only, so it is a country-pair band at best. |
| Shipments that arrive without a price | An estimated freight rate, marked as estimated, with its confidence and match level. |
| fOS | The get_price_estimate tool. Its suggested_bid_eur is the p25 times the distance, a market floor reference rather than a selling price. See fOS. |
When APEX has no data for a shipment's lane, TOVR prices it from distance bands instead, with
confidence 0.1 and quality LOW, and asks APEX again every day at 03:30. When APEX cannot be
reached, the shipment stays unpriced until the next sync.
Check that it worked
- Step 3 returns
200with amatch_levelother thannone. - A batch returns one entry in
resultsfor each item you sent, with the sameindex.
If it doesn't work
| Response | Cause | What to do |
|---|---|---|
403 insufficient_scope | The client application lacks the estimate or market scope | Create a client application that has the scope. |
422 validation_failed | A country code is not two characters, distance_km is not positive, or the body has an unknown field such as distanceKm | Fix the field named in details. |
422 insufficient_market_data | No level had enough observations | Add both postal codes, or accept that APEX cannot price the lane. details.estimate shows how far the search reached. |
429 rate_limited | Over your plan's requests per minute | Wait Retry-After seconds. Batch where you can. |
402 quota_exceeded | Over your plan's requests per month | Wait for the next month or change plan. |
500 internal_error | On an estimate: APEX did not answer in time, answered with an error, or returned an unexpected body | Retry with backoff. Quote request_id if it persists. |
503 service_unavailable | On an estimate: APEX is not configured for this environment. On the market overview: APEX is not configured or did not answer with a success | Retry with backoff. |
All codes are in Errors.
Related
Confidence and quality
How APEX scores an estimate's confidence from the number and age of the observations behind it, how the score maps to HIGH, MEDIUM and LOW, and what the score does not measure.
APEX reference
The reference pages for APEX estimates and market data as the TOVR REST API serves them, and the fixed parameters behind them.