Request
This section describes the request method and the contents of each request header. If the request fails, see Troubleshooting for detailed error information.
Request Method
Table 1 Request Method
| Method | URL |
|---|---|
POST | https://apis-navi.kakaomobility.com/v1/destinations/directions |
Request Headers
Table 2 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/destinations/directions" \
-H "Content-Type: application/json" \
-H "Authorization: KakaoAK ${REST_API_KEY}" \ // The REST API key issued from Kakao Developers
-d '{
"origin": {
"x": "127.13144306487084",
"y": " 37.44134209110179"
},
"destinations": [
{
"x": "127.14112393388389",
"y": "37.44558371517034",
"key": "0"
},
{
"x": "127.14192737519186",
"y": "37.4401766683372",
"key": "1"
}
],
"radius": 5000
}'The request parameters are as follows:
Table 3 Request Parameters
| Name | Type | Description | Required |
|---|---|---|---|
origin | Object | Origin | Required |
name | String | Origin name | Optional |
x | Double | X coordinate (longitude) | Required |
y | Double | Y coordinate (latitude) | Required |
destinations | Object[] | Destinations; up to 30 destinations are allowed | Required |
key | String | An arbitrary string to identify each destination | Required |
x | Double | X coordinate (longitude) | Required |
y | Double | Y coordinate (latitude) | Required |
radius | Int | Radius to find routes in meters (Maximum: 10000) | Required |
priority | String | Priority option for route search Use one of the following: TIME: The fastest routeDISTANCE: The shortest route(Default: TIME) | Optional |
avoid | String[] | Restriction options for route search The following values are available: ferries: Ferry routetoll: Toll roadmotorway: Motorwayschoolzone: School zoneuturn: U-turn(Default: null)To use multiple restriction options, connect them as follows (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 lane closures (entire road closed)1: Do not reflect full lane closures near the origin and destinations2: Do not reflect full lane closures in any section(Default: 0) | Optional |
Response
Upon a successful response, the success status of the request is delivered via an HTTP status code, and the response body is delivered in JSON format.
Sample Response
bash
{
"trans_id": "b2520cb429004460a4d5f389d108db38",
"routes": [
{
"result_code": 0,
"result_msg": "길찾기 성공",
"key": "0",
"summary": {
"distance": 1307,
"duration": 307
}
},
{
"result_code": 0,
"result_msg": "길찾기 성공",
"key": "1",
"summary": {
"distance": 1323,
"duration": 320
}
}
]
}The response object information is as follows:
Table 4 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 destination in destinations | 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 |