Itinerary
The itinerary 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.
/graphqlRead a single itinerary by identifier, with its ordered segments and waypoints.
Arguments
inputItineraryInput!
The itinerary to read.
idID!
Identifier of the itinerary to read, a UUID in its canonical form of 36 characters with four hyphens. Any other value, the nil UUID included, is refused with VALIDATION_FAILED at ["input", "id"]. Example: "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21".
Returns
itineraryItineraryResult!
A single itinerary with its segments and waypoints.
idID!
Itinerary identifier.
nameString!
Display name of the itinerary.
descriptionString
Free-text description of the itinerary. Null when it has none.
activitySlugActivitySlug
One of: HIKING_AND_TRAIL, PROFESSIONAL_TRAIL, RUNNING, ROAD_CYCLING, GRAVEL_BIKE, MOUNTAIN_BIKE, BACKCOUNTRY_SKIING, SKI_TOURING, CROSS_COUNTRY_SKIING, SNOWSHOE_WALKING
Itinerary activity slug; null when no activity is assigned.
See ActivitySlug.
distanceFloat
Total distance across all of the itinerary's segments, in meters; null when no segment contributes a distance value (for example the itinerary has no segments, or none have been computed).
ascentInt
Total elevation gain across all of the itinerary's segments, in meters; null when no segment contributes an ascent value.
isPrivateBoolean!
Whether the itinerary is private. A private itinerary is served only to a key of the organization that owns it; no other organization's key reaches it, even with its id. A public one ('anyone with the link') is also served by id to any other organization's key, as last published, but is never listed in another organization's search results.
organizationIdID
Identifier of the organization that owns this itinerary. Null for a personal itinerary, made from an individual account and owned by no organization.
segments[ItinerarySegment!]!
Segments in itinerary order.
idID!
Segment identifier.
nameString!
Display name of the segment. Example: "Day 1".
descriptionString
Free-text description of the segment. Null when it has none.
positionInt!
Zero-based position of the segment within the itinerary's ordered chain.
groupIdID
Identifier of the segment group this segment belongs to, matching an entry of the itinerary's groups; null when the segment belongs to none. Grouping is presentation only and never changes the segment itself.
distanceFloat
Segment distance in meters; null when the segment has not been computed.
durationFloat
Segment duration in seconds; null when the segment has not been computed.
ascentInt
Elevation gain along the segment in meters; null when unknown.
descentInt
Elevation loss along the segment in meters; null when unknown.
altitudeMetricRange
Altitude range along the segment in meters above sea level; null when the segment carries no elevation data.
maxFloat!
Upper bound of the range.
minFloat!
Lower bound of the range.
gradientMetricRange
Gradient range along the segment in degrees, positive uphill and negative downhill; null when the segment carries no elevation data.
maxFloat!
Upper bound of the range.
minFloat!
Lower bound of the range.
geometryGeoJSON
GeoJSON Geometry object for the segment path; null when the segment has no geometry yet. It is one of two shapes. A drawn segment is a bare LineString, simplified and resampled to about one position every 50 m. A routed segment is a GeometryCollection holding the routed LineString and a MultiPoint of the waypoints it was routed through, and so is a drawn one when resampling added positions between the vertices it was drawn with and those vertices number fewer than its sample budget, one position per 50 m of its distance plus two, never fewer than 400 and never more than 4,000: its MultiPoint then holds the vertices drawn. A dense recorded track is therefore a bare LineString even where resampling filled a gap in it. A collection of one member is never sent.
waypoints[ItineraryWaypoint!]!
Waypoints in itinerary order.
idID!
Waypoint identifier.
nameString
Display name of the waypoint. Null only for a POINT, a standalone marker, which may be unnamed; a POI, a point of interest, always carries one.
descriptionString
Free-text description of the waypoint. Null when it has none.
positionInt!
Zero-based position of the waypoint within the itinerary's ordered chain.
point[Float!]
Waypoint location as [longitude, latitude] (WGS 84); null when the waypoint has no geometry.
amenities[WaypointAmenity!]!
One of: WATER, DRINKS, FOOD, HOT_MEAL, SNACKS, MEDICAL, FIRST_AID, TOILETS, SHOWERS, DROP_BAG, LUGGAGE_STORAGE, ASSISTANCE, REST_AREA, ACCOMMODATION, SHELTER, CAMPING, PICNIC, SHOP, PARKING, SHUTTLE, PUBLIC_TRANSPORT, CABLE_CAR, POWER_CHARGING, WIFI, MOBILE_SIGNAL, WASTE, PET_FRIENDLY, WHEELCHAIR_ACCESS, VIEWPOINT, TIMING_CHECKPOINT
Services and facilities available at this waypoint, in no particular order and without duplicates. Empty when none are declared, never null, so it can be iterated unconditionally.
See WaypointAmenity.
timingWaypointTiming
Cut-off and planned stop; null when the waypoint carries no timing.
cutoffAtDateTime
Absolute instant by which this waypoint must be left, as an RFC 3339 timestamp; null when none is published.
stopDurationInt
Seconds expected to be spent here; null when no stop is planned.
contactWaypointContact
How to reach the place this waypoint marks; null when the waypoint carries no contact detail.
websiteURL
Absolute URL of this place's website; null when not provided.
phoneString
Contact phone number, in international format where known; null when not provided.
emailString
Contact email address; null when not provided.
addressString
Postal address on a single line; null when not provided.
openingHoursString
Opening hours in free text, as published by the place itself; null when not provided.
bookingUrlURL
Absolute URL where a stay, table or slot can be booked; null when not provided.
mediaWaypointMedia
Photos and external links; null when none are attached, so a non-null value carries at least one of the two lists.
photos[WaypointPhoto!]
Photographs of the place, in display order. Null when none are attached: the empty case is carried as null rather than as an empty list.
urlURL!
Absolute URL of the image.
captionString
Short caption describing the photo; null when not provided.
links[WaypointLink!]
Labelled external links, in display order. Null when none are attached: the empty case is carried as null rather than as an empty list.
labelString!
Text shown for the link.
urlURL!
Absolute URL the link points to.
properties[WaypointProperty!]
Customer-defined fields, in the order they should be shown. Keys are unique within a waypoint. Null when the waypoint defines none. The empty case is carried as null rather than as an empty list, so check for null before iterating.
keyString!
Stable lowercase-slug identifier, unique within the waypoint.
labelString!
Human-readable name of this field, shown to readers.
valueString!
The field's value, always carried as a string. format says how to interpret it.
formatWaypointPropertyFormat
One of: TEXT, NUMBER, DURATION, DISTANCE, URL, DATE
How value should be rendered; null is equivalent to TEXT.
groups[ItinerarySegmentGroup!]!
Segment groups defined on this itinerary, in no guaranteed order: key them by id rather than by position. Flat rather than nested inside the segments: the ordered segment chain stays the itinerary's primary structure, and each segment points back at its group through groupId. Empty when the itinerary has no groups.
idID!
Group identifier.
nameString!
Display name of the group. Example: "Day 1".
colorString!
Hex color code used to paint the whole run as one band. Always set, because a group with no color would be indistinguishable from no group at all.
speedFloat
Travel speed in km/h applied to the whole run when computing the displayed duration; null means no override, so each member keeps its own speed and the run's duration is the sum of its members'.
segmentCountInt!
Number of segments on the itinerary. Always equals the length of segments.
waypointCountInt!
Number of waypoints on the itinerary. Always equals the length of waypoints.
groupCountInt!
Number of segment groups on the itinerary. Always equals the length of groups.
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 Itinerary($input: ItineraryInput!) { itinerary(input: $input) { ascent distance name segments { distance name } } }",
"variables": {"input": {"id": "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21"}}
}'