# AllTrails Scraper — Trails, Ratings, Photos, Difficulty (`arpitgandhi1934/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/arpitgandhi1934/alltrails-scraper.md
- **Developed by:** [Arpit Gandhi](https://apify.com/arpitgandhi1934) (community)
- **Categories:** Videos, Travel, Integrations
- **Stats:** 2 total users, 1 monthly users, 0.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/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 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

Just give it a **location** — that's the only required input:

```json
{ "location": "Yosemite National Park", "maxItems": 50 }
````

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

***

### ⚙️ 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"`. |
| `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

***

### ❓ 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`):

Paste your AllTrails session here as a JSON object of headers (app key + DataDome cookie). This is the easiest way to authenticate — no env var needed. 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("arpitgandhi1934/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("arpitgandhi1934/alltrails-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 '{
  "location": "Yosemite National Park",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call arpitgandhi1934/alltrails-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AllTrails Scraper — Trails, Ratings, Photos, Difficulty",
        "description": "Pull AllTrails hiking-trail data by location: name, description, photos, ratings, reviews, difficulty, length, elevation, route type, parking, coordinates. No login.",
        "version": "0.1",
        "x-build-id": "8YcOLh8okIggifNPj"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/arpitgandhi1934~alltrails-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-arpitgandhi1934-alltrails-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/arpitgandhi1934~alltrails-scraper/runs": {
            "post": {
                "operationId": "runs-sync-arpitgandhi1934-alltrails-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/arpitgandhi1934~alltrails-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-arpitgandhi1934-alltrails-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",
                "required": [
                    "location"
                ],
                "properties": {
                    "location": {
                        "title": "📍 Location",
                        "type": "string",
                        "description": "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": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "How many trails to return. Free preview is limited to 10.",
                        "default": 10
                    },
                    "includeDetails": {
                        "title": "Fetch full details",
                        "type": "boolean",
                        "description": "Also fetch each trail's detail page for parking info, full photo gallery, and highlights. Slower but richer. Off = fast search-feed fields only.",
                        "default": false
                    },
                    "detailStreams": {
                        "title": "Detail streams",
                        "minimum": 1,
                        "maximum": 40,
                        "type": "integer",
                        "description": "Parallel detail fetches when \"Fetch full details\" is on. Higher = faster.",
                        "default": 20
                    },
                    "session": {
                        "title": "🔑 AllTrails session (JSON)",
                        "type": "string",
                        "description": "Paste your AllTrails session here as a JSON object of headers (app key + DataDome cookie). This is the easiest way to authenticate — no env var needed. Stored encrypted."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Proxy for requests. Residential recommended — AllTrails is behind DataDome anti-bot.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
