Trail search

GET https://api.trailsplits.com/trails/v1/search

Checked by a live probe Key optional · 500 credits a day without one

Signed hiking and cycling routes (OpenStreetMap route relations) by name or reference, with network level, length and bounding box; the geometry is a representative point. Fetch a relation's full line with GET /trails/v1/relation/{osm_id}, or relations in an area with /trails/v1/bbox.

Example

Trail search (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/search?q=Haute+Route&limit=3' \
  -H "Authorization: Bearer $TRAILSPLITS_API_KEY"

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

Parameters

NameInDescription
qrequiredqueryName or reference.
limitqueryResults.
typequeryRoute type.

Response

FieldTypeDescription
typestring: FeatureCollection
querystring
featuresarray
Full response schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "FeatureCollection"
      ]
    },
    "query": {
      "type": "string"
    },
    "features": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Feature"
            ]
          },
          "properties": {
            "type": "object",
            "properties": {
              "osm_relation_id": {
                "type": "integer"
              },
              "route_type": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "network": {
                "type": "string",
                "nullable": true
              },
              "distance_m": {
                "type": "number"
              },
              "bbox": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "required": [
              "osm_relation_id",
              "name"
            ],
            "additionalProperties": true
          },
          "geometry": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "type",
          "properties",
          "geometry"
        ]
      }
    }
  },
  "required": [
    "type",
    "query",
    "features"
  ]
}

Errors

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