read_track_link
The route file behind a map.geo.admin.ch or My Maps link.
POST
/v1/lookups/track-linkThe hike editor's Paste a link: returns the public KML behind a map.geo.admin.ch drawing (short link, viewer link or the file) or a Google My Maps map shared with anyone who has the link. Read the LineString coordinates (lon,lat or lon,lat,ele) of the hike's line from it and send them as update_hike track with source kml, simplified to at most 1,000 points. Links from planner apps (Komoot, Strava, AllTrails) are refused with unsupported and the way to export a GPX file instead.
curl -X POST "https://sceniq.earth/api/v1/lookups/track-link" \
-H "Authorization: Bearer $SCENIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://s.geo.admin.ch/a1b2c3d4e5"
}'Body parameters
- urlstringrequired
The link the creator shared.
Returns
200 OK with this object.
- fileNamestringrequired
A file name for the route (the drawing's or map's).
- textstringrequired
The KML file's text.
Response 200
{
"fileName": "oeschinensee-loop.kml",
"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><kml xmlns=\"http://www.opengis.net/kml/2.2\"><Document><Placemark><name>Oeschinensee loop</name><LineString><coordinates>7.6936,46.4935,1176 7.7012,46.4961,1340 7.7267,46.4986,1578</coordinates></LineString></Placemark></Document></kml>"
}Errors
Every error is { error: { code, message } }. Act on the code.
- 400invalid_argumentA required field is missing, a field is unknown, or a value does not match its type (the Convex validator's path and value are in the message).
- 400invalid_requestA writer refused a value: a map link on a host that is not allowed, a title that is too long, a date that does not exist, too many items in a list. The message is the writer's own sentence.
- 401unauthenticatedThe request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- 401invalid_api_keyThe key is unknown, revoked or expired.
- 403api_scope_requiredA read-only key called a write operation, or a key without the publish option called publish_changes.
- 403forbiddenThe key belongs to a creator account that is no longer active.
- 400unsupportedread_track_link with a link from a planner app (Komoot, Strava, AllTrails) or a page without a drawn line. The message says how to export a GPX file from that app.
- 400not_publicread_track_link on a Google My Maps map that only its owner can open.
- 400too_largeread_track_link on a drawing or map file over 4 MB.
- 400unreadableread_track_link when the drawing or map did not answer.
- 413payload_too_largeA JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- 429rate_limitedOver a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- 500internal_errorAn unexpected failure. The message is hidden on purpose.