Optimal routing API
HTTP API distributes orders between couriers (walking or using a car) and builds delivery routes. Orders are distributed according to their volume, delivery intervals, transportation expenses and other parameters. You can build a route for one or several couriers. In the latter case, the goods are automatically distributed between the couriers.
Yandex builds a route taking into account the traffic situation (traffic jams, blocked roads, road quality and so on). The data on the traffic situation and route accessibility is provided by the Yandex.Maps service.
There are two routing methods:
For multiple couriers
Intended for preliminary calculation of a complicated route. The route can include information about several couriers, vehicles, delivery locations and depots. Orders are distributed among vehicles according to their capacity, working hours and cost of use. For example, you can plan the routes before the couriers start delivering the orders.
The routing may take from several seconds to several minutes, if the request is complex.
We recommend that you send API requests before starting the delivery. The route can't be modified if the vehicles are on their way.
For a single courier
Intended for rebuilding the route in real time. The route is built for a single vehicle. For example, you can rebuild a route created before.
Routing requests are processed within 1 second.
How it works
- A routing task is set using a POST request. The request format is available in the service specification.
- After receiving the task, the routing service starts processing the request.
- The current status of the task is received with a GET request.
- If the task is still in processing, the Yandex.Routing API returns information about the current status.
- If the task is ready, the Yandex.Routing API returns the route in the JSON format.
The Yandex.Routing API limits the number of delivery locations per request:
- To build a route for multiple couriers, you can set up to 1000 delivery locations.
- To build a route for a single courier, you can set up to 250 delivery locations.
Current rates are available on the service page.
You need a license key to work with the Yandex.Routing API. To get a key, fill in the request for connection.