Routing (bike, walking, car)
Routing service (a.k.a. turn-by-turn) lets you integrate routing and navigation into a web or mobile application.
tip
When using that, just use our Enterprise Dashboard or guild API Key to create your API Key try for free!
Base URL
The base URL for all API requests is:
https://mapapis.openmap.vn/v1
Endpoint
GET /direction
Example
Request:
/direction?origin=10.78746,106.69855&destination=10.79135,106.70238&vehicle=car&apikey=YOUR_API_KEY
Request params
Param | Description | Example |
---|---|---|
origin | The origin (start) coordinate string (Required) | 21.0267400,105.7740100 |
destination | The destination coordinate string. Split by ; for more than 2 destinations (Required) | 21.0196200,105.8576430 |
alternatives | Boolean, if true , Directions service may return several routes | true |
vehicle | Vehicle type. Options are car , bike , motor , taxi , truck , walking | car |
language | Language of the route instructions. Options are en , vi | en |
Response:
{
"geocoded_waypoints": [
{
"geocoder_status": "OK",
"place_id": "aDpeRUVL2x1AdDRBA7hDHZIKgn98vRK8RgkI4XSm-2rhyHnRCK5GxdCtWThA"
},
{
"geocoder_status": "OK",
"place_id": "PlopbmUIDBBLUVJUyq6O8Ek5XJQE5gr5SqVosbjiqvRJbUINeN1S9U1JHgRg"
}
],
"routes": [
{
"bounds": {},
"legs": [
{
"distance": {
"text": "1.76 km",
"value": 1762
},
"duration": {
"text": "2 minutes",
"value": 143
},
"end_address": "谭木匠, ",
"end_location": {
"lat": 107.91379,
"lng": 1067.02345
},
"start_address": "谭木匠, ",
"start_location": {
"lat": 107.87421,
"lng": 1066.98593
},
"steps": [
{
"distance": {
"text": "280 m",
"value": 280
},
"duration": {
"text": "20 seconds",
"value": 20
},
"end_location": {
"lat": 107.85587,
"lng": 1066.9685
},
"html_instructions": "Start at Nguyễn Đình Chiểu",
"maneuver": "",
"polyline": {
"points": "ydlqSaujojEvN|MpEjEnEdEbG`GtV~T~t@jr@"
},
"start_location": {
"lat": 107.87421,
"lng": 1066.98593
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "316 m",
"value": 316
},
"duration": {
"text": "33 seconds",
"value": 33
},
"end_location": {
"lat": 107.87535,
"lng": 1066.94743
},
"html_instructions": "Turn right onto Phùng Khắc Khoan",
"maneuver": "right",
"polyline": {
"points": "erhqSchgojEc|@baAs{@p`A"
},
"start_location": {
"lat": 107.85587,
"lng": 1066.9685
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "718 m",
"value": 718
},
"duration": {
"text": "53 seconds",
"value": 53
},
"end_location": {
"lat": 107.92129,
"lng": 1066.99339
},
"html_instructions": "Turn right onto Đường Ðiện Biên Phủ",
"maneuver": "right",
"polyline": {
"points": "}klqSmdcojEyY}XmXiX}WaXsBqBeH}Gi^{\\cDcDoKmKgFeFg[wVsCcCyCmE{BaCk]o[qKaK{UcUgP{QiO{V"
},
"start_location": {
"lat": 107.87535,
"lng": 1066.94743
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "36 m",
"value": 36
},
"duration": {
"text": "4 seconds",
"value": 4
},
"end_location": {
"lat": 107.92218,
"lng": 1066.99654
},
"html_instructions": "Turn Nguyễn Bỉnh Khiêm",
"maneuver": "slight right",
"polyline": {
"points": "akuqSuclojE@cAAy@IoAMcAYuASy@YeAYs@]u@Yc@"
},
"start_location": {
"lat": 107.92129,
"lng": 1066.99339
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "279 m",
"value": 279
},
"duration": {
"text": "19 seconds",
"value": 19
},
"end_location": {
"lat": 107.90494,
"lng": 1067.01513
},
"html_instructions": "Turn right onto Nguyễn Bỉnh Khiêm",
"maneuver": "right",
"polyline": {
"points": "spuqSkwlojEbOoPzDmEzG}FbOwPpGiHdQqRxCmDtMkOnM{N"
},
"start_location": {
"lat": 107.92218,
"lng": 1066.99654
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "134 m",
"value": 134
},
"duration": {
"text": "11 seconds",
"value": 11
},
"end_location": {
"lat": 107.91379,
"lng": 1067.02345
},
"html_instructions": "Turn left onto Nguyễn Đình Chiểu",
"maneuver": "left",
"polyline": {
"points": "{drqSqkpojEmm@mk@{GqF"
},
"start_location": {
"lat": 107.90494,
"lng": 1067.01513
},
"travel_mode": "DRIVING"
},
{
"distance": {
"text": "0 m",
"value": 0
},
"duration": {
"text": "0 seconds",
"value": 0
},
"end_location": {
"lat": 107.91379,
"lng": 1067.02345
},
"html_instructions": "You have arrived at your destination",
"maneuver": "right",
"polyline": {
"points": "e|sqSq_rojE??"
},
"start_location": {
"lat": 107.91379,
"lng": 1067.02345
},
"travel_mode": "DRIVING"
}
]
}
],
"overview_polyline": {
"points": "ydlqSaujojEvN|MpEjEnEdEbG`GtV~T~t@jr@c|@baAs{@p`AyY}XmXiX}WaXsBqBeH}Gi^{\\cDcDoKmKgFeFg[wVsCcCyCmE{BaCk]o[qKaK{UcUgP{QiO{V@cAAy@IoAMcAYuASy@YeAYs@]u@Yc@bOoPzDmEzG}FbOwPpGiHdQqRxCmDtMkOnM{Nmm@mk@{GqF"
},
"summary": "",
"warnings": [],
"waypoint_order": []
}
]
}