OrbTop

OSM Overpass Hiking Trail Route Scraper

AIDEVELOPER TOOLSOPEN SOURCE

OSM Overpass Hiking Trail Route Scraper

Query the Overpass API for OpenStreetMap hiking route relations by bounding box or region name. Returns ODbL-licensed trail geometry, route metadata, and full OSM tags — the only license-clean trail corpus on Apify, safe for AI training and GIS use.


What it does

The actor sends Overpass QL queries against the public overpass-api.de endpoint (or a mirror of your choice) to retrieve relation elements with route=hiking or route=foot tags within the specified geographic area. For each relation it returns:

  • Route name, type, and network level (international / national / regional / local)
  • Operator and start/end node names
  • Distance in kilometres (from OSM distance or length tags)
  • OSMC waymark symbol
  • Bounding box coordinates
  • Pipe-separated member way IDs as a geometry proxy
  • Full OSM tag map as a JSON string
  • Wikidata / Wikipedia cross-references

All data is released by OpenStreetMap contributors under the Open Database Licence (ODbL). You are free to use it for AI training, GIS pipelines, or commercial products — attribution required.


Input

Field Type Default Description
Max Items integer 100 Maximum route relations to return across all queries
Bounding Boxes array ["35.5,136.5,36.2,137.5"] One or more south,west,north,east decimal-degree strings
Region Names array [] Place names resolved to bounding boxes via Nominatim. Used when Bounding Boxes is empty. Example: "Tyrol, Austria"
Route Types array ["hiking","foot"] OSM route tag values to include
Network Filter array [] Restrict to specific network levels: iwn (international), nwn (national), rwn (regional), lwn (local). Empty = all levels
Mirror Endpoint string Alternative Overpass API URL, e.g. https://overpass.kumi.systems/api/interpreter

Example inputs

Fetch all hiking routes in a Japanese alpine area:

{
  "maxItems": 50,
  "bboxList": ["35.5,136.5,36.2,137.5"],
  "routeTypes": ["hiking", "foot"]
}

Fetch only international and national routes in the Swiss Alps:

{
  "maxItems": 20,
  "bboxList": ["46.0,7.0,47.0,8.5"],
  "routeTypes": ["hiking"],
  "networkFilter": ["iwn", "nwn"]
}

Resolve a region by name:

{
  "maxItems": 30,
  "regionNames": ["Tyrol, Austria"],
  "routeTypes": ["hiking"]
}

Output

Each result is a flat object. Numeric fields (distance_km, bbox_*) are numbers; all others are strings. Missing fields are omitted.

Field Description
osm_id OSM relation numeric ID
osm_type relation or way
route_name Human-readable name from the name tag
route_type hiking or foot
network Network level: iwn, nwn, rwn, lwn, or empty
operator Operator/maintainer of the route
distance_km Route distance in kilometres
osmc_symbol OSMC waymark symbol string
from_node Start location name
to_node End location name
geometry Pipe-separated member way OSM IDs
bbox_south / bbox_west / bbox_north / bbox_east Element bounding box
tags Full OSM tag map as a JSON string
wikidata Wikidata entity QID
wikipedia Wikipedia article reference
source_bbox The query bbox that returned this element

Example result

{
  "osm_id": 12345678,
  "osm_type": "relation",
  "route_name": "Nakasendo Trail",
  "route_type": "hiking",
  "network": "nwn",
  "distance_km": 42.5,
  "from_node": "Magome",
  "to_node": "Narai",
  "bbox_south": 35.57,
  "bbox_west": 137.49,
  "bbox_north": 35.98,
  "bbox_east": 137.88,
  "tags": "{\"route\":\"hiking\",\"network\":\"nwn\",\"name\":\"Nakasendo Trail\"}",
  "source_bbox": "35.5,136.5,36.2,137.5"
}

Rate limits and mirrors

The public overpass-api.de server enforces a concurrent-query limit. For bulk collection across many bounding boxes, use the Mirror Endpoint input to point at a less-loaded server:

  • https://overpass.kumi.systems/api/interpreter
  • https://maps.mail.ru/osm/tools/overpass/api/interpreter
  • https://overpass.openstreetmap.ru/api/interpreter

The actor inserts an 800 ms delay between successive bbox queries to respect server etiquette.


License

Route data is copyright OpenStreetMap contributors, available under the Open Database Licence. Attribution is required for any derived work.