Skip to main content

Getting started

Follow the steps below to become familiar with Public Transport API features and send a request to build a route.

A request example is provided using cURL.

1. Get an access key

To work with the API of the service, get an access key:

  1. Sign in to the Platform Manager.
  2. Create a demo key or purchase a subscription for using API. For details on service prices, see the Tariffs section.

To work with access keys, you can use the Platform Manager: for details, see the account documentation.

2. Send a request

To build a route, send a POST request to the /public_transport/2.0 endpoint:

  1. In the request URL, pass the API key value in the key parameter:

    https://routing.api.2gis.com/public_transport/2.0?key=API_KEY
  2. In the request body, pass the JSON with the required parameters:

    {
    "source":
    {
    "point":
    {
    "lat": 25.218452,
    "lon": 55.281776
    }
    },
    "target":
    {
    "point":
    {
    "lat": 25.234675,
    "lon": 55.301799
    }
    },
    "transport": ["metro", "bus"],
    "locale": "en"
    }

Request example

curl --request POST \
--url 'https://routing.api.2gis.com/public_transport/2.0?key=API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"source":
{
"point":
{
"lat": 25.218452,
"lon": 55.281776
}
},
"target":
{
"point":
{
"lat": 25.234675,
"lon": 55.301799
}
},
"transport": ["metro", "bus"],
"locale": "en"
}'

Where:

  • source - coordinates of the starting point (latitude and longitude).
  • target - coordinates of the ending point (latitude and longitude).
  • transport - array of public transport types: metro - metro and bus - bus.
  • locale - language of text descriptions of route elements.

For more information about the parameters, see the API Reference.

Response example

The request returns an array of several route options. If no public transport routes can be built, a completely pedestrian route or an empty response is returned depending on the route distance: for more information, see the Transport and transfers section.

Each route option (except a completely pedestrian one) is split into several segments.

A short response example:

[
{
"crossing_count": 2,
"id": "1",
"movements": [
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.278960 25.215640, ...)"
},
...
],
"platforms": [
{
"geometry": "POINT(55.278960 25.215640)",
"id": "40"
},
...
]
}
],
"distance": 4285,
"id": "32",
"moving_duration": 533,
"platforms": {
"names": [
"Emirates Tower 1",
"Emirates Tower 2",
"World Trade Centre Hotel 2",
"Max Metro Bus Stop Landside 2"
]
},
"routes": [
{
"color": "#1a73f0",
"names": [
"27"
],
"subtype": "bus",
"subtype_name": "bus"
}
],
"type": "passage",
"waiting_duration": 900,
"waypoint": {
"combined": false,
"comment": "",
"name": "Emirates Tower Landside Metro Bus Stop",
"subtype": "bus"
}
},
...,
],
"pedestrian": false,
"route_id": "far-abroad-ctx-back...",
"schedules": [
{
"period": 30,
"precise_time": "",
"start_time": 65098,
"start_time_utc": 1766671498,
"type": "periodic"
}
],
"total_distance": 5972,
"total_duration": 2677,
"total_walkway_distance": "on foot 20 min",
"transfer_count": 0,
"transport": [...],
"waypoints": [
{
"combined": false,
"routes_names": [
"27"
],
"subtype": "bus"
},
...
],
},
{
"crossing_count": 0,
"id": "30",
"movements": [
{
"alternatives": [...],
...
},
...
]
},
...
]

Where:

  • crossing_count - number of transfers between stop platforms for the route option. For example, a transfer from metro to bus or a transition between different metro lines. For more information, see the Transport and transfers section.

  • id - route option ID.

  • movements - array with data about route segments. Each segment contains:

    • alternatives:
      • geometry - geometry of the route segment in the WKT (Well-Known Text) format. For more information, see the Route segment geometry section.
      • platforms - coordinates of intermediate stops on the route segment (only for route segments using public transport). For more information, see the Route segment geometry section.
    • distance - length of the route segment in meters. For more information, see the Route segment duration section.
    • id - ID of the route segment.
    • moving_duration - travel time on the route segment in seconds. For more information, see the Route segment duration section.
    • platforms - intermediate stops (only for route segments using public transport). For more information, see the Transport and stops section.
    • routes - public transport routes on the route segment (only for route segments using public transport). For more information, see the Transport and stops section.
    • type - movement type on the route segment. For more information, see the Route segment types section.
    • waiting_duration - transport waiting time on the route segment in seconds. For pedestrian segments, the value is 0. For more information, see the Route segment duration section.
    • waypoint - brief information about the route segment: comment, point or transport type, etc. For more information, see the Route segment types section.
  • pedestrian - whether the route option is completely pedestrian. For more information, see the Transport and transfers section.

  • route_id - unique identifier of the route option.

  • schedules - array with the public transport schedule for the route option. For more information, see the Transport and transfers section.

  • total_distance - total route length in meters. For more information, see the Total route duration section.

  • total_duration - total travel time for the route option in seconds. For more information, see the Total route duration section.

  • total_walkway_distance - total travel time on foot for the route option in a text format. For more information, see the Total route duration section.

  • transfer_count - number of transfers within the same stop platform for the route option. For example, a transfer from one bus route to another. For more information, see the Transport and transfers section.

  • waypoints - brief information about the route option: whether it can be traveled using a single transport type, transport types, etc. For more information, see the Transport and transfers section.

For details on each parameter, see the API Reference and in the sections below.

A full response example:

