{
  "openapi": "3.0.1",
  "info": {
    "title": "AllTrails Hiking Scraper - Trails, Stats & Reviews",
    "description": "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.",
    "version": "0.1",
    "x-build-id": "cNek5vZUGRXOzGVdQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/abotapi~alltrails-hiking-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-abotapi-alltrails-hiking-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/abotapi~alltrails-hiking-scraper/runs": {
      "post": {
        "operationId": "runs-sync-abotapi-alltrails-hiking-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/abotapi~alltrails-hiking-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-abotapi-alltrails-hiking-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Collection mode",
            "enum": [
              "search",
              "urls"
            ],
            "type": "string",
            "description": "Choose whether to browse a region and its optional tag grids, or read the grid and trail links you provide.",
            "default": "search"
          },
          "regionPath": {
            "title": "Region to browse",
            "type": "string",
            "description": "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.",
            "default": "us/california"
          },
          "tags": {
            "title": "Trail tag grids",
            "type": "array",
            "description": "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.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude (center)",
            "type": "number",
            "description": "Center latitude, -90 to 90. Use with Longitude and Search radius."
          },
          "longitude": {
            "title": "Longitude (center)",
            "type": "number",
            "description": "Center longitude, -180 to 180."
          },
          "searchRadius": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "maximum": 500,
            "type": "number",
            "description": "Radius around the center point, 1 to 500 miles. Used only with Latitude and Longitude.",
            "default": 50
          },
          "customBottomLat": {
            "title": "Box south latitude",
            "type": "number",
            "description": "South edge of a bounding box. All four box fields are required together; the box wins over the center point."
          },
          "customBottomLng": {
            "title": "Box west longitude",
            "type": "number",
            "description": "West edge of the bounding box."
          },
          "customTopLat": {
            "title": "Box north latitude",
            "type": "number",
            "description": "North edge of the bounding box."
          },
          "customTopLng": {
            "title": "Box east longitude",
            "type": "number",
            "description": "East edge of the bounding box."
          },
          "urls": {
            "title": "Grid or trail links",
            "type": "array",
            "description": "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. Query strings such as ?page=2, ?sort=newest or ?ref=share are ignored (a grid always reads its first ten popular trails); the same trail pasted twice is returned once. Left untouched, the field scrapes this example set.",
            "default": [
              "https://www.alltrails.com/us/california",
              "https://www.alltrails.com/us",
              "https://www.alltrails.com/us/california/backpacking",
              "https://www.alltrails.com/us/california/san-francisco",
              "https://www.alltrails.com/parks/us/california/yosemite-national-park",
              "https://www.alltrails.com/trail/us/california/half-dome-via-the-john-muir-trail-jmt"
            ],
            "items": {
              "type": "string"
            }
          },
          "followSubGrids": {
            "title": "Follow additional grids",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "fetchDetails": {
            "title": "Read trail details and reviews",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "fetchPhotos": {
            "title": "Fetch community photos",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "maxPhotos": {
            "title": "Maximum photos per trail",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum number of community photos to keep for each trail when enabled. Range: 1 to 120.",
            "default": 10
          },
          "storeTracksInKV": {
            "title": "Save GPS tracks to key-value store",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "difficulty": {
            "title": "Difficulty filter",
            "type": "array",
            "description": "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. Expert is accepted as a synonym of strenuous.",
            "items": {
              "type": "string",
              "enum": [
                "easy",
                "moderate",
                "hard",
                "strenuous",
                "expert"
              ],
              "enumTitles": [
                "Easy",
                "Moderate",
                "Hard",
                "Strenuous",
                "Expert (same as strenuous)"
              ]
            }
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Keep only trails whose average rating meets or exceeds this value. Range: 0 to 5. Applied in either mode.",
            "default": 0
          },
          "minReviews": {
            "title": "Minimum review count",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only trails with at least this many reviews. Applied in either mode.",
            "default": 0
          },
          "activityFilter": {
            "title": "Activities",
            "type": "array",
            "description": "Keep trails tagged with at least one selected activity. Applied in either mode.",
            "items": {
              "type": "string",
              "enum": [
                "hiking",
                "trail-running",
                "backpacking",
                "camping",
                "mountain-biking",
                "rock-climbing",
                "horseback-riding"
              ],
              "enumTitles": [
                "Hiking",
                "Trail running",
                "Backpacking",
                "Camping",
                "Mountain biking",
                "Rock climbing",
                "Horseback riding"
              ]
            }
          },
          "routeTypeFilter": {
            "title": "Route types",
            "type": "array",
            "description": "Keep trails whose route type matches one of the selected values. Applied in either mode.",
            "items": {
              "type": "string",
              "enum": [
                "loop",
                "out-and-back",
                "point-to-point"
              ],
              "enumTitles": [
                "Loop",
                "Out and back",
                "Point to point"
              ]
            }
          },
          "lengthMin": {
            "title": "Minimum length (metres)",
            "minimum": 0,
            "type": "number",
            "description": "Keep trails at least this long. Applied in either mode."
          },
          "lengthMax": {
            "title": "Maximum length (metres)",
            "minimum": 0,
            "type": "number",
            "description": "Keep trails no longer than this. Applied in either mode."
          },
          "elevationGainMin": {
            "title": "Minimum elevation gain (metres)",
            "minimum": 0,
            "type": "number",
            "description": "Keep trails with at least this elevation gain. Applied in either mode."
          },
          "elevationGainMax": {
            "title": "Maximum elevation gain (metres)",
            "minimum": 0,
            "type": "number",
            "description": "Keep trails with no more than this elevation gain. Applied in either mode."
          },
          "featuresFilter": {
            "title": "Trail features",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "visitorUsageFilter": {
            "title": "Visitor usage",
            "type": "array",
            "description": "Keep only trails with this crowd level on the site's 1-4 usage scale: light (1-2), moderate (3), heavy (4). Needs a listing that carries the level; applied in either mode.",
            "items": {
              "type": "string",
              "enum": [
                "light",
                "moderate",
                "heavy"
              ],
              "enumTitles": [
                "Light",
                "Moderate",
                "Heavy"
              ]
            }
          },
          "maxItems": {
            "title": "Maximum trail records",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum trail records across the whole run. Set 0 for no item cap; the configured grids and page guard still bound the walk.",
            "default": 20
          },
          "maxPages": {
            "title": "Maximum grid pages",
            "minimum": 0,
            "type": "integer",
            "description": "Safety guard for the number of grid pages read in one run. Set 0 to read until the selected scope ends.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Connection settings",
            "type": "object",
            "description": "Connection settings used for source requests. Keep the prefilled setting unless you have an authorized alternative connection.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "resumeFromRunId": {
            "title": "Resume a previous run",
            "type": "string",
            "description": "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": {
            "title": "Recurring updates",
            "type": "boolean",
            "description": "Remember this collection scope for scheduled monitoring. The first run labels rows NEW; later runs return NEW, UPDATED, and REAPPEARED rows by default. A trail counts as UPDATED when its name, difficulty, length, elevation, route, location, features, description, alerts or season changed; community counters (ratings, review and photo counts, completions, popularity), the average rating, recent reviews, the cover image and per-run fields (scrape time, source, position, weather, photos) are excluded. Leave off for a one-time collection.",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "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": {
            "title": "Return unchanged trails",
            "type": "boolean",
            "description": "In recurring updates, also return trails with no detected changes, labelled UNCHANGED. These rows are returned and billed.",
            "default": false
          },
          "emitExpired": {
            "title": "Return expired trails",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "ignoreFieldsForChanges": {
            "title": "Ignore fields when detecting changes (incremental mode only)",
            "type": "array",
            "description": "Optional extra field names to leave out of change detection, on top of the built-in exclusions. A dotted name such as parent.child reaches inside an object or list of objects. Ignored fields stay in every returned row; they only stop deciding UPDATED and appearing in changedFields. Dotted names do not reach inside description, overview or alerts, which are compared as a whole.",
            "items": {
              "type": "string"
            }
          },
          "mcpConnectors": {
            "title": "Export summaries to apps",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "notionParentPageUrl": {
            "title": "Notion destination page",
            "type": "string",
            "description": "URL or ID of the Notion page under which summary pages are created. Required only when a Notion connector is selected."
          },
          "maxNotifyListings": {
            "title": "Maximum items per connector",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum trail summaries written to each selected connector. Does not affect the dataset row count.",
            "default": 50
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}