# AllTrails Trail Scraper (`axlymxp/alltrails-trail-scraper`) Actor

Scrape AllTrails hiking trails by place or GPS — length, elevation, difficulty, ratings, activities, plus optional full descriptions, weather, points of interest and reviews. Clean structured JSON for apps, travel planning and research. Pay only for the results you get.

- **URL**: https://apify.com/axlymxp/alltrails-trail-scraper.md
- **Developed by:** [axly](https://apify.com/axlymxp) (community)
- **Categories:** Travel, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 dataset items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AllTrails Trail Scraper

Extract hiking, walking, running and biking trails from **AllTrails** at scale —
by place name or GPS coordinates. Get trail stats, GPS, ratings and activities,
plus **optional full descriptions, weather forecasts, points of interest and
reviews** that most AllTrails scrapers don't offer.

Built on AllTrails' own mobile API, so results are complete and reliable — no
brittle HTML parsing.

### Who it's for

- **Outdoor & travel apps** — populate a trail database with clean, structured
  fields and GPS.
- **Travel planners & content sites** — build "best hikes near X" guides with
  ratings, difficulty and photos.
- **Researchers & GIS analysts** — trail geometry, elevation, popularity and
  location data for analysis.
- **AI / LLM builders** — feed rich trail context into apps and agents.

### Output fields

| Field                                                 | Type   | Description                                  |
| ----------------------------------------------------- | ------ | -------------------------------------------- |
| `id`                                                  | int    | AllTrails trail ID                           |
| `name`                                                | string | Trail name                                   |
| `url`                                                 | string | Public AllTrails URL                         |
| `latitude` / `longitude`                              | number | Trailhead GPS                                |
| `areaName` / `cityName` / `stateName` / `countryName` | string | Location                                     |
| `lengthMeters` / `lengthMiles`                        | number | Trail length                                 |
| `elevationGainMeters`                                 | number | Total elevation gain                         |
| `difficulty`                                          | string | easy / moderate / hard                       |
| `routeType`                                           | string | loop / out_and_back / point_to_point         |
| `durationMinutes`                                     | int    | Estimated time                               |
| `avgRating`                                           | number | Average rating (0–5)                         |
| `numReviews` / `numPhotos`                            | int    | Community counts                             |
| `activities`                                          | array  | hiking, running, biking, camping…            |
| `features`                                            | array  | waterfall, views, dogs-leash, kids…          |
| `description`                                         | string | Full trail overview _(includeDetails)_       |
| `pointsOfInterest`                                    | array  | Waypoints along the trail _(includeDetails)_ |
| `ratingsBreakdown`                                    | object | Star distribution _(includeDetails)_         |
| `weather`                                             | array  | Multi-day forecast _(includeWeather)_        |
| `reviews`                                             | array  | Recent reviews _(reviewsPerTrail > 0)_       |
| `scrapedAt`                                           | string | ISO-8601 timestamp                           |

### High-value use cases

- **Build a hikes directory** for a region: search each park/city and store all
  trails with ratings and difficulty.
- **Trail-detail enrichment**: turn a list of place names into full trail pages
  with descriptions, POIs and photos.
- **Review mining**: pull recent reviews per trail for sentiment and trend
  analysis.
- **Weather-aware trip planning**: attach a forecast to each candidate trail.

### Input parameters

| Param                         | Type   | Default     | Notes                                                     |
| ----------------------------- | ------ | ----------- | --------------------------------------------------------- |
| `query`                       | string | —           | Place/area name (geocoded), e.g. "Yosemite National Park" |
| `latitude` / `longitude`      | number | —           | Explicit search center (overrides `query`)                |
| `maxItems`                    | int    | 50          | Trails to return (max 500 per area)                       |
| `recordTypes`                 | array  | `["trail"]` | trail / area / poi                                        |
| `sort`                        | enum   | best_match  | best_match / closest / most_popular / trending            |
| `difficulty`                  | array  | —           | easy / moderate / hard                                    |
| `minRating`                   | number | —           | Minimum average rating                                    |
| `minLengthKm` / `maxLengthKm` | number | —           | Length bounds                                             |
| `includeDetails`              | bool   | true        | Full description + POIs + rating breakdown                |
| `includeWeather`              | bool   | false       | Add weather forecast                                      |
| `reviewsPerTrail`             | int    | 0           | Reviews to fetch per trail                                |

### Example input

```json
{
    "query": "Yosemite National Park",
    "maxItems": 25,
    "sort": "most_popular",
    "difficulty": ["moderate", "hard"],
    "includeDetails": true,
    "reviewsPerTrail": 5
}
````

### Example output (truncated)

```json
{
    "id": 10005585,
    "name": "Half Dome via the John Muir Trail (JMT)",
    "url": "https://www.alltrails.com/trail/us/california/half-dome-via-the-john-muir-trail-jmt",
    "latitude": 37.73282,
    "longitude": -119.55778,
    "areaName": "Yosemite National Park",
    "stateName": "California",
    "lengthMiles": 17.2,
    "elevationGainMeters": 1617,
    "difficulty": "hard",
    "routeType": "out_and_back",
    "avgRating": 4.9,
    "numReviews": 17503,
    "activities": ["hiking", "camping"],
    "features": ["views", "waterfall", "river", "wildlife"],
    "description": "Half Dome is a serious endurance hike…",
    "scrapedAt": "2026-07-16T12:00:00Z"
}
```

### Scheduling & integrations

Schedule runs from the Apify Console, or trigger via API/webhook. Export to
**Google Sheets, CSV, JSON, Excel** or push to **Make, Zapier, S3** and your own
data warehouse.

### MCP / AI assistants

Prefer live access from Claude, Cursor or ChatGPT? Use the companion
**AllTrails MCP Server** actor to search trails, fetch details, reviews and
weather as MCP tools.

### FAQ

**Where does the data come from?** AllTrails' public mobile API — the same data
the app shows.

**How fresh is it?** Every run fetches live data at request time.

**Can I search a whole country?** Each search covers an area/city around a point
(up to 500 trails). Run multiple searches (per park/city) for wide coverage.

**Do I need a proxy or login?** No. The actor handles anti-bot automatically and
requires no account.

**Is scraping legal?** You are responsible for complying with AllTrails' terms
and applicable laws. Use the data responsibly and respect rate limits.

# Actor input Schema

## `query` (type: `string`):

Location to search around, e.g. "Yosemite National Park", "Los Angeles", "Lake District". Resolved to coordinates automatically. Leave empty if you provide latitude/longitude below.

## `latitude` (type: `number`):

Search-center latitude. Overrides the place name when set together with longitude.

## `longitude` (type: `number`):

Search-center longitude. Overrides the place name when set together with latitude.

## `maxItems` (type: `integer`):

Stop after this many trails (server returns up to 500 per area).

## `recordTypes` (type: `array`):

Which record types to return.

## `sort` (type: `string`):

How to order results.

## `difficulty` (type: `array`):

Only include trails of these difficulties.

## `minRating` (type: `number`):

Only include trails with an average rating >= this (0–5).

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

Only include trails at least this long, in kilometres.

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

Only include trails at most this long, in kilometres.

## `includeDetails` (type: `boolean`):

Enrich each trail with full description, highlights, tips, getting-there, parking, points of interest and rating breakdown (one extra request per trail).

## `includeWeather` (type: `boolean`):

Add a multi-day weather forecast for each trail (one extra request per trail).

## `reviewsPerTrail` (type: `integer`):

Fetch up to this many recent reviews for each trail (0 = none).

## `proxyConfiguration` (type: `object`):

Optional Apify proxy. The mobile API works without a proxy; use one only if you need a specific egress region.

## Actor input object example

```json
{
  "query": "Yosemite National Park",
  "maxItems": 50,
  "recordTypes": [
    "trail"
  ],
  "sort": "best_match",
  "difficulty": [],
  "includeDetails": true,
  "includeWeather": false,
  "reviewsPerTrail": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "query": "Yosemite National Park"
};

// Run the Actor and wait for it to finish
const run = await client.actor("axlymxp/alltrails-trail-scraper").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 = { "query": "Yosemite National Park" }

# Run the Actor and wait for it to finish
run = client.actor("axlymxp/alltrails-trail-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "Yosemite National Park"
}' |
apify call axlymxp/alltrails-trail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=axlymxp/alltrails-trail-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AllTrails Trail Scraper",
        "description": "Scrape AllTrails hiking trails by place or GPS — length, elevation, difficulty, ratings, activities, plus optional full descriptions, weather, points of interest and reviews. Clean structured JSON for apps, travel planning and research. Pay only for the results you get.",
        "version": "1.0",
        "x-build-id": "0eTIhXD6DXBDCGaLG"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/axlymxp~alltrails-trail-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-axlymxp-alltrails-trail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/axlymxp~alltrails-trail-scraper/runs": {
            "post": {
                "operationId": "runs-sync-axlymxp-alltrails-trail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/axlymxp~alltrails-trail-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-axlymxp-alltrails-trail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Place / area name",
                        "type": "string",
                        "description": "Location to search around, e.g. \"Yosemite National Park\", \"Los Angeles\", \"Lake District\". Resolved to coordinates automatically. Leave empty if you provide latitude/longitude below."
                    },
                    "latitude": {
                        "title": "Latitude",
                        "type": "number",
                        "description": "Search-center latitude. Overrides the place name when set together with longitude."
                    },
                    "longitude": {
                        "title": "Longitude",
                        "type": "number",
                        "description": "Search-center longitude. Overrides the place name when set together with latitude."
                    },
                    "maxItems": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Stop after this many trails (server returns up to 500 per area).",
                        "default": 50
                    },
                    "recordTypes": {
                        "title": "Record types",
                        "type": "array",
                        "description": "Which record types to return.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "trail",
                                "area",
                                "poi"
                            ],
                            "enumTitles": [
                                "Trails",
                                "Areas / parks",
                                "Points of interest"
                            ]
                        },
                        "default": [
                            "trail"
                        ]
                    },
                    "sort": {
                        "title": "Sort order",
                        "enum": [
                            "best_match",
                            "closest",
                            "most_popular",
                            "trending"
                        ],
                        "type": "string",
                        "description": "How to order results.",
                        "default": "best_match"
                    },
                    "difficulty": {
                        "title": "Difficulty filter",
                        "type": "array",
                        "description": "Only include trails of these difficulties.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "easy",
                                "moderate",
                                "hard"
                            ],
                            "enumTitles": [
                                "Easy",
                                "Moderate",
                                "Hard"
                            ]
                        },
                        "default": []
                    },
                    "minRating": {
                        "title": "Minimum rating",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "number",
                        "description": "Only include trails with an average rating >= this (0–5)."
                    },
                    "minLengthKm": {
                        "title": "Min length (km)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Only include trails at least this long, in kilometres."
                    },
                    "maxLengthKm": {
                        "title": "Max length (km)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Only include trails at most this long, in kilometres."
                    },
                    "includeDetails": {
                        "title": "Include full details",
                        "type": "boolean",
                        "description": "Enrich each trail with full description, highlights, tips, getting-there, parking, points of interest and rating breakdown (one extra request per trail).",
                        "default": true
                    },
                    "includeWeather": {
                        "title": "Include weather forecast",
                        "type": "boolean",
                        "description": "Add a multi-day weather forecast for each trail (one extra request per trail).",
                        "default": false
                    },
                    "reviewsPerTrail": {
                        "title": "Reviews per trail",
                        "minimum": 0,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Fetch up to this many recent reviews for each trail (0 = none).",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional Apify proxy. The mobile API works without a proxy; use one only if you need a specific egress region.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