response.json
[
{
"crossing_count": 1,
"id": "1",
"movements": [
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.281776 25.218452, 55.281775 25.218490)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281775 25.218490, 55.281754 25.218487, 55.281724 25.218480, 55.281698 25.218471, 55.281600 25.218427)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281600 25.218427, 55.281574 25.218492)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281574 25.218492, 55.281575 25.218493, 55.281508 25.218457, 55.281410 25.218402, 55.281274 25.218309, 55.281194 25.218241, 55.281112 25.218161, 55.281032 25.218081, 55.280959 25.218000, 55.280892 25.217915, 55.280803 25.217738, 55.280793 25.217725, 55.280761 25.217696, 55.280722 25.217675, 55.280680 25.217661, 55.280635 25.217657, 55.280592 25.217661, 55.280547 25.217675, 55.280509 25.217696, 55.280475 25.217726, 55.280452 25.217762, 55.280438 25.217799, 55.280432 25.217841, 55.280438 25.217881, 55.280449 25.217913, 55.280520 25.217884)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.280520 25.217884, 55.280218 25.217443, 55.280081 25.217269, 55.280001 25.217172, 55.279968 25.217135, 55.280040 25.217131, 55.280109 25.217115, 55.280226 25.217048, 55.280184 25.216987, 55.280077 25.217049, 55.280027 25.217060, 55.279976 25.217063, 55.279879 25.217040, 55.279678 25.216744, 55.279556 25.216566)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.279556 25.216566, 55.279566 25.216561, 55.279582 25.216553)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.279582 25.216553, 55.279637 25.216633)",
"z_first": 0,
"z_last": 1
},
{
"selection": "LINESTRING(55.279637 25.216633, 55.279883 25.216994, 55.279686 25.217108)",
"z_first": 1,
"z_last": 1
},
{
"selection": "LINESTRING(55.279686 25.217108, 55.279744 25.217218, 55.279796 25.217297, 55.279810 25.217287)",
"z_first": 1,
"z_last": 1
}
]
}
],
"distance": 566,
"id": "2",
"moving_duration": 407,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "570 m on foot",
"name": "",
"subtype": "start"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.279810 25.217287, 55.280134 25.217753, 55.280134 25.217753, 55.283047 25.221950, 55.284193 25.223629, 55.284744 25.224481, 55.284744 25.224481, 55.284979 25.224845, 55.284979 25.224845, 55.285452 25.225577, 55.285452 25.225577, 55.285473 25.225609, 55.285899 25.226127, 55.286588 25.227083, 55.286995 25.227637, 55.287242 25.227887, 55.287497 25.228101, 55.287770 25.228286, 55.287819 25.228311, 55.287819 25.228311, 55.288728 25.228774, 55.289063 25.228985, 55.289351 25.229200, 55.289351 25.229200, 55.289626 25.229454, 55.289911 25.229790, 55.290183 25.230203, 55.290364 25.230515, 55.290364 25.230515, 55.291852 25.233065, 55.291852 25.233065, 55.292066 25.233432)"
}
],
"platforms": [
{
"geometry": "POINT(55.279810 25.217287)",
"id": "8"
},
{
"geometry": "POINT(55.284979 25.224845)",
"id": "9"
},
{
"geometry": "POINT(55.292066 25.233432)",
"id": "10"
}
]
}
],
"distance": 2196,
"id": "3",
"metro": {
"color": "#e90101",
"exit_comment": "to Sheikh Khalifa Bin Zayed Street (North), to Al Jafiliya Bus Station",
"exit_entrance_number": "3",
"line_name": "Red Line 2",
"ui_direction_suggest": "towards «Centrepoint» station",
"ui_station_count": "1 station"
},
"moving_duration": 256,
"platforms": {
"names": [
"World Trade Centre"
],
"penultimate_stop": "World Trade Centre"
},
"routes": null,
"type": "passage",
"waiting_duration": 0,
"waypoint": {
"combined": false,
"comment": "",
"name": "Emirates Towers",
"subtype": "metro"
}
},
{
"alternatives": [
{
"entrances": [
{
"color": "#e90101",
"exit": true,
"exit_comment": "to Sheikh Khalifa Bin Zayed Street (North), to Al Jafiliya Bus Station",
"geometry": "POINT(55.292024 25.233104)",
"metro_logo": "metro_dubai",
"name": "Max",
"number": "3",
"show_other_station": false
}
],
"geometry": [
{
"selection": "LINESTRING(55.292066 25.233432, 55.292081 25.233426, 55.292038 25.233355, 55.291980 25.233258, 55.291917 25.233175)",
"z_first": 1,
"z_last": 1
},
{
"selection": "LINESTRING(55.291917 25.233175, 55.291987 25.233128)",
"z_first": 1,
"z_last": 1
},
{
"selection": "LINESTRING(55.291987 25.233128, 55.292023 25.233104)",
"z_first": 1,
"z_last": 0
},
{
"selection": "LINESTRING(55.292023 25.233104, 55.292112 25.233060)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.292112 25.233060, 55.292474 25.233680)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.292474 25.233680, 55.292499 25.233668)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 136,
"id": "11",
"moving_duration": 127,
"platforms": null,
"routes": null,
"type": "crossing",
"waiting_duration": 0,
"waypoint": {
"comment": "140 m on foot",
"name": "Max",
"subtype": "pedestrian"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.292499 25.233668, 55.292467 25.233616, 55.291924 25.232682, 55.291899 25.232651, 55.291874 25.232626, 55.291848 25.232612, 55.291812 25.232603, 55.291769 25.232604, 55.291715 25.232612, 55.291674 25.232628, 55.291615 25.232674, 55.291615 25.232674, 55.291598 25.232760, 55.291601 25.232831, 55.291616 25.232910, 55.291616 25.232910, 55.291713 25.233158, 55.292015 25.233680, 55.292401 25.234340, 55.292401 25.234340, 55.293100 25.235538, 55.293100 25.235538, 55.293592 25.236236, 55.293809 25.236581, 55.294128 25.237127, 55.294128 25.237127, 55.294980 25.238589, 55.294980 25.238589, 55.295108 25.238823, 55.295135 25.238860, 55.295135 25.238860, 55.295235 25.238912, 55.295318 25.238938, 55.295411 25.238951, 55.295499 25.238952, 55.295577 25.238937, 55.295987 25.238814, 55.295987 25.238814, 55.296469 25.238593, 55.296751 25.238484, 55.297080 25.238347, 55.297353 25.238240, 55.298093 25.237926, 55.298368 25.237814, 55.298368 25.237814, 55.298490 25.237719, 55.298509 25.237664, 55.298519 25.237603, 55.298504 25.237546, 55.298477 25.237479, 55.298439 25.237420, 55.298394 25.237370, 55.298344 25.237325, 55.298344 25.237325, 55.298323 25.237295, 55.298317 25.237269, 55.298323 25.237239, 55.298341 25.237213, 55.298366 25.237195, 55.298400 25.237187, 55.298433 25.237190, 55.298459 25.237202, 55.298459 25.237202, 55.298481 25.237201, 55.298511 25.237194, 55.298511 25.237194, 55.299336 25.236810, 55.299390 25.236790, 55.299465 25.236776, 55.299705 25.236762, 55.299764 25.236750, 55.299817 25.236730, 55.299937 25.236672, 55.299937 25.236672, 55.299957 25.236642, 55.299974 25.236571, 55.299996 25.236536, 55.300025 25.236508, 55.300066 25.236481, 55.300433 25.236282, 55.300605 25.236185, 55.300751 25.236082, 55.300869 25.235979, 55.300988 25.235865, 55.301123 25.235705, 55.301245 25.235524, 55.301341 25.235347, 55.301413 25.235179, 55.301462 25.235013, 55.301492 25.234868, 55.301511 25.234726, 55.301515 25.234642, 55.301515 25.234578, 55.301511 25.234478, 55.301497 25.234375, 55.301470 25.234250)"
}
],
"platforms": [
{
"geometry": "POINT(55.292499 25.233668)",
"id": "16"
},
{
"geometry": "POINT(55.301470 25.234250)",
"id": "17"
}
]
}
],
"distance": 1878,
"id": "12",
"moving_duration": 199,
"platforms": null,
"routes": [
{
"color": "#1a73f0",
"names": [
"F09"
],
"subtype": "bus",
"subtype_name": "bus"
}
],
"type": "passage",
"waiting_duration": 300,
"waypoint": {
"combined": false,
"comment": "",
"name": "Max Metro Bus Stop Landside 2",
"subtype": "bus"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.301470 25.234250, 55.301470 25.234249)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301470 25.234249, 55.301527 25.234245)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301527 25.234245, 55.301549 25.234368, 55.301563 25.234474, 55.301567 25.234547, 55.301567 25.234576)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301567 25.234576, 55.301716 25.234569, 55.301829 25.234564)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301829 25.234564, 55.301824 25.234677)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301824 25.234677, 55.301799 25.234675)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 91,
"id": "18",
"moving_duration": 95,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "91 m on foot",
"name": "Dubai Frame",
"subtype": "pedestrian"
}
},
{
"distance": 0,
"id": "19",
"moving_duration": 0,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "You reach the destination at 17:51.",
"name": "",
"subtype": "finish"
}
}
],
"pedestrian": false,
"route_id": "far-abroad-ctx-back.m9/ctxrouting/17666692775709.41406",
"schedules": [
{
"period": 4,
"precise_time": "",
"start_time": 63524,
"start_time_utc": 1766669924,
"type": "periodic"
}
],
"total_distance": 4867,
"total_duration": 1384,
"total_walkway_distance": "on foot 9 min",
"transfer_count": 1,
"transport": [
"pedestrian",
"bus",
"trolleybus",
"tram",
"shuttle_bus",
"metro",
"suburban_train",
"funicular_railway",
"monorail",
"river_transport",
"cable_car",
"light_rail",
"premetro",
"light_metro",
"aeroexpress",
"mcd",
"mcc"
],
"waypoints": [
{
"combined": false,
"routes_names": [
"Red Line 1",
"Red Line 2",
"Red Line 3"
],
"subtype": "metro"
},
{
"combined": false,
"routes_names": [
"F09"
],
"subtype": "bus"
}
]
},
{
"crossing_count": 0,
"id": "20",
"movements": [
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.281776 25.218452, 55.281775 25.218490)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281775 25.218490, 55.281754 25.218487, 55.281724 25.218480, 55.281698 25.218471, 55.281599 25.218427)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281599 25.218427, 55.281547 25.218561)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281547 25.218561, 55.281539 25.218556, 55.281468 25.218519, 55.281365 25.218462, 55.281222 25.218364, 55.281137 25.218291, 55.281054 25.218209, 55.280972 25.218129, 55.280895 25.218043, 55.280823 25.217951, 55.280734 25.217774, 55.280732 25.217771, 55.280712 25.217753, 55.280687 25.217740, 55.280662 25.217732, 55.280635 25.217729, 55.280609 25.217731, 55.280582 25.217740, 55.280558 25.217753, 55.280539 25.217771, 55.280524 25.217792, 55.280515 25.217816, 55.280512 25.217841, 55.280517 25.217880, 55.280841 25.218354)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.280841 25.218354, 55.280824 25.218364)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 264,
"id": "21",
"moving_duration": 190,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "270 m on foot",
"name": "",
"subtype": "start"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.280824 25.218364, 55.281638 25.219554, 55.281709 25.219633, 55.281774 25.219688, 55.281865 25.219729, 55.281948 25.219750, 55.282036 25.219755, 55.282140 25.219746, 55.282359 25.219711, 55.282478 25.219660, 55.282657 25.219575, 55.283140 25.219305, 55.283583 25.219057, 55.284691 25.218438, 55.284785 25.218385, 55.285491 25.217991, 55.285491 25.217991, 55.286298 25.217543, 55.286298 25.217543, 55.286433 25.217468, 55.286433 25.217468, 55.286495 25.217457, 55.286602 25.217467, 55.286602 25.217467, 55.286715 25.217630, 55.287129 25.218252, 55.287129 25.218252, 55.287436 25.218714, 55.287706 25.219120, 55.287913 25.219419, 55.288014 25.219566, 55.288108 25.219701, 55.288238 25.219890, 55.288665 25.220559, 55.288746 25.220680, 55.288825 25.220787, 55.288893 25.220865, 55.288971 25.220949, 55.289041 25.221027, 55.289072 25.221058, 55.289097 25.221077, 55.289128 25.221098, 55.289240 25.221187, 55.289286 25.221229, 55.289389 25.221340, 55.289486 25.221454, 55.289579 25.221578, 55.289579 25.221578, 55.289830 25.221922, 55.289905 25.222014, 55.289966 25.222086, 55.290132 25.222282, 55.290211 25.222380, 55.290364 25.222568, 55.290557 25.222790, 55.290741 25.223028, 55.290808 25.223113, 55.290925 25.223282, 55.291061 25.223455, 55.291146 25.223562, 55.291255 25.223688, 55.291479 25.223955, 55.291652 25.224160, 55.292080 25.224684, 55.292439 25.225130, 55.292489 25.225188, 55.292489 25.225188, 55.292717 25.225441, 55.292717 25.225441, 55.292456 25.225675, 55.292456 25.225675, 55.292405 25.225736, 55.291984 25.226123, 55.291984 25.226123, 55.291902 25.226199, 55.291576 25.226498, 55.291576 25.226498, 55.291409 25.226651, 55.291011 25.227015, 55.290833 25.227178, 55.290587 25.227420, 55.290409 25.227603, 55.290230 25.227832, 55.290078 25.228104, 55.289970 25.228372, 55.289961 25.228421, 55.289956 25.228470, 55.289961 25.228520, 55.289970 25.228569, 55.289988 25.228614, 55.290020 25.228670, 55.290085 25.228732, 55.290092 25.228745, 55.290092 25.228745, 55.290178 25.228761, 55.290363 25.228800, 55.290495 25.228849, 55.290535 25.228870, 55.290653 25.228956, 55.290716 25.229005, 55.290769 25.229057, 55.290821 25.229121, 55.290874 25.229224, 55.290900 25.229278, 55.290900 25.229278, 55.290939 25.229478, 55.290937 25.229605, 55.290913 25.229732, 55.290878 25.229849, 55.290816 25.229959, 55.290737 25.230047, 55.290628 25.230135, 55.290518 25.230208, 55.290385 25.230280, 55.290376 25.230283, 55.290376 25.230283, 55.290323 25.230444, 55.290311 25.230516, 55.290329 25.230580, 55.290494 25.230858, 55.290775 25.231295, 55.290775 25.231295, 55.291043 25.231757, 55.291362 25.232311, 55.291362 25.232311, 55.291491 25.232569, 55.291491 25.232569, 55.291561 25.232762, 55.291616 25.232910, 55.291616 25.232910, 55.291713 25.233158, 55.292015 25.233680, 55.292401 25.234340, 55.292401 25.234340, 55.293100 25.235538, 55.293100 25.235538, 55.293592 25.236236, 55.293809 25.236581, 55.294128 25.237127, 55.294128 25.237127, 55.294980 25.238589, 55.294980 25.238589, 55.295108 25.238823, 55.295135 25.238860, 55.295135 25.238860, 55.295235 25.238912, 55.295318 25.238938, 55.295411 25.238951, 55.295499 25.238952, 55.295577 25.238937, 55.295987 25.238814, 55.295987 25.238814, 55.296469 25.238593, 55.296751 25.238484, 55.297080 25.238347, 55.297353 25.238240, 55.298093 25.237926, 55.298368 25.237814, 55.298368 25.237814, 55.298490 25.237719, 55.298509 25.237664, 55.298519 25.237603, 55.298504 25.237546, 55.298477 25.237479, 55.298439 25.237420, 55.298394 25.237370, 55.298344 25.237325, 55.298344 25.237325, 55.298323 25.237295, 55.298317 25.237269, 55.298323 25.237239, 55.298341 25.237213, 55.298366 25.237195, 55.298400 25.237187, 55.298433 25.237190, 55.298459 25.237202, 55.298459 25.237202, 55.298481 25.237201, 55.298511 25.237194, 55.298511 25.237194, 55.299336 25.236810, 55.299390 25.236790, 55.299465 25.236776, 55.299705 25.236762, 55.299764 25.236750, 55.299817 25.236730, 55.299937 25.236672, 55.299937 25.236672, 55.299957 25.236642, 55.299974 25.236571, 55.299996 25.236536, 55.300025 25.236508, 55.300066 25.236481, 55.300433 25.236282, 55.300605 25.236185, 55.300751 25.236082, 55.300869 25.235979, 55.300988 25.235865, 55.301123 25.235705, 55.301245 25.235524, 55.301341 25.235347, 55.301413 25.235179, 55.301462 25.235013, 55.301492 25.234868, 55.301511 25.234726, 55.301515 25.234642, 55.301515 25.234578, 55.301511 25.234478, 55.301497 25.234375, 55.301470 25.234250)"
}
],
"platforms": [
{
"geometry": "POINT(55.280824 25.218364)",
"id": "26"
},
{
"geometry": "POINT(55.301470 25.234250)",
"id": "27"
}
]
}
],
"distance": 4545,
"id": "22",
"moving_duration": 439,
"platforms": null,
"routes": [
{
"color": "#1a73f0",
"names": [
"T10"
],
"subtype": "bus",
"subtype_name": "bus"
}
],
"type": "passage",
"waiting_duration": 1800,
"waypoint": {
"combined": false,
"comment": "",
"name": "Museum of the Future",
"subtype": "bus"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.301470 25.234250, 55.301470 25.234249)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301470 25.234249, 55.301527 25.234245)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301527 25.234245, 55.301549 25.234368, 55.301563 25.234474, 55.301567 25.234547, 55.301567 25.234576)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301567 25.234576, 55.301716 25.234569, 55.301829 25.234564)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301829 25.234564, 55.301824 25.234677)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301824 25.234677, 55.301799 25.234675)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 91,
"id": "28",
"moving_duration": 95,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "91 m on foot",
"name": "Dubai Frame",
"subtype": "pedestrian"
}
},
{
"distance": 0,
"id": "29",
"moving_duration": 0,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "You reach the destination at 18:10.",
"name": "",
"subtype": "finish"
}
}
],
"pedestrian": false,
"route_id": "far-abroad-ctx-back.m9/ctxrouting/17666692775711.76172",
"schedules": [
{
"period": 60,
"precise_time": "",
"start_time": 66667,
"start_time_utc": 1766673067,
"type": "periodic"
}
],
"total_distance": 4900,
"total_duration": 2524,
"total_walkway_distance": "on foot 4 min",
"transfer_count": 0,
"waypoints": [
{
"combined": false,
"routes_names": [
"T10"
],
"subtype": "bus"
}
]
},
{
"crossing_count": 0,
"id": "30",
"movements": [
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.281776 25.218452, 55.281775 25.218490)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281775 25.218490, 55.281754 25.218487, 55.281724 25.218480, 55.281698 25.218471, 55.281600 25.218427)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281600 25.218427, 55.281574 25.218492)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.281574 25.218492, 55.281575 25.218493, 55.281508 25.218457, 55.281410 25.218402, 55.281274 25.218309, 55.281194 25.218241, 55.281112 25.218161, 55.281032 25.218081, 55.280959 25.218000, 55.280892 25.217915, 55.280803 25.217738, 55.280793 25.217725, 55.280761 25.217696, 55.280722 25.217675, 55.280680 25.217661, 55.280635 25.217657, 55.280592 25.217661, 55.280547 25.217675, 55.280509 25.217696, 55.280475 25.217726, 55.280452 25.217762, 55.280438 25.217799, 55.280432 25.217841, 55.280438 25.217881, 55.280449 25.217913, 55.280520 25.217884)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.280520 25.217884, 55.280218 25.217443, 55.280081 25.217269, 55.280001 25.217172, 55.279968 25.217135, 55.280040 25.217131, 55.280109 25.217115, 55.280226 25.217048, 55.280184 25.216987, 55.280077 25.217049, 55.280027 25.217060, 55.279976 25.217063, 55.279879 25.217040, 55.279678 25.216744, 55.279533 25.216532, 55.279282 25.216162)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.279282 25.216162, 55.279286 25.216160, 55.279305 25.216147, 55.279222 25.216026, 55.279178 25.215960, 55.279105 25.215760, 55.279073 25.215713, 55.279005 25.215613, 55.278960 25.215639)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 585,
"id": "31",
"moving_duration": 421,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "590 m on foot",
"name": "",
"subtype": "start"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.278960 25.215640, 55.279047 25.215767, 55.279088 25.215853, 55.279115 25.215927, 55.279136 25.215986, 55.279136 25.215986, 55.279855 25.217043, 55.279855 25.217043, 55.279919 25.217070, 55.279974 25.217084, 55.280031 25.217081, 55.280086 25.217067, 55.280240 25.216980, 55.280348 25.216914, 55.280603 25.216754, 55.280833 25.216609, 55.281015 25.216493, 55.281161 25.216406, 55.281202 25.216381, 55.281202 25.216381, 55.281260 25.216334, 55.281305 25.216298, 55.281323 25.216277, 55.281323 25.216277, 55.281362 25.216228, 55.281438 25.216081, 55.281438 25.216081, 55.281431 25.216031, 55.281434 25.215975, 55.281449 25.215920, 55.281473 25.215868, 55.281507 25.215820, 55.281549 25.215779, 55.281581 25.215758, 55.281599 25.215745, 55.281654 25.215720, 55.281714 25.215703, 55.281776 25.215697, 55.281838 25.215700, 55.281898 25.215713, 55.281952 25.215733, 55.281952 25.215733, 55.282057 25.215711, 55.282144 25.215693, 55.282226 25.215664, 55.282327 25.215617, 55.282420 25.215546, 55.282442 25.215533, 55.282541 25.215477, 55.282712 25.215381, 55.282901 25.215279, 55.283020 25.215211, 55.283049 25.215173, 55.283070 25.215150, 55.283172 25.215091, 55.283296 25.215021, 55.283346 25.214996, 55.283711 25.214797, 55.283727 25.214791, 55.283763 25.214787, 55.283831 25.214796, 55.283847 25.214793, 55.283868 25.214783, 55.284015 25.214693, 55.284220 25.214587, 55.284322 25.214534, 55.284322 25.214534, 55.284566 25.214398, 55.284566 25.214398, 55.284635 25.214493, 55.284671 25.214548, 55.284817 25.214764, 55.284941 25.214950, 55.285129 25.215229, 55.285342 25.215545, 55.285342 25.215545, 55.285418 25.215659, 55.285487 25.215751, 55.285558 25.215858, 55.285617 25.215928, 55.285671 25.216011, 55.285792 25.216199, 55.285976 25.216490, 55.285976 25.216490, 55.286443 25.217239, 55.286602 25.217467, 55.286602 25.217467, 55.286715 25.217630, 55.287129 25.218252, 55.287129 25.218252, 55.287436 25.218714, 55.287706 25.219120, 55.287913 25.219419, 55.288014 25.219566, 55.288108 25.219701, 55.288238 25.219890, 55.288665 25.220559, 55.288746 25.220680, 55.288825 25.220787, 55.288893 25.220865, 55.288971 25.220949, 55.289041 25.221027, 55.289072 25.221058, 55.289097 25.221077, 55.289128 25.221098, 55.289240 25.221187, 55.289286 25.221229, 55.289389 25.221340, 55.289486 25.221454, 55.289579 25.221578, 55.289579 25.221578, 55.289830 25.221922, 55.289905 25.222014, 55.289966 25.222086, 55.290132 25.222282, 55.290211 25.222380, 55.290364 25.222568, 55.290557 25.222790, 55.290741 25.223028, 55.290808 25.223113, 55.290925 25.223282, 55.291061 25.223455, 55.291146 25.223562, 55.291255 25.223688, 55.291479 25.223955, 55.291652 25.224160, 55.292080 25.224684, 55.292439 25.225130, 55.292489 25.225188, 55.292489 25.225188, 55.292717 25.225441, 55.292717 25.225441, 55.292456 25.225675, 55.292456 25.225675, 55.292405 25.225736, 55.291984 25.226123, 55.291984 25.226123, 55.291902 25.226199, 55.291576 25.226498, 55.291576 25.226498, 55.291409 25.226651, 55.291011 25.227015, 55.290833 25.227178, 55.290587 25.227420, 55.290409 25.227603, 55.290230 25.227832, 55.290078 25.228104, 55.289970 25.228372, 55.289961 25.228421, 55.289956 25.228470, 55.289961 25.228520, 55.289970 25.228569, 55.289988 25.228614, 55.290020 25.228670, 55.290085 25.228732, 55.290092 25.228745, 55.290092 25.228745, 55.290178 25.228761, 55.290363 25.228800, 55.290495 25.228849, 55.290535 25.228870, 55.290653 25.228956, 55.290716 25.229005, 55.290769 25.229057, 55.290821 25.229121, 55.290874 25.229224, 55.290900 25.229278, 55.290900 25.229278, 55.290939 25.229478, 55.290937 25.229605, 55.290913 25.229732, 55.290878 25.229849, 55.290816 25.229959, 55.290737 25.230047, 55.290628 25.230135, 55.290518 25.230208, 55.290385 25.230280, 55.290376 25.230283, 55.290376 25.230283, 55.290323 25.230444, 55.290311 25.230516, 55.290329 25.230580, 55.290494 25.230858, 55.290775 25.231295, 55.290775 25.231295, 55.291043 25.231757, 55.291362 25.232311, 55.291362 25.232311, 55.291491 25.232569, 55.291491 25.232569, 55.291561 25.232762, 55.291616 25.232910, 55.291616 25.232910, 55.291713 25.233158, 55.292015 25.233680, 55.292401 25.234340, 55.292401 25.234340, 55.292422 25.234355, 55.292442 25.234358, 55.292463 25.234355, 55.292700 25.234244, 55.292720 25.234225, 55.292733 25.234198, 55.292740 25.234174, 55.292745 25.234132, 55.292744 25.234102, 55.292738 25.234067, 55.292499 25.233668, 55.292499 25.233668, 55.292467 25.233616, 55.291924 25.232682, 55.291899 25.232651, 55.291874 25.232626, 55.291848 25.232612, 55.291812 25.232603, 55.291769 25.232604, 55.291715 25.232612, 55.291674 25.232628, 55.291615 25.232674, 55.291615 25.232674, 55.291598 25.232760, 55.291601 25.232831, 55.291616 25.232910, 55.291616 25.232910, 55.291713 25.233158, 55.292015 25.233680, 55.292401 25.234340, 55.292401 25.234340, 55.293100 25.235538, 55.293100 25.235538, 55.293592 25.236236, 55.293809 25.236581, 55.294128 25.237127)"
}
],
"platforms": [
{
"geometry": "POINT(55.278960 25.215640)",
"id": "40"
},
{
"geometry": "POINT(55.285342 25.215545)",
"id": "41"
},
{
"geometry": "POINT(55.287129 25.218252)",
"id": "42"
},
{
"geometry": "POINT(55.291576 25.226498)",
"id": "43"
},
{
"geometry": "POINT(55.292499 25.233668)",
"id": "44"
},
{
"geometry": "POINT(55.294128 25.237127)",
"id": "45"
}
]
}
],
"distance": 4285,
"id": "32",
"moving_duration": 533,
"platforms": {
"names": [
"Emirates Tower 1",
"Emirates Tower 2",
"World Trade Centre Hotel 2",
"Max Metro Bus Stop Landside 2"
]
},
"routes": [
{
"color": "#1a73f0",
"names": [
"27"
],
"subtype": "bus",
"subtype_name": "bus"
}
],
"type": "passage",
"waiting_duration": 900,
"waypoint": {
"combined": false,
"comment": "",
"name": "Emirates Tower Landside Metro Bus Stop",
"subtype": "bus"
}
},
{
"alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.294128 25.237127, 55.294133 25.237125)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.294133 25.237125, 55.294059 25.237000)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.294059 25.237000, 55.294054 25.236958, 55.294064 25.236912, 55.294116 25.236869, 55.294282 25.236788, 55.294623 25.237366, 55.294705 25.237490, 55.294735 25.237626, 55.294747 25.237707, 55.294766 25.237790, 55.294798 25.237866, 55.294883 25.237973, 55.295018 25.238051, 55.295103 25.238094, 55.295202 25.238141, 55.295290 25.238175, 55.295388 25.238211, 55.295522 25.238250, 55.295605 25.238274, 55.295730 25.238303, 55.295858 25.238326, 55.295982 25.238346, 55.296126 25.238359, 55.296267 25.238361, 55.296392 25.238356, 55.296530 25.238341, 55.296666 25.238323, 55.296784 25.238299, 55.296912 25.238268, 55.297043 25.238231, 55.297168 25.238189, 55.297258 25.238146, 55.297853 25.237860, 55.297927 25.237796, 55.297961 25.237752, 55.297982 25.237697, 55.298027 25.237476, 55.298101 25.237401, 55.298184 25.237347, 55.298239 25.237304, 55.298258 25.237288, 55.298282 25.237260, 55.298321 25.237200, 55.298354 25.237176, 55.298395 25.237166, 55.298435 25.237168, 55.298445 25.237173, 55.298470 25.237173, 55.298489 25.237170, 55.298551 25.237153, 55.298707 25.237079, 55.299012 25.236938, 55.299048 25.237002, 55.299307 25.236881, 55.299358 25.236857, 55.299433 25.236830, 55.299712 25.236813, 55.299803 25.236795, 55.300013 25.236693, 55.299975 25.236630, 55.300156 25.236542, 55.301051 25.236107, 55.301056 25.236105, 55.301178 25.236034, 55.301326 25.235925, 55.301486 25.235734, 55.301569 25.235603, 55.301632 25.235480, 55.301700 25.235315, 55.301759 25.235124, 55.301798 25.234940, 55.301821 25.234733, 55.301824 25.234677)",
"z_first": 0,
"z_last": 0
},
{
"selection": "LINESTRING(55.301824 25.234677, 55.301799 25.234675)",
"z_first": 0,
"z_last": 0
}
]
}
],
"distance": 1102,
"id": "46",
"moving_duration": 823,
"platforms": null,
"routes": null,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "1,2 km on foot",
"name": "Department of Health 2",
"subtype": "pedestrian"
}
},
{
"distance": 0,
"id": "47",
"moving_duration": 0,
"type": "walkway",
"waiting_duration": 0,
"waypoint": {
"comment": "You reach the destination at 18:12.",
"name": "",
"subtype": "finish"
}
}
],
"pedestrian": false,
"route_id": "far-abroad-ctx-back.m9/ctxrouting/17666692775712.33203",
"schedules": [
{
"period": 30,
"precise_time": "",
"start_time": 65098,
"start_time_utc": 1766671498,
"type": "periodic"
}
],
"total_distance": 5972,
"total_duration": 2677,
"total_walkway_distance": "on foot 20 min",
"transfer_count": 0,
"waypoints": [
{
"combined": false,
"routes_names": [
"27"
],
"subtype": "bus"
}
]
}
]

