跳转到主要内容
POST
GET Route

请求规范

  • 方法与路径: POST /apis/v1/graphhopper/get-route
  • 可用状态: enabled
  • 请求 URL 模板: https://api.aisa.one/apis/v1/graphhopper/get-route
完整 OpenAPI 定义 有效请求声明(包括认证和引用的 schema):

费用与请求规则

按实际用量收费。 默认请求预估费用:$0.0007 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
optimize
enum<string>
必填

If 'true', reorders points to minimize total travel time. Applies route optimization limits and increases the price.

可用选项:
false
point
string[]
必填

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']

Required array length: 2 - 10 elements
profile
enum<string>
必填

The routing profile determining network, speed, and physical attributes. Common values: 'car', 'bike', 'foot', 'motorcycle', 'mtb', 'racingbike', 'hike'. Default: 'car'

可用选项:
car
algorithm
enum<string>

Special routing algorithm. 'round_trip': returns to start with randomness. 'alternative_route': provides multiple route options.

可用选项:
round_trip,
alternative_route
alternative_route.max_paths
integer
默认值:2

Maximum number of alternative paths. Requires algorithm='alternative_route'.

必填范围: x >= 1
alternative_route.max_share_factor
number
默认值:0.6

Maximum similarity factor between alternative and optimal route. Requires algorithm='alternative_route'.

必填范围: 0 <= x <= 1
alternative_route.max_weight_factor
number
默认值:1.4

Maximum factor by which alternatives can be longer than optimal route. Requires algorithm='alternative_route'.

必填范围: x >= 0
calc_points
boolean
默认值:true

Whether to calculate route geometry points.

ch.disable
boolean
默认值:false

Enable flexible mode to use custom_model or advanced options below. Set to true for heading, algorithm, etc.

curbside
enum<string>[]

Side of the road for leaving/arriving at each point. Specify for all points or none. Only for motor vehicles.

可用选项:
any,
left,
right
debug
boolean
默认值:false

Enable formatted output for debugging.

details
string[]

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'

elevation
boolean
默认值:false

Include altitude as third coordinate in response. Changes format of points and snapped_waypoints fields.

heading
integer[]

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.

heading_penalty
integer
默认值:300

Time penalty in seconds for not obeying specified heading. Requires ch.disable=true.

必填范围: x >= 0
instructions
boolean
默认值:true

Whether to calculate and return turn-by-turn instructions.

locale
string
默认值:en

Locale for turn instructions. Examples: 'en', 'de', 'fr', 'pt_PT'

示例:

"en"

"de"

"fr"

pass_through
boolean
默认值:false

Avoid u-turns at via-points with regard to heading_penalty. Requires ch.disable=true.

point_hint
string[]

Optional road name hints for snapping each point. Specify none or the same number as points.

points_encoded
boolean
默认值:true

Use polyline encoding for geometry (true) or simple coordinate pairs (false).

round_trip.distance
integer
默认值:10000

Approximate round trip length in meters. Requires algorithm='round_trip'.

必填范围: x >= 0
round_trip.seed
integer

Random seed for deterministic round trip results. Requires algorithm='round_trip'.

snap_prevention
enum<string>[]

Prevent snapping to specific road types. Values: 'motorway', 'trunk', 'ferry', 'tunnel', 'bridge', 'ford'

可用选项:
motorway,
trunk,
ferry,
tunnel,
bridge,
ford

响应

Tool result data

info
object
必填
paths
object[]
必填
hints
object