# read_track_link

The route file behind a map.geo.admin.ch or My Maps link.

`POST /v1/lookups/track-link` · MCP tool `read_track_link` · scope `write` · beta · since 2026-10-26.4

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

## Body parameters

- `url` (string, required): The link the creator shared.

## Returns

200.

- `fileName` (string, required): A file name for the route (the drawing's or map's).
- `text` (string, required): The KML file's text.

## Examples

### The KML behind a map.geo.admin.ch drawing of the Oeschinensee loop

```bash
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"
}'
```

MCP `tools/call`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "read_track_link",
    "arguments": {
      "url": "https://s.geo.admin.ch/a1b2c3d4e5"
    }
  }
}
```

Response 200:

```json
{
  "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

- `invalid_argument` (400): A 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).
- `invalid_request` (400): A 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.
- `unauthenticated` (401): The request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- `invalid_api_key` (401): The key is unknown, revoked or expired.
- `api_scope_required` (403): A read-only key called a write operation, or a key without the publish option called publish_changes.
- `forbidden` (403): The key belongs to a creator account that is no longer active.
- `unsupported` (400): read_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.
- `not_public` (400): read_track_link on a Google My Maps map that only its owner can open.
- `too_large` (400): read_track_link on a drawing or map file over 4 MB.
- `unreadable` (400): read_track_link when the drawing or map did not answer.
- `payload_too_large` (413): A JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- `rate_limited` (429): Over a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- `internal_error` (500): An unexpected failure. The message is hidden on purpose.

Reference: https://developers.sceniq.earth/reference/read_track_link