Route options

For each route option, the following are calculated: duration, used transport, number of transfers, and data about the route segments (full geometry, duration, transport, and other).

The ID of each route option within the response is returned in the id field, and the unique option identifier is returned in the route_id field:

    "id": "1", // route option ID
"route_id": "far-abroad-ctx-back.m9/ctxrouting/176..." // route option unique identifier

Total route duration

The duration of each route option is returned in the fields:

  • total_distance - total route length in meters.
  • total_duration - total travel time in seconds.
  • total_walkway_distance - total travel time on foot in a text format.
    "total_distance": 4867 // total route length is 4,867 meters
"total_duration": 1384, // total travel time is about 23 minutes
"total_walkway_distance": "walking 9 min" // of which 9 minutes are on foot

Transport and transfers

For each route option, the response indicates which transport types are used and how many transfers are needed.

If it is not possible to build a route for the selected transport types (for example, they are not available on the territory between route points):

  • A completely pedestrian route between points is returned if it is shorter than 3.5 km. The pedestrian field in the response contains the value true.
  • If the pedestrian route is longer than 3.5 km, an empty response is returned.

The waypoints field contains a list of all transport routes used in all route segments:

  • combined - whether the segment can be traveled using different transport types.
  • routes_names - names of public transport routes.
  • subtype - public transport type.

