다크 모드
Multi-Origin
This API provides route information from one or more origins to a single destination. You can set up to 100 origins.
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/origins/directions |
Request Headers
| Parameter | Description |
|---|---|
| Authorization | KakaoAK ${REST_API_KEY} {REST_API_KEY}: The API key issued from Kakao Developers |
| service | Arbitrary string to distinguish services |
| Content-Type | application/json |
Sample request
bash
curl -v -X POST "https://apis-navi.kakaomobility.com/affiliate/bicycle/v1/origins/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 '{
"origins": [
{
"x": 127.10909763718492,
"y": 37.39589794700353
},
{
"x": 127.11374021945907,
"y": 37.39583371633596
}
],
"destination": {
"x": 127.11022639567598,
"y": 37.39404121844038
}
}'The request parameters are as follows:
| Name | Type | Description | Required |
|---|---|---|---|
origins | Object[] | Departure point. Up to 100 origins are allowed. | O |
x | Double | X coordinate (longitude) | O |
y | Double | Y coordinate (latitude) | O |
destination | Object | Arrival point | O |
x | Double | X coordinate (longitude) | O |
y | Double | Y coordinate (latitude) | O |
radius | Integer | Route search radius in meters between origin and destination (Default: 2000, Maximum: 12000) If no value is entered, or if 0 or a negative value is entered, the default value is set. If a value exceeding the maximum is entered, it is fixed to the maximum value of 12000. | X |
priority | String | Route search priority option Use one of the following: DISTANCE: Shortest routeMAIN_STREET: Main street priorityBIKE_ROAD: Bicycle-only road priority(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, it is set to 15 km/h, and if a number other than 0 is entered, the estimated time is measured at that speed.) Minimum: 0, Maximum: No 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": "01872690b462710f821af295cecf28b9",
"routes": [
{
"result_code": 0,
"result_message": "성공",
"summary": {
"distance": 336,
"duration": 337
},
"sections": [
{
"distance": 336,
"duration": 337,
"roads": [
{
"distance": 30,
"duration": 27,
"vertexes": [
127.10908798259713,
37.396048904441905,
127.10939289367556,
37.39605119783509,
127.10941569256795,
37.39603334775928
]
},
// … Code omitted
{
"distance": 93,
"duration": 84,
"vertexes": [
127.11123624251599,
37.39392949433143,
127.1106829007183,
37.393925340492096,
127.11049166915824,
37.39386082897841,
127.11020924587568,
37.393867718189924
]
}
]
}
]
}
]
}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 directions | X |
distance | Int | Total distance in meters | O |
duration | Int | Total required time in seconds | O |
sections | Object[] | Route information by section. Information is provided when summary is set to false.When 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 | Section distance in meters | O |
duration | Int | Total travel time in seconds | O |
roads | Object[] | Road information | O |
distance | Int | Road length 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[] | One-dimensional array of X and Y coordinates (Example: [127.10966790676201, 37.394469584427156, 127.10967141980313, 37.39512739646385] ) | O |