Place search
GET https://api.trailsplits.com/search/v1/forward
Checked by a live probe Key optional · 500 credits a day without one
Places and signed trails by name: towns, peaks, passes, lakes, huts, stations and more. A bias_bbox lifts places in the map view without excluding others. Misspellings and German ue/oe/ae spellings are found when nothing matches exactly (match: fuzzy). Coordinates are [lon, lat]. Not an address geocoder.
Example
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/search/v1/forward?q=Matterhorn&limit=3&bias_bbox=7.5,45.9,7.9,46.1' \
-H "Authorization: Bearer $TRAILSPLITS_API_KEY" Parameters
| Name | In | Description |
|---|---|---|
qrequired | query | The name, at least 2 letters. "Name, Place" searches near that place; "Place station" finds its railway stations. |
limit | query | Results. |
bias_bbox | query | minLon,minLat,maxLon,maxLat: a soft preference for the map view. |
bbox | query | minLon,minLat,maxLon,maxLat: a hard filter. |
Response
| Field | Type | Description |
|---|---|---|
query | string | |
features | array of Place |
Full response schema (JSON Schema)
{
"type": "object",
"properties": {
"query": {
"type": "string"
},
"features": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"kind": {
"type": "string",
"description": "city, town, village, hamlet, locality, suburb, peak, pass, lake, park, viewpoint, hut, station, hotel, trail and more."
},
"center": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "number"
},
"description": "[lon, lat]"
},
"region": {
"type": "string",
"nullable": true
},
"elevation_m": {
"type": "number",
"nullable": true
},
"match": {
"type": "string",
"enum": [
"fuzzy"
],
"description": "Present when the place was found despite a misspelling."
},
"trail": {
"type": "object",
"additionalProperties": true,
"description": "For kind trail: relation id, network, length, bbox and ends."
}
},
"required": [
"id",
"name",
"kind",
"center"
]
}
}
},
"required": [
"query",
"features"
]
}Errors
400, plus the gateway's 401, 429 and 503 (error conventions). A refused request costs no credits.