Outdoor point-to-point route
POST https://api.trailsplits.com/route/v1
Checked by a live probe Key optional · 500 credits a day without one
Verified POST integration subset of Valhalla-compatible input; returns OSRM-shaped output with polyline6, metres and estimated seconds. Walking explicitly sets T3; running uses trailsplits.profile=run, cycling uses bicycle/hybrid. Unsupported car costing returns 400. No failure should become a straight-line route. Engine/settings and tile release are returned provenance, not immutable route replay. The Planner has a different site body/defaults; read /api/route/capabilities on trailsplits.com.
Example
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/route/v1' \
-H "Authorization: Bearer $TRAILSPLITS_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"locations":[{"lat":46.5369,"lon":12.1352},{"lat":46.536,"lon":12.133}],"costing":"pedestrian","costing_options":{"pedestrian":{"max_hiking_difficulty":3}}}' Request body
| Field | Type | Description |
|---|---|---|
locationsrequired | array | |
costingrequired | string: pedestrian | bicycle | auto | auto is included only to document its HTTP 400 refusal. |
trailsplits | object | |
costing_options | object |
Response
| Field | Type | Description |
|---|---|---|
code | string: Ok | |
routes | array | |
trailsplits | object |
Full response schema (JSON Schema)
{
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"Ok"
]
},
"routes": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"geometry": {
"type": "string",
"minLength": 1,
"description": "Polyline6; decoding yields lon,lat GeoJSON positions."
},
"distance": {
"type": "number",
"minimum": 0,
"description": "Metres."
},
"duration": {
"type": "number",
"minimum": 0,
"description": "Estimated seconds."
}
},
"required": [
"geometry",
"distance",
"duration"
]
}
},
"trailsplits": {
"type": "object",
"properties": {
"engine": {
"type": "object",
"nullable": true,
"description": "Available engine/tile/settings provenance; absent is unknown. Not a pinning parameter."
},
"warnings": {
"type": "array",
"items": {}
},
"summary": {
"type": "object",
"nullable": true
}
}
}
},
"required": [
"code",
"routes"
]
}Errors
400, 422, 503, plus the gateway's 401, 429 and 503 (error conventions). A refused request costs no credits.