Skip to main content

Overview

The Routing API allows you to build routes on the map for transport (including public transport) or on foot.

In a single request, you can build:

  • For public transport: a route option for one set of points using different types of public transport. For routing, use the /public_transport/2.0 endpoint.

    Statistics for public transport

    If you previously used the Public Transport API to build routes for public transport, previous statistics of limit consumption and request distribution for the Public Transport API will remain.

  • For other transportation types:

    • a route option for one set of points
    • routes for multiple pairs of starting and ending points

    For routing, use the /routing/7.0.0/global endpoint.

If it is possible, the API builds multiple route options. You can choose the most suitable route option, considering its total travel time, distance, length of the pedestrian part, and other parameters.

Use the interactive example of building a car route:

To edit the example code, select Source code and then Codepen.

Playground for Routing API

You can also work with Routing API in the playground (no authorization needed).

Main features

Transportation types

  • car

  • taxi

  • bicycle

  • scooter

  • motorcycle

  • truck (with territory limitations)

  • emergency services

  • on foot (including building routes in buildings)

  • public transport:

    • metro
    • bus
    • tram
    • trolleybus
    • shuttle taxi
    • suburban train
    • light metro
    • monorail
    • funicular
    • river transport
    • cable car
    • light rail
    • underground tram

Route parameters

When building routes, you can specify parameters depending on the transportation type and the endpoint to which the request is sent.

All types except public transport

In a request to /routing/7.0.0/global, you can specify:

  • Coordinates of the starting and ending points, including multiple pairs.

  • Intermediate route points (not supported when building routes for multiple pairs of starting and ending points).

  • Transportation type.

  • Filters excluding road types from the route.

  • Filters excluding areas on the map.

  • Result format: full output with route geometry or simplified output with only time and distance.

  • Desired number of route options in the response.

  • Parameter for building the shortest route by time or distance.

  • Parameter for considering traffic jams: in real-time (with regular data updates) or predicted based on statistical data.

    Traffic is considered when calculating the route, but detailed traffic data (for example, color indication or congestion level) is not provided in the API response.

  • Parameter for ignoring road closures.

  • Direction of movement for the starting or ending point.

  • Additionally, for truck transport: vehicle weight and dimensions, type of cargo transported, permit IDs for entry to territories.

In the response, you can receive:

  • Multiple route options, if it is possible to build them.
  • Full geometry of all route segments in the WKT (Well-Known Text) format.
  • Route length and travel time: total and for each segment.
  • Instructions for each route segment: for example, turn right, continue straight, etc.
  • For bicycle and pedestrian routes: elevation change above sea level along the route.
  • Information about special points on the route: for example, the start of a toll road section.
  • Information about the cost of toll road sections, if present on the route.

For detailed information about parameters, see the API Reference.

Public transport

In a request to /public_transport/2.0, you can specify:

  • Start travel time (departure time).
  • Coordinates of the starting and ending points.
  • Intermediate route points.
  • Transportation type.
  • Parameter for considering public transport schedule.
  • Maximum number of route options in the response.
  • Minimum number of direct routes without transfers in the response.

In the response, you can receive:

  • Multiple route options, if it is possible to build them.
  • Full geometry of all route segments in the WKT (Well-Known Text) format.
  • List of public transport routes and stops.
  • Public transport schedule and arrival time at each stop.
  • Total route length, length of the pedestrian part, and travel time.
  • Length of each route segment, travel time, and waiting time for transport.
  • Number of transfers and a list of transfer stops.

For detailed information about parameters, see the API Reference.

Limitations

Route points

In one request, you can specify:

  • For one set of points, including the starting and ending points:

    • for public transport: up to 12 points
    • for pedestrian routes: up to 5 points
    • for other transportation types: up to 10 points
  • For multiple pairs of points: up to 50 pairs of points. Specifying intermediate points is not supported. Available for all transportation types except public transport.

Truck routing

Truck routing is available in the following countries:

  • Azerbaijan
  • Armenia
  • Belarus
  • Georgia
  • Kazakhstan
  • Kyrgyzstan
  • Russia
  • Uzbekistan

Tariffs

  • The service fee is calculated based on the number of requests per month. One request corresponds to building a route for one set of points, including intermediate ones.
  • Building route options in a single request is not charged additionally.
  • When building routes for multiple point pairs, calculations for each point pair are charged. For example, if you specify 5 point pairs (the points field) in one request, 5 calculations are charged.
  • Current prices for services are available in the Platform Manager.

Deployment options

  • Cloud-based: all Routing API methods are available through public 2GIS endpoints.
  • On-Premise: all Routing API methods are available when the 2GIS API Platform is installed in a private network. For more information, see the API Platform for server.

What's next?