Get started
Routing

Route suggestions

Route suggestions

The suggestions 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.

suggestions

POST
/graphql

Generate route suggestions matching distance constraints for a given activity. Returns multiple route candidates with elevation data, allowing the client to select based on elevation gain, distance, or shape preference.

Arguments

input

SuggestionsInput!

required

The constraints a suggested route must satisfy: where it starts and ends, the activity, and the target distance or ascent.

Returns

suggestions

SuggestionsResult!

required

Result of a suggestions query, containing multiple route candidates.

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 Suggestions($input: SuggestionsInput!) { suggestions(input: $input) { routes { distance duration seed } } }",
    "variables": {
      "input": {
        "activity": "HIKING_AND_TRAIL",
        "candidates": 2,
        "distance": 12000,
        "start": [6.8712, 45.9231]
      }
    }
  }'