Skip to main content

Public Transport API

OpenAPI Specification

2GIS Navigation API (6.0.0)

Route by public transport

Building a route for travel by public transport

Building a route for travel by public transport

query Parameters
key
required
string

Developer API key

Request Body schema: */*
required

Request parameters

boolean or null

If true, the response will include transport schedule.

boolean or null

If true, the pixel attractor is ON.

Locale (string) or null
integer or null

Travel start date and time. Specified as Unix time. If not specified, the current time is used.

required
object (SourceTargetObj)

Route point.

required
object (SourceTargetObj)

Route point.

Array of objects (SourceTargetObj)

Intermediate points in route (max value: 10)

transport
required
Array of strings (CTXTransportType)
Items Enum: "pedestrian" "metro" "light_metro" "suburban_train" "aeroexpress" "tram" "bus" "trolleybus" "shuttle_bus" "monorail" "funicular_railway" "river_transport" "cable_car" "light_rail" "premetro" "mcc" "mcd"
integer or null

Maximum number of travel options in the response

integer or null

Maximum number of вшкусе travel options in the response

Responses

Response Schema: application/json
Array
integer or null

Route variant ID

crossing_count
required
integer >= 0

Number of transfers that require walking to another platform

string or null

Route ID

required
Array of objects (Movement)
pedestrian
required
boolean

If true, the route is completely pedestrian

transfer_count
required
integer >= 0

Number of transfers without changing the platform

total_distance
required
integer >= 0

Distance in meters

total_duration
required
integer >= 0

Estimated travel time in seconds

total_walkway_distance
required
string

Total duration of the walking part of the route as a localized string

Array of CTXTransportType (strings) or null
Array of Waypoint (objects) or null
Array of ScheduleItem (objects) or null
Array of ScheduleEventsItem (objects) or null

Response samples

Content type
application/json
[
  • [
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      },
    • {
      }
    ]
]