For example, the current route contains one segment by metro and one segment by bus:

      "waypoints": [
{
"combined": false, // the segment can be traveled only by metro
"routes_names": [
"Red Line 1",
"Red Line 2",
"Red Line 3"
],
"subtype": "metro"
},
{
"combined": false,
"routes_names": [
"F09"
],
"subtype": "bus"
}
]

The number of transfers used in the route option is specified in the fields:

  • crossing_count - number of transfers between stop platforms. For example, a transfer from metro to bus or a transition between different metro lines.
  • transfer_count - number of transfers within the same stop platform. For example, a transfer from one bus route to another.
    "crossing_count": 2 // transfers between platforms
"transfer_count": 2, // transfers within one platform

The schedules array contains the transport schedule on the route. Each element of the array contains:

  • period - transport period in minutes. If transport operates on a fixed schedule, the field is absent.
  • precise_time - arrival time of the transport at the stop in HH:MM format. If transport operates periodically, the field is empty.
  • start_time - arrival time at the stop by local time in Unix format.
  • start_time_utc - arrival time at the stop in by UTC in Unix format.
  • type - schedule type: precise - fixed, periodic - periodic.
  • origin_from - whether the predicted schedule was used. Returned only for the fixed schedule ("type": "precise"). Possible value: eta.
    "schedules": [
{
"precise_time": "13:24", // arrival time in HH:MM format
"start_time": 48240, // arrival time in Unix (local time)
"start_time_utc": 1766571840, // arrival time in Unix (UTC)
"type": "precise", // schedule type is fixed
"origin_from": "eta" // predicted schedule was used
},
...
],
...
"schedules": [
{
"period": 30, // interval between transport arrivals at the stop is 30 minutes
"precise_time": "",
"start_time": 65098, // arrival time in Unix (local time)
"start_time_utc": 1766671498, // arrival time in Unix (UTC)
"type": "periodic" // schedule type is periodic
},
...
]

