{
  "openapi": "3.0.1",
  "info": {
    "title": "Tripadvisor Hotels Scraper",
    "description": "Extract Tripadvisor hotel reviews (text, rating, sub-ratings, trip type, photos, author, owner response with date), hotel snapshots (rating, histogram, popularity ranking, amenities) and area hotel lists. Newest first with a date filter. Export JSON, CSV or Excel.",
    "version": "1.0",
    "x-build-id": "07PqkjtLVrKohsCfm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/valiant_quarter~tripadvisor-hotels-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-valiant_quarter-tripadvisor-hotels-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/valiant_quarter~tripadvisor-hotels-scraper/runs": {
      "post": {
        "operationId": "runs-sync-valiant_quarter-tripadvisor-hotels-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/valiant_quarter~tripadvisor-hotels-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-valiant_quarter-tripadvisor-hotels-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "reviews",
              "place",
              "search"
            ],
            "type": "string",
            "description": "reviews = one item per review of each hotel. place = one snapshot item per hotel (rating, histogram, popularity ranking, address, amenities). search = hotels of an area (query text or geo id → hotel list).",
            "default": "reviews"
          },
          "startUrls": {
            "title": "Hotel URLs",
            "type": "array",
            "description": "Tripadvisor hotel pages (reviews / place modes), e.g. https://www.tripadvisor.com/Hotel_Review-g1192102-d545626-Reviews-Lago_Hotel-Sorgun_Manavgat_Turkish_Mediterranean_Coast.html . Any locale host works; the ids (-g<geo>-d<id>-) are what counts.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxReviewsPerPlace": {
            "title": "Max reviews per hotel",
            "minimum": 0,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many reviews per hotel (newest first). 0 = all reviews.",
            "default": 0
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Only reviews published on/after this (YYYY-MM-DD, full ISO, or relative like '8 days' / '3 months'). Paging is newest first and STOPS once it crosses this floor, so an incremental run costs one or two requests. Empty = full scan."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Only reviews published on/before this (YYYY-MM-DD = whole day, full ISO, or relative). Empty = no upper bound."
          },
          "includePlaceInfo": {
            "title": "Embed place info in every review",
            "type": "boolean",
            "description": "Adds a compact `placeInfo` block (name, rating, review count, histogram, address, coordinates) to each review item.",
            "default": true
          },
          "queries": {
            "title": "Area queries (search mode)",
            "type": "array",
            "description": "Place names to list hotels for, e.g. 'Sorgun', 'Kemer'. The first matching Tripadvisor geo is used.",
            "items": {
              "type": "string"
            }
          },
          "geoIds": {
            "title": "Tripadvisor geo ids (search mode)",
            "type": "array",
            "description": "Numeric geo ids, e.g. [297966] for Kemer (the g… of a /Hotels-g297966-… page). Skips the text lookup; each geo is read until its own hotels run out, up to the page limit, and the maximum below does not apply. Can be combined with queries."
          },
          "hotelClass": {
            "title": "Hotel class filter (search mode)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Reads the list through Tripadvisor's own star filter (5 = /Hotels-g…-zfc5.html). In a parent geo every row then carries that geo's rank, whichever town the hotel is in. The filter runs out after a few pages and unfiltered hotels follow, so keep scanPages small and check hotelClass on the items."
          },
          "maxResults": {
            "title": "Max hotels per query (search mode)",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Hotels returned per query, in Tripadvisor's popularity order. Not applied to geoIds.",
            "default": 30
          },
          "scanPages": {
            "title": "Pages to scan (search mode)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Hotel list pages (30 hotels each) read per query before the hotels are ranked and cut to the maximum.",
            "default": 4
          },
          "sortBy": {
            "title": "Result order (search mode)",
            "enum": [
              "reviews",
              "list"
            ],
            "type": "string",
            "description": "reviews = most reviewed first among the scanned hotels. list = Tripadvisor's own list order.",
            "default": "reviews"
          },
          "includeNearby": {
            "title": "Include nearby hotels (search mode)",
            "type": "boolean",
            "description": "Tripadvisor appends hotels of neighbouring areas after the area's own list. Off = only the area itself.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies are required on Apify: Tripadvisor is protected by DataDome. Each hotel scan keeps one sticky session; a blocked session is replaced by a fresh browser on a new IP. With an Apify Proxy country set, later browsers cycle through NL, GB, AT and FR. To run without a proxy, switch Apify Proxy off.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "DE"
            }
          },
          "maxRotations": {
            "title": "Max IP rotations per hotel",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "How many times a hotel scan may switch to a fresh browser/IP after a block or a network error before it gives up.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}