Route card to print
POST https://api.trailsplits.com/v1/route-card
Checked by a live probe Key optional · 500 credits a day without one 10 credits per call
A card to print and keep for a line you send, as one self-contained HTML page (works offline, no scripts) or a PDF on A4 or Letter: the map, the elevation profile, legs between your waypoints with distance, climb and moving time, water and huts along the line, weather and sun only when you give a date (models named), a cue sheet if you send one, the sources, and a QR code to the trailsplits.com link you give. Nothing is stored or published, and it carries no identity. Climb is "not measured" without heights and "≈" for a terrain estimate; times are your own (leg_seconds) or the hike model’s. 10 credits.
Example
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/v1/route-card' \
-H "Authorization: Bearer $TRAILSPLITS_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"geometry":{"type":"LineString","coordinates":[[6.97178,45.79266],[6.98409,45.80185],[6.98629,45.80488],[6.98231,45.80634],[6.9782,45.80782],[6.9784,45.81286],[6.98961,45.82424],[7.00303,45.82901],[7.0139,45.83525],[7.02084,45.83669],[7.02859,45.84621],[7.03402,45.84664]]},"name":"Courmayeur – Rifugio Bonatti","waypoints":[{"lon":6.971776,"lat":45.792663,"name":"Courmayeur"},{"lon":6.979459,"lat":45.817503,"name":"Midway"},{"lon":7.034022,"lat":45.846641,"name":"Rifugio Bonatti"}],"link":"https://trailsplits.com/planner"}' The answer is a file to keep (an HTML page or a PDF), so try it from the command line: the curl example saves card.html; add "format": "pdf" for a PDF.
Request body
| Field | Type | Description |
|---|---|---|
gpx | string | The line as GPX (parts kept, no line drawn across a gap). Or geometry, not both. Limits: 5,000 points, 300 km. |
geometry | object | A GeoJSON LineString or MultiLineString, [lon, lat]. |
name | string | The card’s title. |
waypoints | array | Start and finish included; placed on the line forward only. Legs run between them. |
leg_seconds | array | Your own moving seconds per leg, so the card matches your screen; one per leg. |
pace_factor | object | relaxed, usual, brisk, or a number from 0.5 to 2; used without leg_seconds. |
profile | string: hike | run | bike | |
cues | array | For the cue sheet. |
units | string: metric | imperial | |
paper | string: a4 | letter | |
format | string: html | pdf | |
departure | string | ISO time with offset, for a one-part line: adds the weather and sun at the hour each point is reached. Without it there is no weather section. |
link | string | The QR code’s target: a https://trailsplits.com/ address of at most 300 characters. Without it, no QR code. |
Errors
400, 413, 422, 503, plus the gateway's 401, 429 and 503 (every error code). A refused request costs no credits.
Contract
A card to print and keep, for a line you post. It comes as self-contained HTML (images inline, so it works offline) or as a PDF on A4 or Letter paper. It carries:
- the map;
- the elevation profile;
- legs between your waypoints, with distance, climb and moving time;
- water and huts along the line;
- weather and sun, only when you give a date;
- a cue sheet, when you send one;
- the sources;
- a QR code to the link you give.
What it is, and what it is not.
-
Nothing is stored or published. Making a card saves nothing and carries no identity. The QR code points only where you say, and only to a
trailsplits.comaddress: your/r/share or the Planner. - Hazards and caveats. Fords, aided passages and via ferratas the analysis finds come first, with where they are. The analysis' caveats follow, such as a stretch off any mapped path. When the hike time is outside its calibration (T4 or harder, or much of the line off paths), the time note says it may be too fast.
- Figures add up to the line. Surfaces, roads and untagged paths are counted on the matched paths, so they are scaled to the line's length.
- Water and huts are always said. Either listed, or "none within 150 m", or "not available" when the index did not answer.
- The same facts as the route pages. Climb is "not measured" without heights (never +0 m), and "≈" when it is a terrain estimate. The hardest SAC grade comes with where it starts. Untagged paths are unknown, not easy, and roads are reported apart. Surfaces are tagged on the map or inferred from the kind of way.
-
Weather only for a date. With no
departurethere is no weather section, never an implied "today". With one, the forecast is read at the hour you reach each point (route weather), the start is printed in the route's own time, and each model is named. On ECMWF hours near freezing, the card says that rain and snow are not told apart. -
Times and climb are yours when you send them.
leg_secondsormoving_secondsmakes the card match your screen, andclimbmakes it state your route page's climb (one route, one climb). Without them, the TrailSplits hike time model's total is shared across legs by their effort, at your pace. Breaks are not included.
Request
A flat object: only the line is required.
{ "geometry": { "type": "MultiLineString", "coordinates": [[[lon, lat], …], [[lon, lat], …]] }, "name": "Tour du Mont Blanc, days 1–2",
"waypoints": [{ "lon": 6.87, "lat": 45.92, "name": "Les Houches" }, …], "leg_seconds": [16200, 19800],
"units": "metric", "paper": "a4", "format": "pdf", "link": "https://trailsplits.com/r/abc123" }
| Field | Default | ||
|---|---|---|---|
gpx or geometry | one of them | Parts and the gaps between them are kept, and no line is drawn across a gap. Limits as route analysis: 5,000 points, 300 km | |
name | "Route card" | The card's title, up to 120 characters | |
waypoints | none | Up to 60 { lon, lat, name? }, start and finish included. Names at most 80 characters. Each is placed on the line forward only, so an out-and-back's way back is not its way out. A last waypoint that repeats the first, on a closed line, ends at the end. A waypoint within 50 m of the previous one merges into it. One more than 500 m from the line ahead is left out. The card says so for each merge or omission. A start or finish not sent is added, so the legs cover the whole line. Legs run between consecutive waypoints, and one that spans a gap between parts says so. Without waypoints, each part is one leg | |
leg_seconds | none | Moving seconds per leg, one per leg after placing and merging. A different count is refused with legs_mismatch | |
moving_seconds | none | A total moving time (your screen's), shared across the card's legs by their distance and climb. Not with leg_seconds | |
climb | none | `{ up_m, down_m, kind: measured \ | estimated }: your own climb (the route page's), printed as given, with ≈` for an estimate. The legs' climbs add up to it |
pace_factor | usual | relaxed (1.25), usual (1), brisk (0.85), the Planner's paces, or a number from 0.5 to 2. Used when leg_seconds is not given | |
profile | hike | hike, run or bike. Only a hike has a calibrated time; for the others, send leg_seconds | |
cues | none | Up to 400 { at_m, text } (text at most 160 characters; e.g. the router's maneuvers) for the cue sheet. Cues beyond the end of the line are left out, and the card says so | |
units | metric | metric or imperial (miles, feet, °F, mph) | |
paper | a4 | a4 or letter | |
format | html | html or pdf | |
departure | none | An ISO time with its offset, for a one-part line. It adds the weather and sun at the hour each point is reached | |
link | none | The QR code's target: a https://trailsplits.com/ address of a share (/r/), a route (/route/) or the Planner (/planner), at most 200 characters (what one QR code holds). Without it, there is no QR code | |
caller | Optional label |
Response
-
format: html:200,text/html; charset=utf-8. One self-contained page, with the map as an inline PNG, the profile and the QR code as inline SVG, a print size for the paper, and no scripts or outside resources. -
format: pdf:200,application/pdf. Pages of the chosen size in Helvetica: the map, a vector profile, the QR code, the legs, the water and huts, the weather, the cue sheet and the sources. Characters outside WinAnsi print as "?", and "≈" prints as "~". - Missing parts: a part that could not be had (the map, the places index, the forecast) is left out, and the card lists it under "Not on this card".
Errors
JSON, { "error": { "code", "message" } }.
| HTTP | code | When |
|---|---|---|
| 400 | invalid_request | Not JSON, an unknown field, a bad name, waypoint, cue, pace, unit, paper, format or link |
| 400 | invalid_gpx, invalid_coordinates | As for route analysis |
| 405 | method_not_allowed | Any method but POST (and OPTIONS) |
| 413 | body_too_large, too_many_points | Over 1 MB, or over 5,000 points |
| 422 | too_long, no_line | As for route analysis |
| 422 | several_parts | A departure with a line of several parts: weather is for one day's line |
| 422 | legs_mismatch | leg_seconds does not have one value per leg |
| 422 | departure_in_past, beyond_forecast | As for route weather |
| 422 | budget_exhausted, corridor_too_large | The job's limit, as for route analysis |
| 503 | overloaded, tiles_unavailable | As for route analysis |
Versioning
Additive content may appear in route-card/1. A change of what a card states, or of a request field's meaning, is route-card/2.