Route segments

Each route option can be divided into several segments. The list of segments is returned in the movements array.

For example, a bus route without transfers can consist of four segments:

  1. Walking from the starting route point to the boarding bus stop.
  2. Traveling several stops by bus.
  3. Walking from the final bus stop to the ending route point.
  4. An additional segment containing only the ending point coordinates.

The identifier of each route segment is returned in the movements.id field.

Route segment types

The movement type for each route segment is returned in the type field:

  • walkway - pedestrian segment (to the boarding stop and from the final stop).
  • passage - traveling by public transport.
  • crossing - transition between stop platforms. Considered in the crossing_count field.

The waypoint field contains brief information about the route segment:

  • combined - whether the segment can be traveled using different transport types.
  • comment - additional info about the segment (for example, distance to the stop).
  • name - stop name.
  • subtype - point type (route start or finish) or transportation type.

An example for a pedestrian segment:

    "type": "walkway", // pedestrian route segment
"waypoint": {
"comment": "570 m on foot",
"name": "",
"subtype": "start" // point type is the start of the route
}

An example for a public transport segment:

    "type": "passage", // traveling by transport
"waypoint": {
"combined": false, // segment can be traveled only by bus
"comment": "",
"name": "Max Metro Bus Stop Landside 2", // boarding stop name
"subtype": "bus" // transportation type is bus
}

