# AllTrails Scraper — Trails, Ratings, Photos, Difficulty (`yugenox/alltrails-scraper`) Actor

Pull AllTrails hiking-trail data by location: name, description, photos, ratings, reviews, difficulty, length, elevation, route type, parking, coordinates. No login.

- **URL**: https://apify.com/yugenox/alltrails-scraper.md
- **Developed by:** [Yugenox Corp](https://apify.com/yugenox) (community)
- **Categories:** Travel, Automation, Integrations
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

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

## 🏔️ AllTrails Scraper — Trail Data Extractor

**Pull AllTrails hiking-trail data in seconds.** Photos, ratings, reviews, difficulty, elevation, route type, coordinates — for any national park, US state, city, or custom coordinates. **No login required.** ⛰️

📊 20+ fields per trail · 🌍 any location worldwide · 🚫 no auth · ⚡ live data every run

***

### 🚀 Quick start

Give it a **location** and your **session** (a one-time capture — see below):

```json
{ "location": "Yosemite National Park", "maxItems": 50, "session": "{...your session JSON...}" }
```

Run it and get clean, structured trail records as **JSON, CSV, Excel, XML, or JSONL**.

***

### 🔑 Getting a session

The scraper talks to AllTrails' mobile API, which needs an **anonymous app session** — an app-level
key plus a DataDome cookie. **No AllTrails account is involved** (the actor refuses account tokens
by design), so nothing of yours is at risk.

To capture one (takes ~2 minutes, lasts until DataDome rotates it):

1. Run any HTTP proxy on your computer (mitmproxy, Charles, Proxyman) and point your phone's
   Wi-Fi proxy at it, with the proxy's certificate trusted.
2. Open the AllTrails app and search anything.
3. Find a request to `api-v5.alltrails.com` and copy its request headers as a JSON object —
   the important ones are `x-at-key`, `x-at-client-id`, `user-agent`, and `cookie`.
4. Paste that JSON object into the **session** input field (it is stored encrypted).

If runs start failing with a 401/403, the DataDome cookie rotated — capture a fresh one the same way.

***

### ⚙️ Input

| Field | Type | Required | Description |
|---|---|---|---|
| **`location`** | string | ✅ **yes** | A park, region, US state, city, or coordinates — `"Yosemite National Park"`, `"Colorado"`, `"Denver, CO"`, or `"37.7261, -119.5587"`. |
| **`session`** | string | ✅ **yes** | Your AllTrails session as a JSON object of headers — see **Getting a session** above. Stored encrypted. |
| `maxItems` | integer | no | How many trails to return (default 10). |
| `includeDetails` | boolean | no | Also fetch each trail's detail page for parking, full photo gallery, and highlights (slower, richer). Default off. |
| `proxyConfiguration` | object | no | Proxy — residential recommended (AllTrails is behind DataDome). |

**Examples**

```json
{ "location": "Zion National Park", "maxItems": 100, "includeDetails": true }
```

```json
{ "location": "39.7392, -104.9903", "maxItems": 25 }
```

***

### 📤 Output — one record per trail

```json
{
  "id": "10027503",
  "name": "Clouds Rest Trail",
  "description": "One of Yosemite's classic high-country hikes with 360° summit views…",
  "imageUrl": "https://www.alltrails.com/api/alltrails/trails/10027503/profile_photo",
  "imageGallery": ["https://…"],
  "rating": 4.9,
  "reviewCount": 6320,
  "difficulty": "Hard",
  "difficultyScore": 5,
  "lengthMiles": 12.6,
  "lengthKm": 20.28,
  "elevationGainFt": 3116,
  "elevationGainM": 950,
  "routeType": "Out & Back",
  "area": "Yosemite National Park",
  "city": "Yosemite Valley",
  "state": "California",
  "country": "United States",
  "latitude": 37.82563,
  "longitude": -119.47054,
  "parking": "Trailhead parking available",
  "dogsAllowed": false,
  "kidFriendly": false,
  "verifiedMapId": 287858466,
  "url": "https://www.alltrails.com/trail/us/california/clouds-rest--6",
  "scrapedAt": "2026-07-14T11:55:48.167Z"
}
```

#### 🧾 Fields

| Field | Description |
|---|---|
| 🆔 `id`, 🔗 `url` | AllTrails trail ID and canonical URL |
| 🏷️ `name`, 📝 `description` | Trail name and description |
| 🖼️ `imageUrl`, `imageGallery` | Hero photo + gallery (gallery with `includeDetails`) |
| ⭐ `rating`, 💬 `reviewCount` | Average rating and number of reviews |
| 🎯 `difficulty`, `difficultyScore` | Easy / Moderate / Hard + AllTrails 1–7 score |
| 📏 `lengthMiles`, `lengthKm` | Trail length |
| ⛰️ `elevationGainFt`, `elevationGainM` | Elevation gain |
| 🛤️ `routeType` | Loop · Out & Back · Point to Point |
| 🏞️ `area`, `city`, `state`, `country` | Location detail |
| 📍 `latitude`, `longitude` | Coordinates |
| 🅿️ `parking` | Parking info (with `includeDetails`) |
| 🐶 `dogsAllowed`, 🚸 `kidFriendly` | Access flags where AllTrails exposes them |
| 📅 `scrapedAt` | ISO timestamp of the run |

***

### 💡 Built for

- 🧭 **Travel & outdoor brands** — location-aware trail content
- 📱 **App developers** — power hike-discovery without owning a crawler
- 🏨 **Hospitality & tourism** — recommend nearby trails to guests
- 📊 **Researchers & marketers** — outdoor-recreation trends, geo-targeted content

***

### ❓ FAQ

**Is it legal to scrape AllTrails?**
This Actor only collects publicly available data: trail information that anyone can see on AllTrails without an account. Collecting publicly available data is generally legal, but you're responsible for how you use it. You must follow privacy laws such as GDPR, PIPEDA and CCPA, as well as AllTrails' terms. If you're unsure, check with a lawyer. More on this: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

**Does it access any private data?**
No. Everything comes from pages AllTrails shows to any visitor without logging in. It never uses a login, never touches private or restricted accounts, and never reaches password-protected areas.

### ❓ Notes

- **No login / account needed** — pulls AllTrails' public trail catalog.
- **Live data** — every run reflects AllTrails at run time.
- Route/loop **GPS geometry** for each trail is available too (via `verifiedMapId`) — ask if you want it added to the output.

*Not affiliated with AllTrails. Scrapes publicly available trail data.*

# Actor input Schema

## `location` (type: `string`):

REQUIRED. A national park, region, US state, city, or coordinates — e.g. "Yosemite National Park", "Colorado", "Denver, CO", or "37.7261, -119.5587". Trails are pulled from around this location.

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

How many trails to return. Free preview is limited to 10.

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

Also fetch each trail's detail page for parking info, full photo gallery, and highlights. Slower but richer. Off = fast search-feed fields only.

## `detailStreams` (type: `integer`):

Parallel detail fetches when "Fetch full details" is on. Higher = faster.

## `session` (type: `string`):

REQUIRED. Your AllTrails session as a JSON object of headers (anonymous app key + DataDome cookie — no account needed). Capture it once from the AllTrails app with any HTTP proxy (see README → "Getting a session"). Stored encrypted.

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

Proxy for requests. Residential recommended — AllTrails is behind DataDome anti-bot.

## Actor input object example

```json
{
  "location": "Yosemite National Park",
  "maxItems": 10,
  "includeDetails": false,
  "detailStreams": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "location": "Yosemite National Park",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/alltrails-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 = {
    "location": "Yosemite National Park",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/alltrails-scraper").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 '{
  "location": "Yosemite National Park",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call yugenox/alltrails-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yugenox/alltrails-scraper"
        }
    }
}
```

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/5VJREl1dPzvTkAQMD/builds/SEjv5J3cJ8JuFp5rr/openapi.json
