# AllTrails Hiking Scraper - Trails, Stats & Reviews (`abotapi/alltrails-hiking-scraper`) Actor

Scrape AllTrails, the world's largest hiking platform: trails with difficulty, length, elevation gain, route type, ratings, review counts, dog and kid friendly attributes, trail conditions and hiker reviews. Browse any region or paste links, with recurring change monitoring.

- **URL**: https://apify.com/abotapi/alltrails-hiking-scraper.md
- **Developed by:** [Abot API](https://apify.com/abotapi) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 trail records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Hiking Scraper

Collect public AllTrails trail records from regional grids, tag grids, or trail links. Listing mode returns core trail identity, location, ratings, difficulty, distance, elevation, and route information when the site serves it. Detail mode adds descriptions, conditions, attributes, rating breakdowns, counts, and recent reviews. The actor also supports photos, readable GPS-track files, resume, incremental monitoring, and optional connector delivery.

### Why This Scraper?

- Collects trail identity, location, difficulty, ratings, distance, elevation, route type, activities, and features in one dataset row.
- Supports regional browsing, tag-specific grids, pasted grid links, and pasted trail links.
- Reads the site's served GPS track as an encoded polyline with a point count when detail mode provides it.
- Adds descriptions, alerts, highlights, review samples, weather, popularity, and community photos when enabled.
- Applies difficulty, rating, review-count, activity, route-type, length, elevation, and feature filters consistently in both collection modes.
- Supports resume for interrupted runs and incremental labels for recurring monitoring.
- Keeps the complete dataset in Apify and can optionally export a concise summary through an authorized connector.

### Data You Get

> Sample shape: values are illustrative placeholders, not from a live trail.

| Field | Example |
| --- | --- |
| `recordType` | `trail` |
| `id` | `00000001` |
| `name` | `Sample Lake Loop Trail` |
| `url` | `https://www.alltrails.com/explore/trail/sample-lake-loop-trail` |
| `slug` | `trail/us/colorado/sample-lake-loop-trail` |
| `difficulty` / `difficultyGrade` | `moderate` / `3` |
| `rating` / `ratingCount` | `4.8` / `1200` |
| `lengthMeters` / `lengthMiles` | `8500` / `5.3` |
| `elevationGainMeters` / `elevationMaxMeters` | `420` / `3120` |
| `durationMinutes` / `routeType` | `180` / `Loop` |
| `activities` / `features` | `["hiking"]` / `["lake"]` |
| `areaName` / `stateName` | `Sample National Park` / `Colorado` |
| `cityName` / `countryName` | `Sample Valley` / `United States` |
| `lat` / `lng` | `39.0000` / `-106.7000` |
| `routeGeometry` / `routePoints` | `encoded-polyline-placeholder` / `000` |
| `overview` / `description` | `Sample overview` / `Sample description text` |
| `alerts` / `highlights` | `[]` / `[]` |
| `reviews` / `photos` | `[]` / `[]` |
| `surfaceTypes` / `weather` | `["dirt"]` / `{"summary":"Sample forecast"}` |
| `sourceUrl` / `scrapedAt` | `https://www.alltrails.com/us/colorado` / `2026-01-01T00:00:00.000Z` |

Listing fields are populated whenever the source supplies them. Detail fields depend on `fetchDetails`. The detail page serves the five most recent reviews, five per trail, in the reviews field. `routeGeometry` and `routePoints` are present only when the site serves a GPS track. `photos` depends on `fetchPhotos` and the photo service response.

### How to Use

Browse one geographic region with the default listing fields. Type a place or
region keyword such as `California`, `Yosemite`, or `British Columbia` into
`regionPath`. The actor resolves the best geographic match on AllTrails, then
builds the region and tag-grid URLs. By contrast, **My own links** mode accepts
a list of separate grid or trail links.

```json
{
  "mode": "search",
  "regionPath": "Colorado",
  "maxItems": 20
}
```

Browse with tags, filters, and detail enrichment:

```json
{
  "mode": "search",
  "regionPath": "Colorado",
  "tags": ["backpacking", "waterfall"],
  "difficulty": ["moderate", "hard"],
  "minRating": 4.5,
  "fetchDetails": true,
  "maxItems": 50
}
```

Read pasted grid and trail links:

```json
{
  "mode": "urls",
  "urls": [
    "https://www.alltrails.com/us/california",
    "https://www.alltrails.com/explore/trail/us/colorado/sample-lake-loop-trail"
  ],
  "fetchDetails": true,
  "maxItems": 10
}
```

A pasted trail link still produces a URL-backed row if the detail page is
temporarily refused; detail-only fields remain empty and no detail surcharge is
charged. A genuine missing trail page is omitted.

Run recurring monitoring with readable track files:

```json
{
  "mode": "urls",
  "urls": ["https://www.alltrails.com/us/colorado"],
  "fetchDetails": true,
  "storeTracksInKV": true,
  "incrementalMode": true,
  "stateKey": "sample-colorado-monitor"
}
```

Use `fetchDetails: true` when you need descriptions, reviews, detail attributes, or GPS tracks. The dataset row is always the primary output. `storeTracksInKV` adds a readable key such as `track__us-california__vernal-falls.json` for systems that prefer one track object per trail.

#### Send results into your apps (MCP connectors)

Add authorized connector IDs to `mcpConnectors` to send concise summaries after the scrape. Set `notionParentPageUrl` when using Notion. Connector delivery is optional and never changes the complete Apify dataset.

### Input Parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `search` | Choose `search` to browse a region or `urls` to read the links in `urls`. |
| `regionPath` | string | `California` | Place or region keyword resolved to a geographic AllTrails scope in `search` mode. Existing paths and full AllTrails URLs remain accepted for compatibility. |
| `tags` | string\[] | `["backpacking"]` | Optional tag grids to add after the region grid. An unavailable tag produces a clear validation failure. |
| `urls` | string\[] | sample region URL | Grid or trail links used by `urls` mode. Trail links produce one enriched trail record. |
| `followSubGrids` | boolean | `false` | In `urls` mode, follow additional grid links discovered from pasted grid pages, which is read in that mode only. |
| `fetchDetails` | boolean | `false` | Open each trail detail page for descriptions, exact attributes, conditions, reviews, and any GPS track served by the page. A detail charge applies to successfully saved detail rows. |
| `fetchPhotos` | boolean | `true` | Fetch community photos from the separate photo service. A failure keeps the trail row and does not fail the run. |
| `maxPhotos` | integer | `10` | Maximum photos per trail when enabled. Range: 1 to 50. |
| `storeTracksInKV` | boolean | `false` | Save each served GPS track as a readable per-trail KV record in addition to the dataset row. A storage charge applies only after the KV write succeeds. |
| `difficulty` | string\[] | empty | Keep only trails labelled `easy`, `moderate`, `hard`, or `strenuous`. Applied to records collected in either mode. |
| `minRating` | number | `0` | Keep trails whose rating is at least this value. Range: 0 to 5. |
| `minReviews` | integer | `0` | Keep trails with at least this many reviews. |
| `activityFilter` | string\[] | empty | Keep trails tagged with at least one activity such as `hiking`, `backpacking`, or `mountain-biking`. |
| `routeTypeFilter` | string\[] | empty | Keep `loop`, `out-and-back`, or `point-to-point` routes. |
| `lengthMin` | number | empty | Keep trails at least this long, in metres. |
| `lengthMax` | number | empty | Keep trails no longer than this, in metres. |
| `elevationGainMin` | number | empty | Keep trails with at least this elevation gain, in metres. |
| `elevationGainMax` | number | empty | Keep trails with no more than this elevation gain, in metres. |
| `featuresFilter` | string\[] | empty | Keep trails containing every selected feature label, such as `waterfall`, `views`, `forest`, or `dogs-leash`. |
| `maxItems` | integer | `20` | Maximum trail rows across the run. `0` means no item cap. |
| `maxPages` | integer | `0` | Maximum grid pages as a runaway guard. `0` reads until the configured scope ends. |
| `resumeFromRunId` | string | empty | Continue one interrupted run or dataset. Previously returned trail IDs are skipped. Do not combine this with incremental monitoring. |
| `incrementalMode` | boolean | `false` | Remember the same scope for recurring runs. The first run returns `NEW`; later runs return changes by default. |
| `stateKey` | string | empty | Optional name for the incremental campaign. Empty derives a stable key from the collection scope. |
| `emitUnchanged` | boolean | `false` | In incremental mode, also return unchanged trails labelled `UNCHANGED`. These rows are returned and billed. |
| `emitExpired` | boolean | `false` | In incremental mode, return trails absent from a complete scan as `EXPIRED`. Capped or interrupted scans do not infer expiration. |
| `mcpConnectors` | string\[] | empty | Optional authorized connector IDs for concise result summaries after the scrape. |
| `notionParentPageUrl` | string | empty | Notion destination page when a Notion connector is selected. Ignored by other connectors. |
| `maxNotifyListings` | integer | `50` | Maximum rows sent to each connector. Does not change the dataset. |
| `proxyConfiguration` | object | Apify connection | Connection settings for source requests. Keep the prefilled setting unless you have an authorized alternative. |

Resume and incremental monitoring are separate features. Resume continues one interrupted collection. Incremental mode compares recurring runs of the same scope and adds `changeType`, `changedFields`, `firstSeenAt`, and `lastSeenAt` to returned rows.

### Output Example

> Sample shape: values are illustrative placeholders, not from a live trail.

```json
{
  "recordType": "trail",
  "id": "00000001",
  "name": "Sample Lake Loop Trail",
  "url": "https://www.alltrails.com/explore/trail/sample-lake-loop-trail",
  "slug": "trail/us/colorado/sample-lake-loop-trail",
  "difficulty": "moderate",
  "difficultyGrade": 3,
  "rating": 4.8,
  "ratingCount": 1200,
  "reviewTextCount": 300,
  "lengthMeters": 8500,
  "lengthMiles": 5.3,
  "elevationGainMeters": 420,
  "elevationMaxMeters": 3120,
  "durationMinutes": 180,
  "routeType": "Loop",
  "activities": ["hiking"],
  "features": ["lake", "views"],
  "areaName": "Sample National Park",
  "areaSlug": "parks/us/colorado/sample-national-park",
  "cityName": "Sample Valley",
  "stateName": "Colorado",
  "countryName": "United States",
  "lat": 39.0000,
  "lng": -106.7000,
  "routeGeometry": "encoded-polyline-placeholder",
  "routePoints": 0,
  "imageUrl": "https://images.alltrails.com/000000000-placeholder",
  "overview": "Sample trail overview.",
  "description": "Sample detail description text appears when fetchDetails is enabled.",
  "alerts": [],
  "highlights": [],
  "ratingsBreakdown": {"1": 10, "2": 20, "3": 80, "4": 300, "5": 790},
  "reviewCount": 300,
  "photoCount": 40,
  "completedCount": 8000,
  "seasonStart": "2026-05-01",
  "seasonEnd": "2026-10-01",
  "reviews": [],
  "photos": [],
  "surfaceTypes": ["dirt"],
  "weather": {"summary": "Sample forecast"},
  "popularity": 0.75,
  "reviewsFetched": 5,
  "sourceType": "grid",
  "sourceUrl": "https://www.alltrails.com/us/colorado",
  "position": 1,
  "scrapedAt": "2026-01-01T00:00:00.000Z",
  "changeType": "NEW",
  "changedFields": [],
  "firstSeenAt": "2026-01-01T00:00:00.000Z",
  "lastSeenAt": "2026-01-01T00:00:00.000Z"
}
```

### Plan Requirement

An Apify account and a connection configuration that can access the selected public source are required. The actor uses the connection settings supplied in the input and returns source-derived rows only when the source serves the requested data.

# Actor input Schema

## `mode` (type: `string`):

Choose whether to browse a region and its optional tag grids, or read the grid and trail links you provide.

## `regionPath` (type: `string`):

Used only in Browse a region mode. Type a place or region keyword such as California, Yosemite, or British Columbia. The actor searches AllTrails for the best geographic match, uses that region as the collection scope, then adds any Trail tag grids you select. My own links mode is separate: use it when you already have specific grid or trail links.

## `tags` (type: `array`):

Only read when mode = browse a region. Each tag adds its own regional grid, such as backpacking, waterfall, forest, or dog-friendly. An unavailable tag fails clearly instead of silently broadening the search.

## `urls` (type: `array`):

Used in urls mode. Paste region-grid links, tag-grid links, or trail-page links. Grid links are walked; each trail link produces one trail record.

## `followSubGrids` (type: `boolean`):

Only read when mode = my own links. Follow extra tag, city, and park grids discovered from pasted grid pages. The item cap and grid-page guard still apply.

## `fetchDetails` (type: `boolean`):

Open each trail page for descriptions, exact statistics, elevation data, attributes, conditions, alerts, rating breakdowns, counts, and recent reviews served by the page. A detail charge applies to successfully saved detail rows.

## `fetchPhotos` (type: `boolean`):

Fetch up to Max photos per trail, including image links, captions, likes, GPS location, and photographer credit. Photo failures keep the trail record and do not fail the run.

## `maxPhotos` (type: `integer`):

Maximum number of community photos to keep for each trail when enabled. Range: 1 to 50.

## `storeTracksInKV` (type: `boolean`):

When the site serves a GPS track, save it in addition to the dataset row under a readable key such as track\_\_us-california\_\_vernal-falls.json. The value contains the encoded polyline and point count. Storage is charged only after a successful write.

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

Keep only trails labelled easy, moderate, hard, or strenuous. Applied to records collected in either mode. A pasted trail link without a difficulty label is excluded when this filter is set.

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

Keep only trails whose average rating meets or exceeds this value. Range: 0 to 5. Applied in either mode.

## `minReviews` (type: `integer`):

Keep only trails with at least this many reviews. Applied in either mode.

## `activityFilter` (type: `array`):

Keep trails tagged with at least one selected activity. Applied in either mode.

## `routeTypeFilter` (type: `array`):

Keep trails whose route type matches one of the selected values. Applied in either mode.

## `lengthMin` (type: `number`):

Keep trails at least this long. Applied in either mode.

## `lengthMax` (type: `number`):

Keep trails no longer than this. Applied in either mode.

## `elevationGainMin` (type: `number`):

Keep trails with at least this elevation gain. Applied in either mode.

## `elevationGainMax` (type: `number`):

Keep trails with no more than this elevation gain. Applied in either mode.

## `featuresFilter` (type: `array`):

Keep trails containing every selected feature label. Use the labels returned by AllTrails, such as waterfall, views, forest, or dogs-leash. Applied in either mode.

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

Maximum trail records across the whole run. Set 0 for no item cap; the configured grids and page guard still bound the walk.

## `maxPages` (type: `integer`):

Safety guard for the number of grid pages read in one run. Set 0 to read until the selected scope ends.

## `resumeFromRunId` (type: `string`):

Paste a previous run ID or dataset ID to continue an interrupted collection. Trail IDs already returned there are skipped. Leave empty for a new collection; do not combine with recurring updates.

## `incrementalMode` (type: `boolean`):

Remember this collection scope for scheduled monitoring. The first run labels rows NEW; later runs return NEW, UPDATED, and REAPPEARED rows by default. Leave off for a one-time collection.

## `stateKey` (type: `string`):

Optional name for this recurring campaign. Leave empty to derive a stable key from the collection scope. Use a separate name for separate monitoring campaigns.

## `emitUnchanged` (type: `boolean`):

In recurring updates, also return trails with no detected changes, labelled UNCHANGED. These rows are returned and billed.

## `emitExpired` (type: `boolean`):

In recurring updates, return trails absent from a complete scan, labelled EXPIRED. Capped, blocked, or resumed runs do not infer that a trail is gone. These rows are returned and billed.

## `mcpConnectors` (type: `array`):

Optional list of authorized connector IDs. The actor sends concise summaries after the scrape; the complete record remains in the Apify dataset. Leave empty to skip.

## `notionParentPageUrl` (type: `string`):

URL or ID of the Notion page under which summary pages are created. Required only when a Notion connector is selected.

## `maxNotifyListings` (type: `integer`):

Maximum trail summaries written to each selected connector. Does not affect the dataset row count.

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

Connection settings used for source requests. Keep the prefilled setting unless you have an authorized alternative connection.

## Actor input object example

```json
{
  "mode": "search",
  "regionPath": "California",
  "tags": [
    "backpacking"
  ],
  "urls": [
    "https://www.alltrails.com/us/california"
  ],
  "followSubGrids": false,
  "fetchDetails": false,
  "fetchPhotos": true,
  "maxPhotos": 10,
  "storeTracksInKV": false,
  "minRating": 0,
  "minReviews": 0,
  "featuresFilter": [],
  "maxItems": 20,
  "maxPages": 0,
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "maxNotifyListings": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "UNBLOCKER"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "mode": "search",
    "regionPath": "California",
    "tags": [
        "backpacking"
    ],
    "urls": [
        "https://www.alltrails.com/us/california"
    ],
    "followSubGrids": false,
    "fetchDetails": false,
    "minRating": 0,
    "minReviews": 0,
    "featuresFilter": [],
    "maxItems": 20,
    "maxPages": 0,
    "incrementalMode": false,
    "emitUnchanged": false,
    "emitExpired": false,
    "maxNotifyListings": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "UNBLOCKER"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("abotapi/alltrails-hiking-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 = {
    "mode": "search",
    "regionPath": "California",
    "tags": ["backpacking"],
    "urls": ["https://www.alltrails.com/us/california"],
    "followSubGrids": False,
    "fetchDetails": False,
    "minRating": 0,
    "minReviews": 0,
    "featuresFilter": [],
    "maxItems": 20,
    "maxPages": 0,
    "incrementalMode": False,
    "emitUnchanged": False,
    "emitExpired": False,
    "maxNotifyListings": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["UNBLOCKER"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("abotapi/alltrails-hiking-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 '{
  "mode": "search",
  "regionPath": "California",
  "tags": [
    "backpacking"
  ],
  "urls": [
    "https://www.alltrails.com/us/california"
  ],
  "followSubGrids": false,
  "fetchDetails": false,
  "minRating": 0,
  "minReviews": 0,
  "featuresFilter": [],
  "maxItems": 20,
  "maxPages": 0,
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "maxNotifyListings": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "UNBLOCKER"
    ]
  }
}' |
apify call abotapi/alltrails-hiking-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,abotapi/alltrails-hiking-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/rrP8ypbpQQ9DZXZLV/builds/Hc2lpXWpWOjzMPbpR/openapi.json