An example of a platform transition:

      "type": "crossing", // transition between platforms
"waypoint": {
"comment": "140 m on foot",
"name": "Max", // name of the metro transfer station
"subtype": "pedestrian" // transportation type is on foot
}

An example for the destination point:

  {
"type": "walkway",
"waypoint": {
"comment": "You reach the destination at 17:51.", // arrival time at the ending route point
"name": "",
"subtype": "finish" // point type is the end of the route
}
}

Route segment geometry

Route segment geometry in the WKT format is returned as a line or a set of lines (LINESTRING) in the alternatives.geometry array:

    "alternatives": [
{
"geometry": [
{
"selection": "LINESTRING(55.281776 25.218452, 55.281775 25.218490)",
"z_first": 0,
"z_last": 0
},
...
]
}
]

For public transport segments, stop coordinates are provided as points (POINT) in the alternatives.platforms array:

    "alternatives": [
{
"geometry": [
{
"selection":"LINESTRING(55.279810 25.217287, 55.280134 25.217753, ...)"
},
...
],
"platforms": [
{
"geometry": "POINT(55.279810 25.217287)",
"id": "8"
},
{
"geometry": "POINT(55.284979 25.224845)",
"id": "9"
},
...
]
}
]

Route segment duration

The duration of each route segment is returned in the movements array in the fields:

  • distance - segment length in meters.
  • moving_duration - travel time on the segment in seconds.
  • waiting_duration - waiting time on the segment. For pedestrian segments, the value is 0.
    "movements": [
{
...
"distance": 566, // segment length is 566 m
"moving_duration": 407, // travel time on the segment is about 7 minutes
"waiting_duration": 0 // waiting time is 0 seconds since this is a pedestrian segment
},
...
]

