POST Route
curl --request POST \
--url https://api.aisa.one/apis/v1/graphhopper/route-post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"optimize": false,
"points": [
[
123
]
],
"profile": "car"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/route-post"
payload = {
"optimize": False,
"points": [[123]],
"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, points: [[123]], profile: 'car'})
};
fetch('https://api.aisa.one/apis/v1/graphhopper/route-post', 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/route-post",
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,
'points' => [
[
123
]
],
'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/route-post"
payload := strings.NewReader("{\n \"optimize\": false,\n \"points\": [\n [\n 123\n ]\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/route-post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimize\": false,\n \"points\": [\n [\n 123\n ]\n ],\n \"profile\": \"car\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/graphhopper/route-post")
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 \"points\": [\n [\n 123\n ]\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,
"street_name": "<string>",
"text": "<string>",
"time": 123,
"exit_number": 123,
"heading": 123,
"last_heading": 123,
"street_destination": "<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
POST Route
POST Route
POST
https://api.aisa.one
/
apis
/
v1
/
graphhopper
/
route-post
POST Route
curl --request POST \
--url https://api.aisa.one/apis/v1/graphhopper/route-post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"optimize": false,
"points": [
[
123
]
],
"profile": "car"
}
'import requests
url = "https://api.aisa.one/apis/v1/graphhopper/route-post"
payload = {
"optimize": False,
"points": [[123]],
"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, points: [[123]], profile: 'car'})
};
fetch('https://api.aisa.one/apis/v1/graphhopper/route-post', 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/route-post",
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,
'points' => [
[
123
]
],
'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/route-post"
payload := strings.NewReader("{\n \"optimize\": false,\n \"points\": [\n [\n 123\n ]\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/route-post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimize\": false,\n \"points\": [\n [\n 123\n ]\n ],\n \"profile\": \"car\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/graphhopper/route-post")
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 \"points\": [\n [\n 123\n ]\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,
"street_name": "<string>",
"text": "<string>",
"time": 123,
"exit_number": 123,
"heading": 123,
"last_heading": 123,
"street_destination": "<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/route-post
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/graphhopper/route-post
{
"operationId": "graphhopper.route-post",
"method": "POST",
"path": "/apis/v1/graphhopper/route-post",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"algorithm": {
"description": "Special routing mode; requires ch.disable=true",
"enum": [
"round_trip",
"alternative_route"
],
"type": "string"
},
"alternative_route": {
"additionalProperties": false,
"description": "Parameters for alternative routes; requires algorithm='alternative_route'",
"properties": {
"max_paths": {
"default": 2,
"description": "Max number of alternatives; requires algorithm='alternative_route'",
"minimum": 1,
"type": "integer"
},
"max_share_factor": {
"default": 0.6,
"description": "Max share factor vs optimal; requires algorithm='alternative_route'",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"max_weight_factor": {
"default": 1.4,
"description": "Max weight factor vs optimal; requires algorithm='alternative_route'",
"minimum": 0,
"type": "number"
}
},
"type": "object"
},
"calc_points": {
"default": true,
"description": "Include full route geometry",
"type": "boolean"
},
"ch.disable": {
"default": false,
"description": "Enable flexible mode for custom_model and advanced options",
"type": "boolean"
},
"curbsides": {
"description": "Curbside to approach/leave each point",
"items": {
"enum": [
"any",
"left",
"right"
],
"type": "string"
},
"type": "array"
},
"custom_model": {
"additionalProperties": false,
"description": "Custom routing rules; requires ch.disable=true",
"properties": {
"areas": {
"additionalProperties": true,
"description": "GeoJSON FeatureCollection for custom areas; requires ch.disable=true",
"type": "object"
},
"distance_influence": {
"description": "Influence of distance on custom cost; requires ch.disable=true",
"type": "number"
},
"priority": {
"description": "Customize priorities per model rule; requires ch.disable=true",
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
"speed": {
"description": "Customize speeds per model rule; requires ch.disable=true",
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"debug": {
"default": false,
"description": "Enable formatted debug output",
"type": "boolean"
},
"details": {
"description": "List of path detail keys (e.g., 'street_name','surface','max_speed')",
"items": {
"type": "string"
},
"type": "array"
},
"elevation": {
"default": false,
"description": "Include altitude in geometry",
"type": "boolean"
},
"heading_penalty": {
"default": 300,
"description": "Penalty (s) for deviating from heading; requires ch.disable=true",
"minimum": 0,
"type": "integer"
},
"headings": {
"description": "Preferred headings in degrees; requires ch.disable=true",
"items": {
"type": "integer"
},
"type": "array"
},
"instructions": {
"default": true,
"description": "Include turn-by-turn instructions",
"type": "boolean"
},
"locale": {
"default": "en",
"description": "Locale for turn instructions",
"type": "string"
},
"optimize": {
"description": "Reorder points to minimize travel time",
"enum": [
false
],
"type": "boolean"
},
"pass_through": {
"default": false,
"description": "Avoid u-turns at via points; requires ch.disable=true",
"type": "boolean"
},
"point_hints": {
"description": "Optional street hints; one per point",
"items": {
"type": "string"
},
"type": "array"
},
"points": {
"description": "Ordered list of [lon, lat] pairs for route waypoints; at least two points required",
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"maxItems": 10,
"minItems": 2,
"type": "array"
},
"points_encoded": {
"default": true,
"description": "Use polyline encoding for geometry",
"type": "boolean"
},
"profile": {
"description": "Vehicle profile (e.g., 'car', 'bike', 'foot')",
"enum": [
"car"
],
"type": "string"
},
"round_trip": {
"additionalProperties": false,
"description": "Parameters for round trip; requires algorithm='round_trip'",
"properties": {
"distance": {
"default": 10000,
"description": "Approximate round-trip length in meters; requires algorithm='round_trip'",
"minimum": 0,
"type": "integer"
},
"seed": {
"description": "Random seed for deterministic round trip; requires algorithm='round_trip'",
"type": "integer"
}
},
"type": "object"
},
"snap_preventions": {
"description": "Road types to avoid during snapping",
"items": {
"enum": [
"motorway",
"trunk",
"ferry",
"tunnel",
"bridge",
"ford"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"optimize",
"points",
"profile"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 当前暂无预估金额。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json