跳转到主要内容
POST
Get Matrix

请求规范

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

费用与请求规则

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

授权

Authorization
string
header
必填

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

请求体

application/json
point
string[]
必填

Specify multiple points in 'latitude,longitude' format for which the matrix should be calculated. The starts are identical to the destinations. If there are N points, then NxN entries will be calculated. Specify at least three points. Cannot be used together with from_point or to_point.

Required array length: 1 - 20 elements
profile
enum<string>
必填

The routing profile. It determines the network, speed and other physical attributes used when computing the route. Valid values include 'car', 'bike', 'foot', 'hike', 'mtb', 'racingbike', 'scooter', 'truck', and 'small_truck'.

可用选项:
car
curbside
enum<string>[]

Optional parameter. Specifies on which side a point should be relative to the driver when she leaves/arrives at a start/target/via point. Must be 'any', 'left', or 'right'. Specify for either none or all points.

可用选项:
any,
left,
right
fail_fast
boolean
默认值:true

Specifies whether or not the matrix calculation should return with an error as soon as possible in case some points cannot be found or some points are not connected. If set to false, the matrix will be calculated for all valid points and contain null values for entries that could not be calculated.

from_curbside
enum<string>[]

Curbside setting for the from_point parameter. Must be 'any', 'left', or 'right'.

可用选项:
any,
left,
right
from_point
string[]

The origin points for the routes in 'latitude,longitude' format. Use together with to_point for asymmetric matrices.

示例:
from_point_hint
string[]

For the from_point parameter. Specifies a hint to prefer a certain street for the closest location lookup.

out_array
enum<string>[]

Specifies which arrays should be included in the response. Specify one or more of 'weights', 'times', 'distances'. The units of distances are meters, times are seconds, and weights are arbitrary.

可用选项:
weights,
times,
distances
示例:
point_hint
string[]

Optional parameter. Specifies a hint for each point parameter to prefer a certain street for the closest location lookup.

snap_prevention
enum<string>[]

Optional parameter to prevent snapping to specific types of roads. Supported values: 'motorway', 'trunk', 'ferry', 'tunnel', 'bridge', 'ford'.

可用选项:
motorway,
trunk,
ferry,
tunnel,
bridge,
ford
to_curbside
enum<string>[]

Curbside setting for the to_point parameter. Must be 'any', 'left', or 'right'.

可用选项:
any,
left,
right
to_point
string[]

The destination points for the routes in 'latitude,longitude' format. Use together with from_point for asymmetric matrices.

示例:
to_point_hint
string[]

For the to_point parameter. Specifies a hint to prefer a certain street for the closest location lookup.

响应

Tool result data

info
object
必填
distances
((number | null)[])[]
hints
object[]
times
((number | null)[])[]
weights
((number | null)[])[]