Transport and stops

For public transport segments, the movements array returns additional fields: platforms, routes, and metro (when using the metro).

The platforms field contains the names of all intermediate stops on the route segment: all stops except boarding and landing. The last intermediate stop in the list is the stop after which you should get off:

    "movements": [
{
...
"platforms": {
"names": [
"Emirates Tower 1",
"Emirates Tower 2",
"World Trade Centre Hotel 2",
"Max Metro Bus Stop Landside 2"
]
},
},
...
]

The routes field contains a list of all transport routes that can be used for traveling the current segment:

  • color - route color on the map in HEX format.
  • names - names of public transport routes.
  • subtype - public transport type.
  • subtype_name - name of the public transport type in a text format.

For example, the current segment can be traveled by bus No. F09:

    "movements": [
{
...
"routes": [
{
"color": "#1a73f0", // route color
"names": [
"F09"
], // route numbers
"subtype": "bus", // transport type
"subtype_name": "bus" // name of the transport type
}
]
},
...
]

If the route segment can be traveled by metro, the metro field includes the following parameters:

  • color - metro line color on the map in HEX format.
  • exit_comment - comment for the metro exit.
  • exit_entrance_number - metro exit number.
  • line_name - metro line name.
  • ui_direction_suggest - direction of travel.
  • ui_station_count - number of metro stations.

Example:

    "movements": [
{
...
"metro": {
"color": "#e90101", // metro line color
"exit_comment": "to Sheikh Khalifa Bin Zayed Street (North), to Al Jafiliya Bus Station", // metro exit
"exit_entrance_number": "3", // exit number
"line_name": "Red Line 2", // line name
"ui_direction_suggest": "towards «Centrepoint» station", // direction of travel
"ui_station_count": "1 station" // number of stations
},
},
...
]
...

What's next?