{
  "openapi": "3.0.1",
  "info": {
    "title": "AllTrails Scraper - Hiking Trail Data",
    "description": "Scrape AllTrails hiking trails by park, state, city, map box, keyword or URL: difficulty, length, elevation gain, rating, review count, route type, activities, features, GPS and photo. Filters for difficulty, rating, length and features. No login.",
    "version": "1.0",
    "x-build-id": "OXxLiOYihL5VbycTc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bovi~alltrails-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bovi-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/bovi~alltrails-scraper/runs": {
      "post": {
        "operationId": "runs-sync-bovi-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/bovi~alltrails-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-bovi-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": {
          "searchType": {
            "title": "Search by",
            "enum": [
              "park",
              "state",
              "city",
              "coordinates",
              "keyword"
            ],
            "type": "string",
            "description": "How to find trails. Ignored when Start URLs are given.",
            "default": "park"
          },
          "park": {
            "title": "Park or area name",
            "type": "string",
            "description": "Name of a park or protected area as AllTrails lists it, e.g. \"Yosemite National Park\" or \"Banff National Park\". Used when Search by = Park."
          },
          "state": {
            "title": "State or region",
            "type": "string",
            "description": "US state or another country's region, e.g. \"Colorado\", \"British Columbia\". Used when Search by = State."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City name, e.g. \"Denver\". Used when Search by = City."
          },
          "cityState": {
            "title": "City's state or region",
            "type": "string",
            "description": "Optional, to tell same-named cities apart, e.g. \"Colorado\" for Denver, CO."
          },
          "north": {
            "title": "North latitude",
            "type": "number",
            "description": "Bounding box north edge. Used when Search by = Coordinates."
          },
          "south": {
            "title": "South latitude",
            "type": "number",
            "description": "Bounding box south edge."
          },
          "east": {
            "title": "East longitude",
            "type": "number",
            "description": "Bounding box east edge (western hemisphere is negative)."
          },
          "west": {
            "title": "West longitude",
            "type": "number",
            "description": "Bounding box west edge."
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Free-text trail search, e.g. \"waterfall loop\". Used when Search by = Keyword."
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional AllTrails URLs: trail pages (/trail/...), park pages (/parks/...), city or state pages (/us/colorado/denver) or explore map URLs with b_tl_lat/b_tl_lng/b_br_lat/b_br_lng. When set, Search by is ignored.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of trails to save.",
            "default": 50
          },
          "difficulty": {
            "title": "Difficulty",
            "type": "array",
            "description": "Keep only these AllTrails difficulty levels.",
            "items": {
              "type": "string",
              "enum": [
                "easy",
                "moderate",
                "hard",
                "strenuous"
              ],
              "enumTitles": [
                "Easy",
                "Moderate",
                "Hard",
                "Strenuous"
              ]
            }
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Minimum average star rating (0-5)."
          },
          "minReviews": {
            "title": "Minimum reviews",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of reviews."
          },
          "routeType": {
            "title": "Route type",
            "type": "array",
            "description": "Keep only these route shapes.",
            "items": {
              "type": "string",
              "enum": [
                "loop",
                "out-and-back",
                "point-to-point"
              ],
              "enumTitles": [
                "Loop",
                "Out & Back",
                "Point to Point"
              ]
            }
          },
          "activities": {
            "title": "Activities",
            "type": "array",
            "description": "Keep trails that list at least one of these activities.",
            "items": {
              "type": "string",
              "enum": [
                "hiking",
                "walking",
                "running",
                "trail-running",
                "backpacking",
                "camping",
                "mountain-biking",
                "road-biking",
                "bike-touring",
                "birding",
                "fishing",
                "horseback-riding",
                "rock-climbing",
                "snowshoeing",
                "cross-country-skiing",
                "skiing",
                "off-road-driving",
                "scenic-driving",
                "paddle-sports",
                "via-ferrata"
              ],
              "enumTitles": [
                "Hiking",
                "Walking",
                "Running",
                "Trail running",
                "Backpacking",
                "Camping",
                "Mountain biking",
                "Road biking",
                "Bike touring",
                "Birding",
                "Fishing",
                "Horseback riding",
                "Rock climbing",
                "Snowshoeing",
                "Cross country skiing",
                "Skiing",
                "Off road driving",
                "Scenic driving",
                "Paddle sports",
                "Via ferrata"
              ]
            }
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Keep trails that have all of these features.",
            "items": {
              "type": "string",
              "enum": [
                "views",
                "forest",
                "wildlife",
                "wild-flowers",
                "river",
                "lake",
                "waterfall",
                "beach",
                "cave",
                "hot-springs",
                "historic-site",
                "kids",
                "strollers",
                "ada",
                "dogs",
                "dogs-leash",
                "dogs-no",
                "paved",
                "partially-paved",
                "city-walk",
                "rails-trails"
              ],
              "enumTitles": [
                "Views",
                "Forest",
                "Wildlife",
                "Wildflowers",
                "River",
                "Lake",
                "Waterfall",
                "Beach",
                "Cave",
                "Hot springs",
                "Historic site",
                "Kid friendly",
                "Stroller friendly",
                "Wheelchair friendly (ADA)",
                "Dogs allowed (off leash)",
                "Dogs on leash",
                "No dogs",
                "Paved",
                "Partially paved",
                "City walk",
                "Rail trail"
              ]
            }
          },
          "visitorUsage": {
            "title": "Visitor traffic level",
            "type": "array",
            "description": "AllTrails visitor usage level, 1 = lightest traffic, 4 = busiest.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4"
              ],
              "enumTitles": [
                "Level 1 (lightest)",
                "Level 2",
                "Level 3",
                "Level 4 (busiest)"
              ]
            }
          },
          "minLengthKm": {
            "title": "Minimum length (km)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum trail length in kilometres."
          },
          "maxLengthKm": {
            "title": "Maximum length (km)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum trail length in kilometres."
          },
          "minElevationGainM": {
            "title": "Minimum elevation gain (m)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum elevation gain in metres."
          },
          "maxElevationGainM": {
            "title": "Maximum elevation gain (m)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum elevation gain in metres."
          },
          "includeClosed": {
            "title": "Include closed trails",
            "type": "boolean",
            "description": "Also return trails AllTrails marks as closed.",
            "default": false
          },
          "language": {
            "title": "Language",
            "enum": [
              "en-US",
              "en-GB",
              "de-DE",
              "fr-FR",
              "es-ES",
              "es-MX",
              "it-IT",
              "nl-NL",
              "nb-NO",
              "pl-PL",
              "pt-BR",
              "pt-PT",
              "sv-SE",
              "da-DK"
            ],
            "type": "string",
            "description": "Language of trail names and descriptions.",
            "default": "en-US"
          },
          "includeDetails": {
            "title": "Include trail page details",
            "type": "boolean",
            "description": "Open each trail's page for its full overview, completion and recording counts, obstacles, best season and cell-service flag. Slower.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. The trail search works without one; Apify Proxy helps when fetching trail pages at volume.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}