GET Route
curl --request POST \
--url https://api.aisa.one/apis/v1/graphhopper/get-route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"optimize": "false",
"point": [
"<string>"
],
"profile": "car"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload = {
"optimize": "false",
"point": ["<string>"],
"profile": "car"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({optimize: 'false', point: ['<string>'], profile: 'car'})
};
fetch('https://api.aisa.one/apis/v1/graphhopper/get-route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/graphhopper/get-route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'optimize' => 'false',
'point' => [
'<string>'
],
'profile' => 'car'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload := strings.NewReader("{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/graphhopper/get-route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/graphhopper/get-route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}"
response = http.request(request)
puts response.read_body{
"info": {
"copyrights": [
"<string>"
],
"took": 123,
"road_data_timestamp": "<string>"
},
"paths": [
{
"distance": 123,
"time": 123,
"ascend": 123,
"bbox": [
123
],
"descend": 123,
"details": {},
"instructions": [
{
"distance": 123,
"interval": [
123
],
"sign": 123,
"text": "<string>",
"time": 123,
"exit_number": 123,
"heading": 123,
"last_heading": 123,
"street_destination": "<string>",
"street_name": "<string>",
"street_ref": "<string>",
"turn_angle": 123
}
],
"legs": [
{}
],
"points": "<string>",
"points_encoded": true,
"points_encoded_multiplier": 123,
"points_order": [
123
],
"snapped_waypoints": "<string>",
"transfers": 123,
"weight": 123
}
],
"hints": {}
}GraphHopper
GET Route
GET Route
POST
https://api.aisa.one
/
apis
/
v1
/
graphhopper
/
get-route
GET Route
curl --request POST \
--url https://api.aisa.one/apis/v1/graphhopper/get-route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"optimize": "false",
"point": [
"<string>"
],
"profile": "car"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload = {
"optimize": "false",
"point": ["<string>"],
"profile": "car"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({optimize: 'false', point: ['<string>'], profile: 'car'})
};
fetch('https://api.aisa.one/apis/v1/graphhopper/get-route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/graphhopper/get-route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'optimize' => 'false',
'point' => [
'<string>'
],
'profile' => 'car'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload := strings.NewReader("{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/graphhopper/get-route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/graphhopper/get-route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"optimize\": \"false\",\n \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\"\n}"
response = http.request(request)
puts response.read_body{
"info": {
"copyrights": [
"<string>"
],
"took": 123,
"road_data_timestamp": "<string>"
},
"paths": [
{
"distance": 123,
"time": 123,
"ascend": 123,
"bbox": [
123
],
"descend": 123,
"details": {},
"instructions": [
{
"distance": 123,
"interval": [
123
],
"sign": 123,
"text": "<string>",
"time": 123,
"exit_number": 123,
"heading": 123,
"last_heading": 123,
"street_destination": "<string>",
"street_name": "<string>",
"street_ref": "<string>",
"turn_angle": 123
}
],
"legs": [
{}
],
"points": "<string>",
"points_encoded": true,
"points_encoded_multiplier": 123,
"points_order": [
123
],
"snapped_waypoints": "<string>",
"transfers": 123,
"weight": 123
}
],
"hints": {}
}请求规范
- 方法与路径: POST /apis/v1/graphhopper/get-route
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/graphhopper/get-route
{
"operationId": "graphhopper.get-route",
"method": "POST",
"path": "/apis/v1/graphhopper/get-route",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"algorithm": {
"description": "Special routing algorithm. 'round_trip': returns to start with randomness. 'alternative_route': provides multiple route options.",
"enum": [
"round_trip",
"alternative_route"
],
"type": "string"
},
"alternative_route.max_paths": {
"default": 2,
"description": "Maximum number of alternative paths. Requires algorithm='alternative_route'.",
"minimum": 1,
"type": "integer"
},
"alternative_route.max_share_factor": {
"default": 0.6,
"description": "Maximum similarity factor between alternative and optimal route. Requires algorithm='alternative_route'.",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"alternative_route.max_weight_factor": {
"default": 1.4,
"description": "Maximum factor by which alternatives can be longer than optimal route. Requires algorithm='alternative_route'.",
"minimum": 0,
"type": "number"
},
"calc_points": {
"default": true,
"description": "Whether to calculate route geometry points.",
"type": "boolean"
},
"ch.disable": {
"default": false,
"description": "Enable flexible mode to use custom_model or advanced options below. Set to true for heading, algorithm, etc.",
"type": "boolean"
},
"curbside": {
"description": "Side of the road for leaving/arriving at each point. Specify for all points or none. Only for motor vehicles.",
"items": {
"enum": [
"any",
"left",
"right"
],
"type": "string"
},
"type": "array"
},
"debug": {
"default": false,
"description": "Enable formatted output for debugging.",
"type": "boolean"
},
"details": {
"description": "Path detail types to include. Available: 'street_name', 'street_ref', 'street_destination', 'leg_time', 'leg_distance', 'roundabout', 'country', 'time', 'distance', 'max_speed', 'max_weight', 'max_width', 'toll', 'road_class', 'road_class_link', 'road_access', 'road_environment', 'hazmat', 'hazmat_tunnel', 'hazmat_water', 'lanes', 'surface', 'smoothness', 'hike_rating', 'mtb_rating', 'foot_network', 'bike_network'",
"items": {
"type": "string"
},
"type": "array"
},
"elevation": {
"default": false,
"description": "Include altitude as third coordinate in response. Changes format of points and snapped_waypoints fields.",
"type": "boolean"
},
"heading": {
"description": "Preferred heading direction for each point in degrees (0-360, north-based clockwise). Specify one for start or one per point. Requires ch.disable=true.",
"items": {
"type": "integer"
},
"type": "array"
},
"heading_penalty": {
"default": 300,
"description": "Time penalty in seconds for not obeying specified heading. Requires ch.disable=true.",
"minimum": 0,
"type": "integer"
},
"instructions": {
"default": true,
"description": "Whether to calculate and return turn-by-turn instructions.",
"type": "boolean"
},
"locale": {
"default": "en",
"description": "Locale for turn instructions. Examples: 'en', 'de', 'fr', 'pt_PT'",
"examples": [
"en",
"de",
"fr"
],
"type": "string"
},
"optimize": {
"description": "If 'true', reorders points to minimize total travel time. Applies route optimization limits and increases the price.",
"enum": [
"false"
],
"type": "string"
},
"pass_through": {
"default": false,
"description": "Avoid u-turns at via-points with regard to heading_penalty. Requires ch.disable=true.",
"type": "boolean"
},
"point": {
"description": "Route waypoints as 'latitude,longitude' strings. Specify at least origin and destination. Via points are possible. Example: ['51.131,12.414', '48.224,3.867']",
"items": {
"type": "string"
},
"maxItems": 10,
"minItems": 2,
"type": "array"
},
"point_hint": {
"description": "Optional road name hints for snapping each point. Specify none or the same number as points.",
"items": {
"type": "string"
},
"type": "array"
},
"points_encoded": {
"default": true,
"description": "Use polyline encoding for geometry (true) or simple coordinate pairs (false).",
"type": "boolean"
},
"profile": {
"description": "The routing profile determining network, speed, and physical attributes. Common values: 'car', 'bike', 'foot', 'motorcycle', 'mtb', 'racingbike', 'hike'. Default: 'car'",
"enum": [
"car"
],
"type": "string"
},
"round_trip.distance": {
"default": 10000,
"description": "Approximate round trip length in meters. Requires algorithm='round_trip'.",
"minimum": 0,
"type": "integer"
},
"round_trip.seed": {
"description": "Random seed for deterministic round trip results. Requires algorithm='round_trip'.",
"type": "integer"
},
"snap_prevention": {
"description": "Prevent snapping to specific road types. Values: 'motorway', 'trunk', 'ferry', 'tunnel', 'bridge', 'ford'",
"items": {
"enum": [
"motorway",
"trunk",
"ferry",
"tunnel",
"bridge",
"ford"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"optimize",
"point",
"profile"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0007 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json
Path detail types to include. Available: 'street_name', 'street_ref', 'street_destination', 'leg_time', 'leg_distance', 'roundabout', 'country', 'time', 'distance', 'max_speed', 'max_weight', 'max_width', 'toll', 'road_class', 'road_class_link', 'road_access', 'road_environment', 'hazmat', 'hazmat_tunnel', 'hazmat_water', 'lanes', 'surface', 'smoothness', 'hike_rating', 'mtb_rating', 'foot_network', 'bike_network'