다크 모드
Multi-Destination
This API provides route information from a single origin to one or more destinations. You can set up to 100 destinations.
DANGER
A REST API key is required to use this API. Please refer to Getting Started for instructions on how to register an app and obtain a REST API key.
Request
This section describes the request method and the required request headers. If the request fails, see Troubleshooting for detailed error information.
Request Method
| Method | URL |
|---|---|
POST | https://apis-navi.kakaomobility.com/affiliate/bicycle/v1/destinations/directions |
Request Headers
| Parameter | Description |
|---|---|
| Authorization | KakaoAK ${REST_API_KEY} {REST_API_KEY}: The API key issued from Kakao Developers |
| service | Arbitrary string to identify the service |
| Content-Type | application/json |
Sample request
bash
curl -v -X POST "https://apis-navi.kakaomobility.com/affiliate/bicycle/v1/destinations/directions" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "service: test" \
-H "Authorization: KakaoAK ${REST_API_KEY}" \ // The API key issued from Kakao Developers
-d '{
"origin": {
"x": 127.11022639567598,
"y": 37.39404121844038
},
"destinations": [
{
"x": 127.10909763718492,
"y": 37.39589794700353
},
{
"x": 127.11374021945907,
"y": 37.39583371633596
}
]
}'The request parameters are as follows:
| Name | Type | Description | Required |
|---|---|---|---|
origin | Object | Departure point | O |
x | Double | X coordinate (longitude) | O |
y | Double | Y coordinate (latitude) | O |
destinations | Object[] | Arrival points. Up to 100 destinations are allowed. | O |
x | Double | X coordinate (longitude) | O |
y | Double | Y coordinate (latitude) | O |
radius | Integer | Radius to find routes in meters (Default: 2000, Maximum: 12000) If no value is entered or a value of 0 or less is entered, the default value will be set. If a value exceeding the maximum is entered, it will be fixed to 12000. | X |
priority | String | Set priority options for route search Use one of the following: DISTANCE: The shortest routeMAIN_STREET: Prefer main roadsBIKE_ROAD: Prefer bicycle-only roads(Default: DISTANCE) | X |
summary | Boolean | Whether to provide summary information onlytrue: Provide summary informationfalse: Do not provide summary information(Default: false) | X |
default_speed | float | Speed setting to use when measuring estimated time of arrival (ETA) Default: 0 (in this case, set to 15 km/h, and if you enter a number other than 0, the estimated time will be measured at that speed.) Minimum: 0, No maximum limit. | X |
Response
Upon successful response, the success status is delivered via HTTP status code, and the request body is delivered in JSON format.
Sample response
bash
{
"trans_id": "0197c3636129712fb845f5f4a69ab00d",
"routes": [
{
"result_code": 0,
"result_message": "길찾기 성공",
"summary": {
"distance": 342,
"duration": 93
},
"sections": [
{
"distance": 342,
"duration": 93,
"roads": [
{
"distance": 24,
"duration": 6,
"vertexes": [
127.11020645291707,
37.39383353475566,
127.10993532242595,
37.39384050499694
]
},
{
"distance": 10,
"duration": 2,
"vertexes": [
127.10993532242595,
37.39384050499694,
127.10988961905323,
37.39388521478862,
127.10988929942614,
37.393912244671725
]
},
{
"distance": 39,
"duration": 19,
"vertexes": [
127.10988929942614,
37.393912244671725,
127.10944888509147,
37.393908928624334
]
},
{
"distance": 32,
"duration": 8,
"vertexes": [
127.10944888509147,
37.393908928624334,
127.10944547402292,
37.39419724733547
]
},
{
"distance": 19,
"duration": 5,
"vertexes": [
127.10944547402292,
37.39419724733547,
127.10945474142122,
37.39436852161211
]
},
{
"distance": 18,
"duration": 4,
"vertexes": [
127.10945474142122,
37.39436852161211,
127.10945292927894,
37.39452169091744
]
},
{
"distance": 13,
"duration": 3,
"vertexes": [
127.10945292927894,
37.39452169091744,
127.10945154351381,
37.39463882038346
]
},
{
"distance": 3,
"duration": 1,
"vertexes": [
127.10945154351381,
37.39463882038346,
127.10945122372073,
37.394665850259905
]
},
{
"distance": 25,
"duration": 6,
"vertexes": [
127.10945122372073,
37.394665850259905,
127.10947114440512,
37.394891269322756
]
},
{
"distance": 24,
"duration": 6,
"vertexes": [
127.10947114440512,
37.394891269322756,
127.10946858608143,
37.395107508322575
]
},
{
"distance": 87,
"duration": 21,
"vertexes": [
127.10946858608143,
37.395107508322575,
127.10945931192892,
37.39589137462884
]
},
{
"distance": 15,
"duration": 4,
"vertexes": [
127.10945931192892,
37.39589137462884,
127.10943512691682,
37.396026353876806
]
},
{
"distance": 33,
"duration": 8,
"vertexes": [
127.10943512691682,
37.396026353876806,
127.10935554290191,
37.39607080825963,
127.10908451095504,
37.39606876648597
]
}
]
}
]
},
{
"result_code": 0,
"result_message": "길찾기 성공",
"summary": {
"distance": 612,
"duration": 157
},
"sections": [
{
"distance": 612,
"duration": 157,
"roads": [
{
"distance": 24,
"duration": 6,
"vertexes": [
127.11020645291707,
37.39383353475566,
127.10993532242595,
37.39384050499694
]
},
{
"distance": 10,
"duration": 2,
"vertexes": [
127.10993532242595,
37.39384050499694,
127.10988961905323,
37.39388521478862,
127.10988929942614,
37.393912244671725
]
},
{
"distance": 93,
"duration": 22,
"vertexes": [
127.10988929942614,
37.393912244671725,
127.10989057703102,
37.39475926595345
]
},
{
"distance": 146,
"duration": 35,
"vertexes": [
127.10989057703102,
37.39475926595345,
127.10986468685842,
37.39599354529187,
127.10993180551668,
37.39604811509296
]
},
{
"distance": 52,
"duration": 12,
"vertexes": [
127.10993180551668,
37.39604811509296,
127.10997655134291,
37.39608449493961,
127.11049602949966,
37.39608840387628
]
},
{
"distance": 73,
"duration": 18,
"vertexes": [
127.11049602949966,
37.39608840387628,
127.11132052533375,
37.396085592544075
]
},
{
"distance": 63,
"duration": 15,
"vertexes": [
127.11132052533375,
37.396085592544075,
127.1120320911381,
37.39608192746175
]
},
{
"distance": 62,
"duration": 15,
"vertexes": [
127.1120320911381,
37.39608192746175,
127.11266449967347,
37.396086674872336,
127.1126989097786,
37.39604187927954
]
},
{
"distance": 46,
"duration": 22,
"vertexes": [
127.1126989097786,
37.39604187927954,
127.11321817572055,
37.396063796185196
]
},
{
"distance": 26,
"duration": 6,
"vertexes": [
127.11321817572055,
37.396063796185196,
127.11325184245167,
37.39608207018842,
127.11350018260829,
37.39609294304976
]
},
{
"distance": 17,
"duration": 4,
"vertexes": [
127.11350018260829,
37.39609294304976,
127.1135020927358,
37.39593076365041
]
}
]
}
]
}
]
}The response object information is as follows:
| Name | Type | Description | Required |
|---|---|---|---|
trans_id | String | Unique identifier of a direction request | O |
routes | Object[] | Route information | O |
result_code | Int | Result code | O |
result_message | String | Result message | O |
summary | Object | Summary information of route | X |
distance | Int | Total distance in meters | O |
duration | Int | Total required time in seconds | O |
sections | Object[] | Route information by section, provided when summary is set to false.If waypoints exist, {number of waypoints + 1} sections (route segments) are created (Example: If there are 2 waypoints, a total of 3 sections are created, section1: origin → waypoint 1 section2: waypoint 1 → waypoint 2 section3: waypoint 2 → destination) | X |
distance | Int | Distance between sections in meters | O |
duration | Int | Total required time in seconds | O |
roads | Object[] | Road information | O |
distance | Int | Length of the road in meters | O |
duration | Int | Estimated travel time in seconds Currently, estimated travel time and actual travel time are set to the same value | O |
vertexes | Double[] | A one-dimensional array composed of X and Y coordinates (Example: [127.10966790676201, 37.394469584427156, 127.10967141980313, 37.39512739646385] ) | O |