curl --request POST \
--url https://api.aisa.one/apis/v1/graphhopper/get-route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"point": [
"<string>"
],
"profile": "car",
"optimize": "false"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload = {
"point": ["<string>"],
"profile": "car",
"optimize": "false"
}
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({point: ['<string>'], profile: 'car', optimize: 'false'})
};
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([
'point' => [
'<string>'
],
'profile' => 'car',
'optimize' => 'false'
]),
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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"info": {
"took": 123,
"copyrights": [
"<string>"
],
"road_data_timestamp": "<string>"
},
"paths": [
{
"time": 123,
"distance": 123,
"bbox": [
123
],
"legs": [
{}
],
"ascend": 123,
"points": "<string>",
"weight": 123,
"descend": 123,
"details": {},
"transfers": 123,
"instructions": [
{
"sign": 123,
"text": "<string>",
"time": 123,
"distance": 123,
"interval": [
123
],
"heading": 123,
"street_ref": "<string>",
"turn_angle": 123,
"exit_number": 123,
"street_name": "<string>",
"last_heading": 123,
"street_destination": "<string>"
}
],
"points_order": [
123
],
"points_encoded": true,
"snapped_waypoints": "<string>",
"points_encoded_multiplier": 123
}
],
"hints": {}
}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 '
{
"point": [
"<string>"
],
"profile": "car",
"optimize": "false"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/get-route"
payload = {
"point": ["<string>"],
"profile": "car",
"optimize": "false"
}
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({point: ['<string>'], profile: 'car', optimize: 'false'})
};
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([
'point' => [
'<string>'
],
'profile' => 'car',
'optimize' => 'false'
]),
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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\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 \"point\": [\n \"<string>\"\n ],\n \"profile\": \"car\",\n \"optimize\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"info": {
"took": 123,
"copyrights": [
"<string>"
],
"road_data_timestamp": "<string>"
},
"paths": [
{
"time": 123,
"distance": 123,
"bbox": [
123
],
"legs": [
{}
],
"ascend": 123,
"points": "<string>",
"weight": 123,
"descend": 123,
"details": {},
"transfers": 123,
"instructions": [
{
"sign": 123,
"text": "<string>",
"time": 123,
"distance": 123,
"interval": [
123
],
"heading": 123,
"street_ref": "<string>",
"turn_angle": 123,
"exit_number": 123,
"street_name": "<string>",
"last_heading": 123,
"street_destination": "<string>"
}
],
"points_order": [
123
],
"points_encoded": true,
"snapped_waypoints": "<string>",
"points_encoded_multiplier": 123
}
],
"hints": {}
}请求规范
- 方法与路径: POST /apis/v1/graphhopper/get-route
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/graphhopper/get-route - Runtime 事实版本: 6a72f8e2fa7fb1c29379e3b24b3a247c8428a3b6ed621b3f84f84e75cb0de2bc
{
"operationId": "graphhopper.get-route",
"method": "POST",
"path": "/apis/v1/graphhopper/get-route",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"debug": {
"type": "boolean",
"default": false,
"description": "Enable formatted output for debugging."
},
"point": {
"items": {
"type": "string"
},
"maxItems": 10,
"minItems": 2,
"type": "array",
"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']"
},
"locale": {
"type": "string",
"default": "en",
"examples": [
"en",
"de",
"fr"
],
"description": "Locale for turn instructions. Examples: 'en', 'de', 'fr', 'pt_PT'"
},
"details": {
"type": "array",
"items": {
"type": "string"
},
"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'"
},
"heading": {
"type": "array",
"items": {
"type": "integer"
},
"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."
},
"profile": {
"enum": [
"car"
],
"type": "string",
"description": "The routing profile determining network, speed, and physical attributes. Common values: 'car', 'bike', 'foot', 'motorcycle', 'mtb', 'racingbike', 'hike'. Default: 'car'"
},
"curbside": {
"type": "array",
"items": {
"enum": [
"any",
"left",
"right"
],
"type": "string"
},
"description": "Side of the road for leaving/arriving at each point. Specify for all points or none. Only for motor vehicles."
},
"optimize": {
"enum": [
"false"
],
"type": "string",
"description": "If 'true', reorders points to minimize total travel time. Applies route optimization limits and increases the price."
},
"algorithm": {
"enum": [
"round_trip",
"alternative_route"
],
"type": "string",
"description": "Special routing algorithm. 'round_trip': returns to start with randomness. 'alternative_route': provides multiple route options."
},
"elevation": {
"type": "boolean",
"default": false,
"description": "Include altitude as third coordinate in response. Changes format of points and snapped_waypoints fields."
},
"ch.disable": {
"type": "boolean",
"default": false,
"description": "Enable flexible mode to use custom_model or advanced options below. Set to true for heading, algorithm, etc."
},
"point_hint": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional road name hints for snapping each point. Specify none or the same number as points."
},
"calc_points": {
"type": "boolean",
"default": true,
"description": "Whether to calculate route geometry points."
},
"instructions": {
"type": "boolean",
"default": true,
"description": "Whether to calculate and return turn-by-turn instructions."
},
"pass_through": {
"type": "boolean",
"default": false,
"description": "Avoid u-turns at via-points with regard to heading_penalty. Requires ch.disable=true."
},
"points_encoded": {
"type": "boolean",
"default": true,
"description": "Use polyline encoding for geometry (true) or simple coordinate pairs (false)."
},
"heading_penalty": {
"type": "integer",
"default": 300,
"minimum": 0,
"description": "Time penalty in seconds for not obeying specified heading. Requires ch.disable=true."
},
"round_trip.seed": {
"type": "integer",
"description": "Random seed for deterministic round trip results. Requires algorithm='round_trip'."
},
"snap_prevention": {
"type": "array",
"items": {
"enum": [
"motorway",
"trunk",
"ferry",
"tunnel",
"bridge",
"ford"
],
"type": "string"
},
"description": "Prevent snapping to specific road types. Values: 'motorway', 'trunk', 'ferry', 'tunnel', 'bridge', 'ford'"
},
"round_trip.distance": {
"type": "integer",
"default": 10000,
"minimum": 0,
"description": "Approximate round trip length in meters. Requires algorithm='round_trip'."
},
"alternative_route.max_paths": {
"type": "integer",
"default": 2,
"minimum": 1,
"description": "Maximum number of alternative paths. Requires algorithm='alternative_route'."
},
"alternative_route.max_share_factor": {
"type": "number",
"default": 0.6,
"maximum": 1,
"minimum": 0,
"description": "Maximum similarity factor between alternative and optimal route. Requires algorithm='alternative_route'."
},
"alternative_route.max_weight_factor": {
"type": "number",
"default": 1.4,
"minimum": 0,
"description": "Maximum factor by which alternatives can be longer than optimal route. Requires algorithm='alternative_route'."
}
},
"required": [
"optimize",
"point",
"profile"
]
}
}
}
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "response_units",
"customer_multiplier": 1.0,
"customer_pricing": "provider_cost_multiplier",
"default_request_estimate_usd": 0.0007,
"estimate_source": "profile_seed",
"evidence_source": "response_body",
"maximum_units": 10000000,
"unit": "provider_credit",
"unit_rate_usd": 1e-06
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按用量计费;默认请求预估费用:$0.0007 USD(不是固定价格)。 声明的单位费率:每 provider_credit $0.000001 USD。 最终费用以账户适用价格及实际结算为准。 公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口,执行前请针对完整请求获取免费报价;执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。- 默认请求参考估价(USD): 0.0007
- 声明的单位费率(USD): 1e-06
- 计费单位: provider_credit
- 计费依据: response_units
- 公开参考倍率: 1.0
- 声明的最大计数或单位数: 10000000
- 结算证据来源: response_body
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
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']
2 - 10 elementsThe routing profile determining network, speed, and physical attributes. Common values: 'car', 'bike', 'foot', 'motorcycle', 'mtb', 'racingbike', 'hike'. Default: 'car'
car If 'true', reorders points to minimize total travel time. Applies route optimization limits and increases the price.
false Enable formatted output for debugging.
Locale for turn instructions. Examples: 'en', 'de', 'fr', 'pt_PT'
"en"
"de"
"fr"
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'
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.
Side of the road for leaving/arriving at each point. Specify for all points or none. Only for motor vehicles.
any, left, right Special routing algorithm. 'round_trip': returns to start with randomness. 'alternative_route': provides multiple route options.
round_trip, alternative_route Include altitude as third coordinate in response. Changes format of points and snapped_waypoints fields.
Enable flexible mode to use custom_model or advanced options below. Set to true for heading, algorithm, etc.
Optional road name hints for snapping each point. Specify none or the same number as points.
Whether to calculate route geometry points.
Whether to calculate and return turn-by-turn instructions.
Avoid u-turns at via-points with regard to heading_penalty. Requires ch.disable=true.
Use polyline encoding for geometry (true) or simple coordinate pairs (false).
Time penalty in seconds for not obeying specified heading. Requires ch.disable=true.
x >= 0Random seed for deterministic round trip results. Requires algorithm='round_trip'.
Prevent snapping to specific road types. Values: 'motorway', 'trunk', 'ferry', 'tunnel', 'bridge', 'ford'
motorway, trunk, ferry, tunnel, bridge, ford Approximate round trip length in meters. Requires algorithm='round_trip'.
x >= 0Maximum number of alternative paths. Requires algorithm='alternative_route'.
x >= 1Maximum similarity factor between alternative and optimal route. Requires algorithm='alternative_route'.
0 <= x <= 1Maximum factor by which alternatives can be longer than optimal route. Requires algorithm='alternative_route'.
x >= 0