{
  "openapi": "3.0.1",
  "info": {
    "title": "TripAdvisor Hotel Reviews API",
    "description": "Scrape ALL reviews from any TripAdvisor hotel, restaurant, or attraction - a free, unlimited alternative to the official API (which returns only 3). Review text, ratings, dates, owner responses, per-review subratings, reviewer profiles, plus property details.",
    "version": "1.0",
    "x-build-id": "nQxLXNqdfoZsTtOOa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/factden~tripadvisor-hotel-reviews-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-factden-tripadvisor-hotel-reviews-api",
        "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/factden~tripadvisor-hotel-reviews-api/runs": {
      "post": {
        "operationId": "runs-sync-factden-tripadvisor-hotel-reviews-api",
        "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/factden~tripadvisor-hotel-reviews-api/run-sync": {
      "post": {
        "operationId": "run-sync-factden-tripadvisor-hotel-reviews-api",
        "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",
              "discover"
            ],
            "type": "string",
            "description": "What do you want? **Reviews** = you have TripAdvisor URLs or Location IDs and want every review (plus each place's details). **Discover** = search a city/place and get a list of places with their details. Fill the matching block below.",
            "default": "reviews"
          },
          "startUrls": {
            "title": "🔗 TripAdvisor URLs",
            "type": "array",
            "description": "TripAdvisor detail-page URLs, one per place, copy them from your browser. Works for **hotels** (`Hotel_Review`), **restaurants** (`Restaurant_Review`) and **attractions** (`Attraction_Review`). A stale/merged URL self-heals to the current place.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "locationIds": {
            "title": "🆔 …or Location IDs",
            "maxItems": 1000,
            "type": "array",
            "description": "TripAdvisor location IDs, the `d`-number in a URL (e.g. `1465497` from `…-d1465497-…`), for any place type. One ID per line, e.g. `1465497`, `1029199`, `190166`.",
            "items": {
              "type": "string"
            }
          },
          "maxReviews": {
            "title": "🔢 Max reviews per place",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap the reviews scraped per place (paginated, newest-first). Use a large number (e.g. `100000`) to get **all** reviews. A smaller number keeps a first run fast and cheap.",
            "default": 200
          },
          "reviewLanguages": {
            "title": "🗣️ Review languages",
            "type": "array",
            "description": "Only scrape reviews written in these languages (each has its own review count). Choose `All languages`, or pick specific ones.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "en",
                "es",
                "de",
                "fr",
                "it",
                "pt",
                "nl",
                "ja",
                "zh"
              ],
              "enumTitles": [
                "🌐 All languages",
                "English",
                "Spanish",
                "German",
                "French",
                "Italian",
                "Portuguese",
                "Dutch",
                "Japanese",
                "Chinese"
              ]
            },
            "default": [
              "all"
            ]
          },
          "minRating": {
            "title": "⭐ Minimum rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep reviews with at least this star rating (1-5). Set `minRating` = `maxRating` for a single rating (e.g. both 1 for complaints).",
            "default": 1
          },
          "maxRating": {
            "title": "⭐ Maximum rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep reviews with at most this star rating (1-5). Leave at 5 with minRating 1 for all ratings.",
            "default": 5
          },
          "fromDate": {
            "title": "📅 Reviews from (date)",
            "type": "string",
            "description": "Lower bound (YYYY-MM-DD). Stop once reviews are older than this, perfect for a scheduled refresh. Leave empty to go as far back as available."
          },
          "toDate": {
            "title": "📅 Reviews to (date)",
            "type": "string",
            "description": "Upper bound (YYYY-MM-DD): only keep reviews on or before this date. Pair with **Reviews from** for a window, e.g. all of 2024."
          },
          "searchTerms": {
            "title": "🔍 City or place to search",
            "maxItems": 100,
            "type": "array",
            "description": "Used when Mode = Discover. Enter a **city or place name** (e.g. `Barcelona`, `Rome`, `Bali`) and the actor returns a list of its places with full details (name, rating, ranking, price range, amenities, official subratings, AI summary), no URLs needed. One per line. To pull the reviews for any of them, take its Location ID into Reviews mode.",
            "items": {
              "type": "string"
            }
          },
          "placeTypes": {
            "title": "🏨 Place types to discover",
            "type": "array",
            "description": "Which place types to pull when searching (Discover mode only).",
            "items": {
              "type": "string",
              "enum": [
                "hotels",
                "restaurants",
                "attractions"
              ],
              "enumTitles": [
                "🏨 Hotels",
                "🍽️ Restaurants",
                "🎟️ Attractions"
              ]
            },
            "default": [
              "hotels"
            ]
          },
          "maxPlaces": {
            "title": "🔢 Max places per search term",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Discover mode only: cap how many places to take per search term (split evenly across the selected types). Keeps a city search fast and predictable.",
            "default": 20
          },
          "discoveryDepth": {
            "title": "⚙️ Discovery detail",
            "enum": [
              "quick",
              "full"
            ],
            "type": "string",
            "description": "Discover mode only. **Quick** returns the fast city directory (name, rating, ranking, price, category, address, contact) with no per-place calls. **Full details** additionally fetches official subratings, the AI summary, and amenities for each place (slower).",
            "default": "quick"
          },
          "includePhotos": {
            "title": "📷 Include photos",
            "type": "boolean",
            "description": "Discover + Full details only: also fetch the photo gallery for each place (one extra request per place). Off by default to keep runs fast.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Proxy settings for outbound requests. The default (Apify Proxy, datacenter) is sufficient, the data endpoints are lightweight and not anti-bot gated.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}