# Hiking Trails from OpenStreetMap (`vizellie/hiking-trails-osm`) Actor

Hiking routes and trails from OpenStreetMap for a place or a small map area: name, length, difficulty, surface, start and end, and a link to the map.

- **URL**: https://apify.com/vizellie/hiking-trails-osm.md
- **Developed by:** [Vi Zellie](https://apify.com/vizellie) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 trail rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Hiking Trails from OpenStreetMap

Hiking routes and trails for a place, or for a small box on the map. Each row has the name, the route type, the network, the length in kilometres, the difficulty and the surface when the map has them, the start and the end, the operator and the website when those are published, and a link to the route on the map.

General information from public maps. Check the route on the ground before you walk it.

Data (c) OpenStreetMap contributors, ODbL. https://www.openstreetmap.org/copyright

### Who it is for

Walkers, guidebook editors and visitor teams who want a repeatable list of signed routes and named trails for one place.

### What you get

- One row per route, in name order. The same route is saved once.
- Hiking routes, foot routes, or both.
- The network when the map uses one of the usual walking networks: local, regional, national or international (`lwn`, `rwn`, `nwn`, `iwn`).
- The length in kilometres. This is the distance published on the route when the map has one. Otherwise it is measured along the line inside the area you asked for.
- The difficulty when the route is graded, and the surface when the map names one.
- The start and the end of the line inside the area you asked for. A long route that only passes through can show a short piece of that route. The length stays the published distance when the map has one.
- The operator and the website, when the map publishes them for the route.
- A simplified line for each route, only when you turn geometry on. It is off by default. Turning it on does not change the price.
- A clear note in the run summary when the map does not respond or refuses the request. You are not charged for rows that were not saved.
- A very wide area is narrowed around its centre, so one run stays a local search.

### Source and licence

The routes come from OpenStreetMap. The licence is the Open Database License (ODbL).

Data (c) OpenStreetMap contributors, ODbL. https://www.openstreetmap.org/copyright

You can use the rows, including for commercial work. Credit OpenStreetMap when you pass them on. If you publish a database made from these rows, that database stays under the Open Database License as well.

This Actor is not affiliated with the OpenStreetMap project. The map changes. Use the link on the row to check the route.

### Tutorial

1. Leave **Place** on `Keswick, England`, or type a town, a park or a valley. To use a box instead, clear **Place** and set **Bounding box** as south, west, north, east. Example: `54.587,-3.164,54.613,-3.100`.
2. Choose **Route type**: hiking and foot, hiking only, or foot only.
3. Set **Min length km** or **Max length km** when you want a range. Leave them empty for every length. Choose **Difficulty** when you want one walking grade. Any also keeps routes that are not graded.
4. Leave **Max results** at 25, or lower it. The form starts at 10.
5. Leave **Include geometry** off unless you need a line for each route.
6. Run the Actor. The dataset has one row per route. The `OUTPUT` record says how many rows were saved and repeats the OpenStreetMap credit.
7. Schedule a task if you want a fresh list. Rows that were not saved are not charged.

### Example input

```json
{
  "place": "Keswick, England",
  "routeType": "both",
  "maxResults": 10
}
```

### Example output

```json
{
  "name": "Lakeside Amble",
  "osmId": "relation/19271630",
  "url": "https://www.openstreetmap.org/relation/19271630",
  "routeType": "foot",
  "network": "lwn",
  "lengthKm": 4.6,
  "difficulty": "hiking",
  "surface": "ground",
  "startLat": 54.591,
  "startLon": -3.142,
  "endLat": 54.593,
  "endLon": -3.14,
  "operator": "National Trust",
  "website": "https://www.nationaltrust.org.uk/visit/lake-district",
  "licence": "ODbL-1.0",
  "credit": "Data (c) OpenStreetMap contributors, ODbL. https://www.openstreetmap.org/copyright"
}
```

### Pricing

You pay a small fee when the run starts, then a fee for each route that is saved.

| What | Price |
|---|---|
| Run start | $0.00005 |
| Trail row | $0.002 |

Routes left out by the filters, routes past **Max results**, and rows the map did not return are not charged. If the map does not respond, you are not charged for routes it did not save. Geometry does not add a fee.

**Examples**

- The form, Keswick, up to 10 routes: 10 x $0.002 = **$0.02**, plus the $0.00005 start fee.
- The default cap of 25 routes: 25 x $0.002 = **$0.05**, plus the start fee.
- A shorter list of 8 routes: 8 x $0.002 = **$0.016**, plus the start fee.
- A run that saves nothing: **$0.00005**.

Use **Max results** and Apify's maximum cost per run to cap a single run. The pricing tab on the store is the price you are charged if it ever differs.

### Scheduling and integrations

Save a task and schedule it when you want a fresh list. Keep the same place so each file looks the same. The dataset can go to Google Sheets, Slack, email, Make or Zapier, or you can read it from the Apify API. The rows are small enough to pass to an AI agent over MCP.

### No personal data

This Actor does not collect personal data.

- It does not ask for a contact person, an email address or a phone number.
- The operator and the website are kept only when the map publishes them as the route operator and the route website.
- A contact name, a personal email and a phone number are not copied from other map tags.
- If an email address or a phone number still appears in a name or an operator, it is removed before the row is saved.
- Raw map responses are not stored.
- Logs and error text do not include the address that was called.

### FAQ

**Why is a route missing?**
Only routes drawn on the map as a hiking route or a foot route are listed. A path with no route is left out.

**Why is the length different from the signpost?**
The length is the distance published on the route when the map has one. Otherwise it is measured along the line inside the area you asked for. A route that continues outside that area can be shorter here than the full walk.

**Why is difficulty empty?**
The map has no walking grade on that route.

**Why was the area smaller than the place I typed?**
A very wide area is narrowed around its centre so one run stays a local search. Use a town, a park or a valley, or set a bounding box.

**Where do the routes come from?**
OpenStreetMap. This Actor is not affiliated with the OpenStreetMap project. Details can change. Use the link on the row to check.

### Next additions

- A simple map preview for one route.
- A note when a route changes its length.
- A few more ways to group a long list.

### Feedback

Missing a place or a field? Open an issue on the Actor's Issues tab.

# Actor input Schema

## `place` (type: `string`):

A town, a park or a valley, for example Keswick, England. Leave this empty when you set a bounding box.

## `bbox` (type: `string`):

South, west, north and east, in decimal degrees. Example: 54.587,-3.164,54.613,-3.100. Leave empty to use the place. A very wide area is narrowed around its centre.

## `routeType` (type: `string`):

Hiking routes, foot routes, or both.

## `minLengthKm` (type: `number`):

Shortest route to keep, in kilometres. Leave empty for no minimum.

## `maxLengthKm` (type: `number`):

Longest route to keep, in kilometres. Leave empty for no maximum.

## `difficulty` (type: `string`):

Keep routes with this walking grade. Any also keeps routes that are not graded.

## `maxResults` (type: `integer`):

Most routes saved in one run, from 1 to 100. Default 25. The form starts at 10.

## `includeGeometry` (type: `boolean`):

Add a simplified line for each route. Off by default. The price per route stays the same.

## Actor input object example

```json
{
  "place": "Keswick, England",
  "bbox": "54.587,-3.164,54.613,-3.100",
  "routeType": "both",
  "minLengthKm": 2,
  "maxLengthKm": 25,
  "difficulty": "",
  "maxResults": 10,
  "includeGeometry": false
}
```

# Actor output Schema

## `trails` (type: `string`):

One row per route, with length, grade, start and end, and a link to the map. Data (c) OpenStreetMap contributors, ODbL. https://www.openstreetmap.org/copyright

## `summary` (type: `string`):

The OUTPUT record in the default key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "place": "Keswick, England",
    "routeType": "both",
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("vizellie/hiking-trails-osm").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "place": "Keswick, England",
    "routeType": "both",
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("vizellie/hiking-trails-osm").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "place": "Keswick, England",
  "routeType": "both",
  "maxResults": 10
}' |
apify call vizellie/hiking-trails-osm --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vizellie/hiking-trails-osm"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/v4VBpePZCzdXbKNAx/builds/t0QGZ3tv6HUhBZvVs/openapi.json
