Get started

Routing

Directions

The directions query of the Data API. Every request is a POST to https://data.mountaya.com/graphql with a publishable key and a session token: see Authentication.

directions

POST
/graphql

Compute directions between waypoints for a given activity. Returns one or more routes with distance, duration, geometry, and analysis.

Arguments

input

DirectionsInput!

required

The waypoints to route between, the activity to route for, and the routing preferences to apply.

Returns

directions

DirectionsResult!

required

Result of a directions computation, containing one or more possible routes.

Errors A field the API refuses is answered 200, its entry in errors beside the data that resolved. See Errors.

curl https://data.mountaya.com/graphql \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query Directions($input: DirectionsInput!) { directions(input: $input) { routes { distance duration summary } } }",
    "variables": {
      "input": {
        "activity": "HIKING_AND_TRAIL",
        "waypoints": [[6.8712, 45.9231], [6.9271, 45.9822]]
      }
    }
  }'