# 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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

Download the OpenAPI definition: https://api.apify.com/v2/actors/TeIYIFPnm6SXCVGml/builds/0eTIhXD6DXBDCGaLG/openapi.json
