Open data

The Pekoe Trail, as an API

All 22 stages of Sri Lanka’s long-distance walking route as free JSON. Distance, duration, difficulty, ascent, an approximate start point and the landmarks along each stage. No key, no signup, no rate card.

22Stages
157Landmarks
NoneAuth required
300/hrPer address

Read this before you plot anything

  • There is no route geometry. No GPX, no trace, nothing between one stage start and the next. The map on this site draws a line through 22 points; that is a connector between waypoints and it is not the trail. Do not present it as one.
  • The coordinates are approximate stage starts, not surveyed positions. They are not for navigation. Twenty come from the trail authority’s own start and end map links; Stages 16 (Ella) and 22 (Kandapola) have no official point and use OpenStreetMap.
  • Dataset 1.1.0 (16 September 2026) replaced every start coordinate. Up to 1.0.0, many starts from Stage 3 on were up to 58 km from the named places and Stages 21 and 22 shared one point. It also corrected Stages 1, 6 and 13 to the trail authority’s current figures. If you cached 1.0.0 coordinates, discard them. /quality has the detail.
  • Difficulty is the trail authority’s own four words and nothing anywhere distinguishes Hard from Difficult, so do not sort on it. It is also not the five-tier scale published on our difficulty scale page, and nothing maps between the two.
  • The stage distances sum to 323.69 km, while the route is usually described as 300 km. Both figures come from the trail authority. Publish either, but do not present the sum as a correction to the headline.

The full list of what this dataset cannot support is served at /quality, and it is worth reading before you build on any of it.

Endpoints

GET /api/v1/pekoe-trail

Discovery document: what this is, the endpoint list, the headline figures, and the licence position.

curl https://hikelanka.com/api/v1/pekoe-trail
GET /api/v1/pekoe-trail/stages

All 22 stages, in order. This is the whole dataset and it is one request.

curl https://hikelanka.com/api/v1/pekoe-trail/stages
FieldWhat it holds
stageStage number, 1 to 22.
segmentStart and end point, as the trail authority names them.
regionThe district or districts the stage crosses.
distance_km
distance_mi
The trail authority’s official distance. Not our measurement.
durationAuthored free text such as “4 hours”. Never parse it into a number: it is a guide’s estimate, not a computed one, and it does not adjust for pack, weather or season.
difficultyOne of Easy, Moderate, Hard, Difficult. See the caveat above before you sort on it.
ascent_m
descent_m
max_elev_m
Metres.
startApproximate stage start as lat and lng. Not surveyed, not for navigation.
coordinate_suspectTrue where this stage shares a coordinate with another, so one of the pair is wrong. Computed from the data. False on every stage since dataset 1.1.0.
landmarksNamed features along the stage, each with a short note. Five to seven per stage.
urlThe full Hike Lanka guide for that stage.
meta.attributionRequired attribution string. Carry it wherever you show these figures.
meta.licenceAlways null. See “Sources, and what you owe us” below.
GET /api/v1/pekoe-trail/stages/{1-22}

A single stage. Anything outside 1 to 22 returns 404.

curl https://hikelanka.com/api/v1/pekoe-trail/stages/16
GET /api/v1/pekoe-trail/stages.csv

The same 22 rows flattened, with lat and lng as their own columns. Landmarks are left out rather than crushed into one unparseable cell.

curl -O https://hikelanka.com/api/v1/pekoe-trail/stages.csv
GET /api/v1/pekoe-trail/quality

What this dataset cannot support, in full, as JSON, and what changed in each dataset version. Duplicate coordinates are computed rather than listed by hand, so this endpoint cannot go on claiming a defect the data no longer has.

curl https://hikelanka.com/api/v1/pekoe-trail/quality
GET /api/v1/pekoe-trail/openapi.json

OpenAPI 3.1 specification for everything above.

curl https://hikelanka.com/api/v1/pekoe-trail/openapi.json

Using it

Every response is JSON with three members: data, meta and caveats. CORS is open, so you can call it straight from a browser. Responses are cached for fifteen minutes at the edge.

There is no key and no signup. Requests are limited to 300 an hour per address, which is far more than a dashboard needs, and the whole dataset is a single request. Only GET is accepted; anything else returns 405.

There is deliberately no timestamp on a response. This dataset is fixed between releases, so a clock would tell you the data had moved when it had not. Watch meta.dataset_version instead, which changes only when the figures do.

Sources, and what you owe us

Stage distances, durations, difficulty ratings and elevations are the Pekoe Trail Organisation’s published figures, captured on 21 May 2026 and re-checked stage by stage on 16 September 2026. Start coordinates come from the trail authority’s map links, and from OpenStreetMap contributors for Stages 16 and 22. The landmark notes, the trail guides and the structure of this API are Hike Lanka’s own work. We are not the trail authority and this is not the official trail dataset.

No licence is asserted here, and that is deliberate. We have not obtained or read a licence from the Pekoe Trail Organisation, so we do not grant one on their behalf. meta.licence is null for that reason. What we ask is simple: reproduce meta.attribution wherever you show these figures. If your use is commercial, ask the trail authority directly about the underlying data.

Building something with this?

We would like to know, and it costs you nothing to tell us. It also tells us which data is worth maintaining, and whether the rest of what we hold is worth publishing the same way.

Get in touch, or start with the Pekoe Trail guide to see the same data as a reader meets it.

WhatsApp Low data mode