A trail relation’s line

GET https://api.trailsplits.com/trails/v1/relation/{osm_id}

Checked by a live probe Key optional · 500 credits a day without one 1 credit per call

One signed route’s full line (LineString or MultiLineString, [lon, lat]) and its properties: name, reference, network level, length, climb where known, bounding box and point count. Large relations can be several hundred kB; the order of parts is not a walking order, and nothing here says the route is open or passable.

Example

A trail relation’s line (curl)
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/trails/v1/relation/9235092' \
  -H "Authorization: Bearer $TRAILSPLITS_API_KEY"

Sends a real request, with your key or the keyless allowance.

Parameters

NameInDescription
osm_idrequiredpathThe OpenStreetMap relation id, as trail search and trails in an area give it.

Response

FieldTypeDescription
typestring: Feature
propertiesobject
geometryobject
Full response schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "Feature"
      ]
    },
    "properties": {
      "type": "object",
      "properties": {
        "osm_relation_id": {
          "type": "integer"
        },
        "route_type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "ref": {
          "type": "string",
          "nullable": true
        },
        "network": {
          "type": "string",
          "nullable": true
        },
        "tier": {
          "type": "integer"
        },
        "distance_m": {
          "type": "number"
        },
        "ascent_m": {
          "type": "number"
        },
        "descent_m": {
          "type": "number"
        },
        "bbox": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "[minLon, minLat, maxLon, maxLat]"
        },
        "point_count": {
          "type": "integer"
        }
      },
      "required": [
        "osm_relation_id",
        "name",
        "bbox"
      ]
    },
    "geometry": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LineString",
            "MultiLineString"
          ]
        },
        "coordinates": {
          "type": "array",
          "items": {},
          "description": "[lon, lat] points (MultiLineString: one array per part)"
        }
      },
      "required": [
        "type",
        "coordinates"
      ]
    }
  },
  "required": [
    "type",
    "properties",
    "geometry"
  ]
}

Errors

400, 404, plus the gateway's 401, 429 and 503 (every error code). A refused request costs no credits.