# AllTrails Scraper — Trails, Reviews & GPS Data (`muhammadafzal/alltrails-scraper`) Actor

Scrape AllTrails hiking routes, difficulty, distance, elevation, ratings, reviews, maps, and GPS data for travel and outdoor research.

- **URL**: https://apify.com/muhammadafzal/alltrails-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (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 $6.00 / 1,000 trail items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 — Trails, Reviews & GPS Data

Extract structured hiking trail data from [AllTrails.com](https://www.alltrails.com) at scale. Get trail names, difficulty, distance, elevation, GPS coordinates, ratings, reviews, photos, activity tags, and features — all as clean, structured JSON.

### What It Does

The AllTrails Scraper searches AllTrails by keyword, national park, city, country, or direct URL, and returns detailed trail records with:

- Trail name, description, and URL
- Difficulty (easy, moderate, hard, expert)
- Route type (loop, out-and-back, point-to-point)
- Distance (miles + kilometers)
- Elevation gain (feet + meters)
- GPS coordinates (latitude + longitude)
- Average rating and review count
- Photo count, recording count, and popularity score
- Estimated duration
- Activities (hiking, backpacking, trail running, etc.)
- Features (views, waterfalls, lakes, dog-friendly, etc.)
- Visitor traffic level
- Cover image URL
- Closure and alert status
- Up to 5 recent reviews with author, rating, and text
- Rating breakdown (1-5 star distribution)

### Input Options

#### Direct URLs (`startUrls`)

Paste any AllTrails URL — trail pages, park/area pages, city pages, or explore URLs.

```json
{
    "startUrls": [
        { "url": "https://www.alltrails.com/trail/us/california/half-dome-trail" },
        { "url": "https://www.alltrails.com/parks/us/california/yosemite-national-park" }
    ],
    "maxItems": 50
}
````

#### Keyword Search (`mode: search`)

Search AllTrails by keyword via the Algolia search index.

```json
{
    "mode": "search",
    "searchQuery": "coastal hike california",
    "maxItems": 30
}
```

#### By National Park (`mode: byPark`)

```json
{
    "mode": "byPark",
    "park": "yosemite-national-park",
    "state": "california",
    "maxItems": 100
}
```

#### By City (`mode: byCity`)

```json
{
    "mode": "byCity",
    "city": "denver",
    "maxItems": 50
}
```

#### By Country (`mode: byCountry`)

```json
{
    "mode": "byCountry",
    "country": "us",
    "maxItems": 200
}
```

#### Filters

All modes support filters:

| Filter | Type | Description |
|--------|------|-------------|
| `difficulty` | string | `easy`, `moderate`, `hard`, `expert` |
| `routeType` | string | `loop`, `out-and-back`, `point-to-point` |
| `activity` | string | `hiking`, `trail-running`, `backpacking`, etc. |
| `minRating` | number | Minimum star rating (0-5) |
| `minLengthKm` | number | Minimum trail length in km |
| `maxLengthKm` | number | Maximum trail length in km |

#### Full Trail Details

Set `fetchTrailDetails: true` (default) to fetch the full trail detail page for each result, giving you descriptions, reviews, and ratings breakdown. Set to `false` for faster, lighter results.

### Output

Each trail record contains:

| Field | Type | Example |
|-------|------|---------|
| `trailId` | string | `"1001"` |
| `name` | string | `"Half Dome Trail"` |
| `url` | string | `"https://www.alltrails.com/trail/..."` |
| `description` | string | `"A classic trail to the iconic Half Dome..."` |
| `difficulty` | string | `"hard"` |
| `routeType` | string | `"out-and-back"` |
| `lengthMiles` | number | `14.2` |
| `lengthKm` | number | `22.9` |
| `elevationGainFt` | number | `5300` |
| `elevationGainMeters` | number | `1615` |
| `avgRating` | number | `4.8` |
| `numReviews` | number | `4521` |
| `numPhotos` | number | `120` |
| `numRecordings` | number | `8900` |
| `popularity` | number | `95` |
| `latitude` | number | `37.745` |
| `longitude` | number | `-119.536` |
| `city` | string | `"Yosemite Valley"` |
| `state` | string | `"California"` |
| `country` | string | `"United States"` |
| `areaName` | string | `"Yosemite National Park"` |
| `activities` | string\[] | `["hiking","backpacking"]` |
| `features` | string\[] | `["views","waterfall","forest"]` |
| `visitorUsage` | string | `"heavy"` |
| `estimatedDurationMinutes` | number | `480` |
| `imageUrl` | string | `"https://cdn2.alltrails.com/..."` |
| `isClosed` | boolean | `false` |
| `hasAlerts` | boolean | `false` |
| `recentReviews` | array | `[{authorName, rating, text, createdAt}]` |
| `ratingsBreakdown` | object | `{"1":0,"2":5,"3":20,"4":100,"5":4396}` |
| `scrapedAt` | string | `"2026-07-08T10:00:00.000Z"` |
| `sourceUrl` | string | `"https://www.alltrails.com/..."` |

### Pricing

This actor uses **Pay-Per-Event** pricing:

| Event | Price | Description |
|-------|-------|-------------|
| Actor Start | $0.00005 | Charged once when the run starts |
| Trail Item | $0.006 | Charged per trail record returned |

**Example:** Scrape 100 trails = $0.00005 + (100 × $0.006) = **$0.60**

### Use Cases

- **Trip planning apps**: Power a hike-finder feature with current trail metrics
- **Tourism boards**: Benchmark trail density and difficulty mix across regions
- **GIS research**: Build geospatial datasets using GPS coordinates
- **Outdoor gear retail**: Identify high-rated, high-traffic trails for marketing
- **Travel content**: Generate data-backed trail roundups and listicles
- **AI/ML**: Feed structured trail data into recommendation models

### Technical Approach

- **HTTP-first**: Uses AllTrails' public Algolia search index + JSON trail detail pages — no browser rendering needed, making it fast and reliable
- **Auto-proxy escalation**: Starts without a proxy, automatically falls back to residential on blocks
- **Session pool**: 20 sessions with 10 requests per session to avoid rate limits
- **3-layer extraction**: Algolia JSON → Next.js `__NEXT_DATA__` → LD+JSON fallback

### Proxy Support

AllTrails works without a proxy in most cases. If you experience IP blocks:

1. Enable `useProxy: true` to route through Apify datacenter proxies
2. Set `proxyGroups: ["RESIDENTIAL"]` for residential proxies if datacenter is blocked

***

Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools. Built for reliability and scale.

### What is AllTrails Scraper?

**AllTrails Scraper** turns the target data into structured, reusable results on Apify. Use it when you need repeatable collection for analysts, developers, agencies, researchers, and AI-agent workflows without maintaining a custom scraper or one-off integration. Run it manually, schedule recurring jobs, call it through the Apify API, or connect it to an AI agent through the Apify MCP server.

The Actor stores results in an Apify dataset, where they can be previewed and exported as JSON, CSV, Excel, XML, or RSS. Availability and completeness depend on the source, supplied inputs, public visibility, authentication requirements, and upstream rate limits.

### Use cases for AllTrails Scraper

- Build structured datasets for research, reporting, enrichment, or monitoring.
- Automate repetitive collection with schedules, webhooks, and API calls.
- Feed clean records into spreadsheets, databases, CRMs, BI tools, AI agents, or RAG pipelines.
- Track changes over time by running the same validated input on a schedule.
- Replace fragile manual copy-and-paste work with a reproducible Apify workflow.

### How to use AllTrails Scraper

1. Open the Actor input page and choose a focused, valid target.
2. Set a conservative result limit for the first run.
3. Start the Actor and inspect the dataset for coverage and field availability.
4. Export the results or connect the dataset to your downstream system.
5. Scale gradually and use scheduling, pagination, or proxies when supported.

#### Important input options

- `startUrls` — Paste AllTrails URLs directly. Supports trail pages, park/area pages, city pages, or explore URLs. Use this field when the user provides specific URLs. Use searchQuery or mode instead when t
- `mode` — How to discover trails when not pasting URLs. byUrl: scrape provided URLs. search: free-text search via Algolia. byPark: browse a national park. byCity: browse trails in a city. byCountry: t
- `searchQuery` — Free-text search query for trails (e.g. 'yosemite', 'coastal hike california'). Used when mode is 'search'. Do NOT use this when the user provides URLs — use startUrls instead.
- `country` — Country slug for AllTrails URLs and search index. 'us' is default. Examples: us, canada, united-kingdom, france, germany, australia.
- `state` — State or region slug (e.g. 'california', 'new-york'). Used with byPark, byCity, and byTrail modes.
- `city` — City slug (e.g. 'san-francisco', 'denver'). Used when mode is 'byCity'.
- `park` — Park slug (e.g. 'yosemite-national-park', 'zion-national-park'). Used when mode is 'byPark'.
- `trailSlug` — The trail slug — the part of the AllTrails URL after the state. Used when mode is 'byTrail'.

### API and automation example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/alltrails-scraper').call({
  // Add the same input fields you use in the Apify Console.
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Related Apify Actors

Use these dedicated tools when a neighboring data source or workflow is a better match:

- [Leads Finder Pro - B2B Leads with Emails \[Apollo Alternative\]](https://apify.com/muhammadafzal/leads-finder-pro)
- [Yellow Pages US Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-us-scraper)
- [Yellow Pages Australia Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-au-scraper)
- [OpenTable Restaurants, Ratings & Reviews Scraper](https://apify.com/muhammadafzal/opentable-scraper)
- [YouTube Thumbnail Downloader](https://apify.com/muhammadafzal/youtube-thumbnail-downloader)
- [Google Play Reviews Scraper](https://apify.com/muhammadafzal/google-play-reviews-scraper)
- [GitHub Repo Search — Stars, Language & Topics](https://apify.com/muhammadafzal/github-repo-search-stars-language-topics)
- [Rate My Professors & Schools Scraper](https://apify.com/muhammadafzal/rate-my-professors-scraper)
- [California CSLB Contractor License Scraper](https://apify.com/muhammadafzal/cslb-california-scraper)
- [Instagram Followers & Following Scraper — With Cookies](https://apify.com/muhammadafzal/instagram-following-scraper)

### Frequently asked questions

#### How many results can I scrape with AllTrails Scraper?

The practical total depends on the source, input limits, pagination, available records, run timeout, and upstream restrictions. Start with a small run, verify the output, and increase the limit gradually.

#### Can I integrate AllTrails Scraper with other apps?

Yes. Use Apify integrations, webhooks, schedules, dataset exports, Make, Zapier, Google Sheets, cloud storage, or your own application.

#### Can I use AllTrails Scraper with the Apify API?

Yes. Start runs with the Apify REST API or an official Apify client, then retrieve records from the run's default dataset. Keep your API token in a secret or environment variable.

#### Can I use AllTrails Scraper through an MCP Server?

Yes. The Apify MCP server can expose the Actor to compatible AI clients and agents. Review the input and expected cost before allowing an autonomous workflow to run it at scale.

#### Do I need proxies?

It depends on the source and volume. Use the default configuration first. For larger or geographically sensitive jobs, select an appropriate proxy configuration only when the Actor supports it.

#### Is it legal to scrape this data?

Scraping rules vary by source, jurisdiction, data type, and intended use. Collect only data you are authorized to access, respect applicable terms and privacy laws, and avoid restricted or personal data misuse. This documentation is not legal advice.

#### Your feedback

If a field is missing, a source layout has changed, or you need a supported use case documented, open an issue on the Actor page with a reproducible input and run ID.

# Actor input Schema

## `startUrls` (type: `array`):

Paste AllTrails URLs directly. Supports trail pages, park/area pages, city pages, or explore URLs. Use this field when the user provides specific URLs. Use searchQuery or mode instead when the user describes a location or trail type.

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

How to discover trails when not pasting URLs. byUrl: scrape provided URLs. search: free-text search via Algolia. byPark: browse a national park. byCity: browse trails in a city. byCountry: top trails in a country. byTrail: fetch a single trail by slug.

## `searchQuery` (type: `string`):

Free-text search query for trails (e.g. 'yosemite', 'coastal hike california'). Used when mode is 'search'. Do NOT use this when the user provides URLs — use startUrls instead.

## `country` (type: `string`):

Country slug for AllTrails URLs and search index. 'us' is default. Examples: us, canada, united-kingdom, france, germany, australia.

## `state` (type: `string`):

State or region slug (e.g. 'california', 'new-york'). Used with byPark, byCity, and byTrail modes.

## `city` (type: `string`):

City slug (e.g. 'san-francisco', 'denver'). Used when mode is 'byCity'.

## `park` (type: `string`):

Park slug (e.g. 'yosemite-national-park', 'zion-national-park'). Used when mode is 'byPark'.

## `trailSlug` (type: `string`):

The trail slug — the part of the AllTrails URL after the state. Used when mode is 'byTrail'.

## `difficulty` (type: `string`):

Only include trails at this difficulty level. Leave empty for all difficulties.

## `routeType` (type: `string`):

Only include trails with this route shape. Leave empty for all route types.

## `activity` (type: `string`):

Only include trails suited to this activity. Leave empty for all activities.

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

Only include trails with at least this average rating (0 to 5 stars). Leave at 0 for no minimum.

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

Only include trails at least this long (in kilometers). Leave empty for no minimum.

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

Only include trails no longer than this (in kilometers). Leave empty for no maximum.

## `fetchTrailDetails` (type: `boolean`):

When enabled, the actor fetches the full trail detail page for each trail found in search results, giving richer data (description, reviews, ratings breakdown). Disable for faster, lighter results.

## `useProxy` (type: `boolean`):

Route requests through Apify proxy. AllTrails blocks direct requests without a proxy. Enabled by default. Disable only if you have a custom proxy setup.

## `proxyGroups` (type: `array`):

Apify proxy groups to use (e.g. \['RESIDENTIAL']). Leave empty for default datacenter proxies.

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

Maximum number of trails to extract. Set to 0 for all available trails. Tip: start with 10-50 to test, then increase.

## Actor input object example

```json
{
  "startUrls": [],
  "mode": "byUrl",
  "searchQuery": "",
  "country": "us",
  "state": "",
  "city": "",
  "park": "",
  "trailSlug": "",
  "difficulty": "",
  "routeType": "",
  "activity": "",
  "minRating": 0,
  "fetchTrailDetails": true,
  "useProxy": true,
  "proxyGroups": [],
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Extracted trail records in the default dataset.

# 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 = {
    "startUrls": [],
    "mode": "byUrl",
    "country": "us",
    "minRating": 0,
    "fetchTrailDetails": true,
    "useProxy": true,
    "proxyGroups": [],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/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 = {
    "startUrls": [],
    "mode": "byUrl",
    "country": "us",
    "minRating": 0,
    "fetchTrailDetails": True,
    "useProxy": True,
    "proxyGroups": [],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/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 '{
  "startUrls": [],
  "mode": "byUrl",
  "country": "us",
  "minRating": 0,
  "fetchTrailDetails": true,
  "useProxy": true,
  "proxyGroups": [],
  "maxItems": 10
}' |
apify call muhammadafzal/alltrails-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AllTrails Scraper — Trails, Reviews & GPS Data",
        "description": "Scrape AllTrails hiking routes, difficulty, distance, elevation, ratings, reviews, maps, and GPS data for travel and outdoor research.",
        "version": "1.0",
        "x-build-id": "I1lPJ9bWJzPwFfiBU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/muhammadafzal~alltrails-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-muhammadafzal-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/muhammadafzal~alltrails-scraper/runs": {
            "post": {
                "operationId": "runs-sync-muhammadafzal-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/muhammadafzal~alltrails-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-muhammadafzal-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",
                "properties": {
                    "startUrls": {
                        "title": "🔗 Start URLs",
                        "type": "array",
                        "description": "Paste AllTrails URLs directly. Supports trail pages, park/area pages, city pages, or explore URLs. Use this field when the user provides specific URLs. Use searchQuery or mode instead when the user describes a location or trail type.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL",
                                    "description": "An AllTrails URL (trail, park, city, or country page)."
                                }
                            }
                        }
                    },
                    "mode": {
                        "title": "🔍 Search Mode",
                        "enum": [
                            "byUrl",
                            "search",
                            "byPark",
                            "byCity",
                            "byCountry",
                            "byTrail"
                        ],
                        "type": "string",
                        "description": "How to discover trails when not pasting URLs. byUrl: scrape provided URLs. search: free-text search via Algolia. byPark: browse a national park. byCity: browse trails in a city. byCountry: top trails in a country. byTrail: fetch a single trail by slug.",
                        "default": "byUrl"
                    },
                    "searchQuery": {
                        "title": "🔎 Search Query",
                        "type": "string",
                        "description": "Free-text search query for trails (e.g. 'yosemite', 'coastal hike california'). Used when mode is 'search'. Do NOT use this when the user provides URLs — use startUrls instead.",
                        "default": ""
                    },
                    "country": {
                        "title": "🌍 Country",
                        "type": "string",
                        "description": "Country slug for AllTrails URLs and search index. 'us' is default. Examples: us, canada, united-kingdom, france, germany, australia.",
                        "default": "us"
                    },
                    "state": {
                        "title": "🗺️ State / Region",
                        "type": "string",
                        "description": "State or region slug (e.g. 'california', 'new-york'). Used with byPark, byCity, and byTrail modes.",
                        "default": ""
                    },
                    "city": {
                        "title": "🏙️ City",
                        "type": "string",
                        "description": "City slug (e.g. 'san-francisco', 'denver'). Used when mode is 'byCity'.",
                        "default": ""
                    },
                    "park": {
                        "title": "🏞️ National Park",
                        "type": "string",
                        "description": "Park slug (e.g. 'yosemite-national-park', 'zion-national-park'). Used when mode is 'byPark'.",
                        "default": ""
                    },
                    "trailSlug": {
                        "title": "🥾 Trail Slug",
                        "type": "string",
                        "description": "The trail slug — the part of the AllTrails URL after the state. Used when mode is 'byTrail'.",
                        "default": ""
                    },
                    "difficulty": {
                        "title": "⛰️ Difficulty Filter",
                        "enum": [
                            "",
                            "easy",
                            "moderate",
                            "hard",
                            "expert"
                        ],
                        "type": "string",
                        "description": "Only include trails at this difficulty level. Leave empty for all difficulties.",
                        "default": ""
                    },
                    "routeType": {
                        "title": "🗺️ Route Type Filter",
                        "enum": [
                            "",
                            "loop",
                            "out-and-back",
                            "point-to-point"
                        ],
                        "type": "string",
                        "description": "Only include trails with this route shape. Leave empty for all route types.",
                        "default": ""
                    },
                    "activity": {
                        "title": "🚶 Activity Filter",
                        "enum": [
                            "",
                            "hiking",
                            "trail-running",
                            "backpacking",
                            "mountain-biking",
                            "rock-climbing",
                            "horseback-riding",
                            "walking",
                            "birding",
                            "scenic-driving",
                            "fishing",
                            "snowshoeing"
                        ],
                        "type": "string",
                        "description": "Only include trails suited to this activity. Leave empty for all activities.",
                        "default": ""
                    },
                    "minRating": {
                        "title": "⭐ Minimum Rating",
                        "type": "number",
                        "description": "Only include trails with at least this average rating (0 to 5 stars). Leave at 0 for no minimum.",
                        "default": 0
                    },
                    "minLengthKm": {
                        "title": "📏 Min Length (km)",
                        "type": "number",
                        "description": "Only include trails at least this long (in kilometers). Leave empty for no minimum."
                    },
                    "maxLengthKm": {
                        "title": "📏 Max Length (km)",
                        "type": "number",
                        "description": "Only include trails no longer than this (in kilometers). Leave empty for no maximum."
                    },
                    "fetchTrailDetails": {
                        "title": "📥 Fetch Full Trail Details",
                        "type": "boolean",
                        "description": "When enabled, the actor fetches the full trail detail page for each trail found in search results, giving richer data (description, reviews, ratings breakdown). Disable for faster, lighter results.",
                        "default": true
                    },
                    "useProxy": {
                        "title": "🌐 Use Proxy",
                        "type": "boolean",
                        "description": "Route requests through Apify proxy. AllTrails blocks direct requests without a proxy. Enabled by default. Disable only if you have a custom proxy setup.",
                        "default": true
                    },
                    "proxyGroups": {
                        "title": "🔧 Proxy Groups",
                        "type": "array",
                        "description": "Apify proxy groups to use (e.g. ['RESIDENTIAL']). Leave empty for default datacenter proxies.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "📊 Max Items",
                        "type": "integer",
                        "description": "Maximum number of trails to extract. Set to 0 for all available trails. Tip: start with 10-50 to test, then increase.",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
