Trails in an area
GET https://api.trailsplits.com/trails/v1/bbox
Checked by a live probe Key optional · 500 credits a day without one 1 credit per call Daily area ceiling: 3,000 on Free
Signed hiking and cycling routes (OpenStreetMap route relations) that intersect a small box, each with its name, reference, network level, length, bounding box and a representative point. Note min_lng/max_lng here (lon for outdoor places). Counts toward the daily area ceiling.
Example
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/trails/v1/bbox?min_lat=46&min_lng=7.74&max_lat=46.03&max_lng=7.77&type=hiking&limit=2' \
-H "Authorization: Bearer $TRAILSPLITS_API_KEY" Parameters
| Name | In | Description |
|---|---|---|
min_latrequired | query | South edge. |
min_lngrequired | query | West edge (lng, not lon). |
max_latrequired | query | North edge. |
max_lngrequired | query | East edge. |
type | query | Route type. |
limit | query | Relations. |
Response
| Field | Type | Description |
|---|---|---|
type | string: FeatureCollection | |
features | array |
Full response schema (JSON Schema)
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"FeatureCollection"
]
},
"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",
"features"
]
}Errors
400, plus the gateway's 401, 429 and 503 (every error code). A refused request costs no credits.