Multi-Origin Directions
This API provides route summary information from one or more origins to a single destination. You can set up to 100 origins. For multi-origin routes, the API returns only summary information. To get detailed route information, send a separate request to Driving Directions.
DANGER
You need a REST API key to use this API. To register an app and get a REST API key, see Getting Started.
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/v1/origins/directions100 |
Request Headers
| Parameter | Description |
|---|---|
| Authorization | KakaoAK ${REST_API_KEY} {REST_API_KEY}: The REST API key issued from Kakao Developers |
| Content-Type | application/json |
Sample request
bash
curl -v -X POST "https://apis-navi.kakaomobility.com/v1/waypoints/directions" \
-H "Content-Type: application/json" \
-H "Authorization: KakaoAK ${REST_API_KEY}" \ // The REST API key issued from Kakao Developers
-d '{
"origins": [
{
"x": "127.1331694942593",
"y": "37.4463137562622",
"key": "0"
},
{
"x": "127.13243772760565",
"y": "37.44148514309502",
"key": "1"
}
],
"destination": {
"x": "127.14816492905383",
"y": "37.4401690139602"
},
"radius": 5000
}'The request parameters are as follows:
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
origins | Object | Origin. Up to 100 origins are allowed. | Required |
x | Double | X coordinate (longitude) | Required |
y | Double | Y coordinate (latitude) | Required |
key | String | An arbitrary string to identify each origin | Required |
destination | Object | Destination | Required |
name | String | Destination name | Optional |
x | Double | X coordinate (longitude) | Required |
y | Double | Y coordinate (latitude) | Required |
radius | Int | Radius to find routes in meters (Maximum: 20000) | Required |
priority | String | Set priority options for navigation. Use one of the following: TIME: The fastest routeDISTANCE: The shortest routeNO_TRAFFIC_INFO: The fastest route without considering real-time traffic information(Default: TIME) | Optional |
avoid | String[] | Set restriction options for navigation. Use one or more of the following in the array: ferries: Exclude sea routetoll: Exclude toll roadmotorway: Exclude motorwayschoolzone: Exclude school zoneuturn: Exclude U-turns(Default: null)Use multiple restriction options by connecting them like this: (Example: [" ferries", "motorway"]) | Optional |
roadevent | Int | Option to reflect road closure information caused by traffic incidents (traffic obstructions such as accidents, events, disasters, or road construction)0: Reflect full road closures1: Do not reflect full road closures near the origin and destination.2: Do not reflect any full road closures.(Default: 0) | Optional |
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": "a2653095f26445dba15d736c5714d86a",
"routes": [
{
"result_code": 0,
"result_msg": "길찾기 성공",
"key": "0",
"summary": {
"distance": 2305,
"duration": 615
}
},
{
"result_code": 0,
"result_msg": "길찾기 성공",
"key": "1",
"summary": {
"distance": 1878,
"duration": 408
}
}
]
}The response object information is as follows:
Response object
| Name | Type | Description | Required |
|---|---|---|---|
trans_id | String | Unique identifier of a route request | Required |
routes | Object[] | Route information; one entry is created for each route | Required |
result_code | Int | Route search result code | Required |
result_msg | String | Route search result message | Required |
key | String | The value of key specified for each origin in origins | Required |
summary | Object | Route summary information | Required |
distance | Int | Total distance of the search result in meters | Required |
duration | Int | Time required to reach the destination in seconds | Required |