Street routing

Calculate a time-distance matrix

Calculate a time-distance matrix from multiple source locations to multiple target locations. Useful for solving optimization problems.

get/valhalla/sources_to_targets

Request

  • Base URL: https://transit.land/api/v2/routing
  • URL: https://transit.land/api/v2/routing/valhalla/sources_to_targets
  • Auth: one of:
    • API key in header apikey
    • API key in query parameter apikey

Query parameters

The request object, url-encoded. Identical to the POST body. Encode spaces as %20, or send the JSON without spaces. The API does not decode + as a space and rejects the request as unparseable.

Response

Successful response

algorithmstring

Which matrix algorithm answered the request.

units'kilometers' | 'miles'

Units the distances are expressed in.

Example response

{
  "algorithm": "costmatrix"
}

Changes

No recorded changes to this operation across all 1 revision of this API.