{"id":"fa234a34-0f3c-4727-a6c4-c6d6fe9c04f7","slug":"tripadvisor-com-api","name":"tripadvisor.com API","description":"Scrape and extract travel data from TripAdvisor, including detailed listings for hotels, restaurants, attractions, tours, and other venues — with names, addresses, coordinates, contact information, opening hours, pricing, and amenities. Collect user-generated content such as reviews, ratings, reviewer details, and summary statistics. Search by location or keyword, paginate through results, and retrieve place-level details to support travel research, destination discovery, and accommodation comparison.","front_facing_description":"Search for travel destinations and discover hotels with detailed information like ratings, reviews, and amenities. Get comprehensive place details to help plan your perfect trip and compare accommodation options.","source_url":"https://tripadvisor.com","is_authenticated":false,"canonical_scraper_id":"f436cbcf-96a4-4f9e-85b0-3acad164fed6","apis":[{"method":"GET","endpoint_name":"search_location","description":"Search for locations (cities, regions, hotels, attractions, restaurants) by keyword to get their locationId and geographic details.","input_params":{"query":{"type":"string","required":true,"description":"Search keyword (e.g., 'London', 'Paris', 'New York')"}},"return_schema":{"type":"object","fields":{"total":"integer count of results returned","results":"array of location objects with locationId, name, placeType, latitude, longitude, isGeo, address, url, parentName, parentType"},"sample":{"data":{"total":1,"results":[{"url":"/Tourism-g186338-London_England-Vacations.html","name":"London","isGeo":true,"address":"England, United Kingdom","latitude":51.519241,"longitude":-0.096654,"placeType":"CITY","locationId":186338,"parentName":"United Kingdom","parentType":"COUNTRY"}]},"status":"success"}},"initiates_session":false,"price":2},{"method":"GET","endpoint_name":"list_hotels","description":"List hotels in a specific location by geoId. Returns structured hotel data including name, address, coordinates, rating, review count, price range, and contact info. Results are paginated with 30 hotels per page.","input_params":{"limit":{"type":"integer","required":false,"description":"Max number of hotels to return","default":30},"geo_id":{"type":"integer","required":true,"description":"Geographic location ID (e.g., 60763 for New York City, 186338 for London)"},"offset":{"type":"integer","required":false,"description":"Pagination offset in multiples of 30","default":0}},"return_schema":{"type":"object","fields":{"total":"integer count of hotels returned","geo_id":"integer echo of the requested geo_id","hotels":"array of hotel objects with locationId, name, address, latitude, longitude, telephone, image, rating, reviewCount, priceRange, url","offset":"integer echo of the requested offset"},"sample":{"data":{"total":5,"geo_id":60763,"hotels":[{"url":"https://www.tripadvisor.com/HotelHighlight-g60763-d23448880-Reviews-Motto_by_Hilton_New_York_City_Chelsea-New_York_City_New_York.html?m=68625","name":"Motto by Hilton New York City Chelsea","image":"https://dynamic-media-cdn.tripadvisor.com/media/photo-o/33/24/40/75/exterior.jpg?w=1200&h=-1&s=1","rating":4.8,"address":{"city":"New York City","state":"New York","street":"113 West 24th Street","country":"United States","postalCode":"10001"},"latitude":40.74406,"longitude":-73.99294,"telephone":"+1 (555) 012-3456","locationId":23448880,"priceRange":"€€","reviewCount":2048}],"offset":0},"status":"success"}},"initiates_session":false,"price":5},{"method":"GET","endpoint_name":"get_place_details","description":"Get special offers and basic metadata for a specific hotel location ID. Returns available special offer details for the property.","input_params":{"location_id":{"type":"integer","required":true,"description":"The hotel location ID (from list_hotels results or search_location results)"}},"return_schema":{"type":"object","fields":{"BaAggregation_getSpecialOfferDetailsBulk":"array of objects containing locationId and specialOffers array"},"sample":{"data":{"BaAggregation_getSpecialOfferDetailsBulk":[{"locationId":23448880,"specialOffers":[{"specialOfferId":20795627}]}]},"status":"success"}},"initiates_session":false,"price":2}],"sample_inputs":{"list_hotels":{"limit":"5","geo_id":"60763","offset":"0"},"search_location":{"query":"London"},"get_place_details":{}},"prefill_inputs":{},"last_verified_at":null,"endpoint_health":[],"sdk_usage_example":{"code":"\"\"\"\nTripAdvisor Parse API Client\n\nA practical Python client for the TripAdvisor Scraper API that enables searching locations,\nlisting hotels with rich metadata, and retrieving place details.\n\nGet your API key from: https://parse.bot/settings\n\"\"\"\n\nimport os\nimport requests\nfrom typing import Optional, Dict, Any\n\n\nclass ParseClient:\n    \"\"\"Client for interacting with the TripAdvisor Scraper API via Parse.\"\"\"\n\n    def __init__(self, api_key: Optional[str] = None):\n        \"\"\"\n        Initialize the Parse client.\n\n        Args:\n            api_key: API key for authentication. If not provided, reads from PARSE_API_KEY env var.\n        \"\"\"\n        self.base_url = \"https://api.parse.bot\"\n        self.scraper_id = \"f436cbcf-96a4-4f9e-85b0-3acad164fed6\"\n        self.api_key = api_key or os.getenv(\"PARSE_API_KEY\")\n\n        if not self.api_key:\n            raise ValueError(\n                \"API key not provided. Set PARSE_API_KEY environment variable or pass api_key parameter.\"\n            )\n\n    def _call(self, endpoint: str, method: str = \"POST\", **params) -> Dict[str, Any]:\n        \"\"\"\n        Make an API call to the Parse scraper.\n\n        Args:\n            endpoint: The endpoint name to call.\n            method: HTTP method (GET or POST).\n            **params: Parameters to send with the request.\n\n        Returns:\n            Response data as a dictionary.\n\n        Raises:\n            requests.RequestException: If the API request fails.\n        \"\"\"\n        url = f\"{self.base_url}/scraper/{self.scraper_id}/{endpoint}\"\n        headers = {\n            \"X-API-Key\": self.api_key,\n            \"Content-Type\": \"application/json\",\n        }\n\n        if method.upper() == \"GET\":\n            response = requests.get(url, headers=headers, params=params)\n        elif method.upper() == \"POST\":\n            response = requests.post(url, headers=headers, json=params)\n        else:\n            raise ValueError(f\"Unsupported HTTP method: {method}\")\n\n        response.raise_for_status()\n        return response.json()\n\n    def search_location(self, query: str) -> Dict[str, Any]:\n        \"\"\"\n        Search for locations (cities, regions, hotels, attractions) to get their locationId.\n\n        Args:\n            query: Search keyword (e.g., 'London', 'Paris', 'New York City').\n\n        Returns:\n            Dictionary containing results array with location objects.\n            Each location object contains: locationId, name, placeType, coordinates, etc.\n        \"\"\"\n        return self._call(\"search_location\", method=\"GET\", query=query)\n\n    def list_hotels(\n        self, geo_id: int, limit: int = 30, offset: int = 0\n    ) -> Dict[str, Any]:\n        \"\"\"\n        List hotels in a specific location by geoId.\n\n        Returns rich data including ratings, address, contact, and pricing.\n\n        Args:\n            geo_id: Location ID from search_location.\n            limit: Number of results to return (default: 30).\n            offset: Pagination offset (default: 0).\n\n        Returns:\n            Dictionary containing hotels array with hotel objects.\n            Each hotel contains location data with name, rating, reviews, and contact info.\n        \"\"\"\n        return self._call(\n            \"list_hotels\", method=\"GET\", geo_id=geo_id, limit=limit, offset=offset\n        )\n\n    def get_place_details(self, location_id: int) -> Dict[str, Any]:\n        \"\"\"\n        Get special offers and basic metadata for a specific location ID.\n\n        Args:\n            location_id: Specific location/hotel ID.\n\n        Returns:\n            Dictionary containing special offer details for the location.\n        \"\"\"\n        return self._call(\n            \"get_place_details\", method=\"GET\", location_id=location_id\n        )\n\n\ndef main():\n    \"\"\"Practical workflow: Search for a city, list hotels, and get details for top results.\"\"\"\n\n    # Initialize the client\n    client = ParseClient()\n\n    # Step 1: Search for a destination\n    print(\"=\" * 70)\n    print(\"STEP 1: SEARCHING FOR DESTINATIONS\")\n    print(\"=\" * 70)\n\n    query = \"London\"\n    print(f\"\\nSearching for locations matching: '{query}'...\\n\")\n\n    search_results = client.search_location(query)\n\n    if not search_results.get(\"data\", {}).get(\"results\"):\n        print(f\"No results found for '{query}'\")\n        return\n\n    locations = search_results[\"data\"][\"results\"]\n    total = search_results[\"data\"].get(\"total\", len(locations))\n    print(f\"Found {total} location(s):\\n\")\n\n    for idx, location in enumerate(locations[:3], 1):\n        location_id = location.get(\"locationId\")\n        name = location.get(\"name\")\n        place_type = location.get(\"placeType\")\n        address = location.get(\"address\")\n        latitude = location.get(\"latitude\", \"N/A\")\n        longitude = location.get(\"longitude\", \"N/A\")\n        parent_name = location.get(\"parentName\", \"N/A\")\n\n        print(f\"{idx}. {name}\")\n        print(f\"   Type: {place_type} | Location ID: {location_id}\")\n        print(f\"   Address: {address}\")\n        print(f\"   Parent: {parent_name}\")\n        print(f\"   Coordinates: ({latitude}, {longitude})\\n\")\n\n    # Step 2: Get the first city location and list hotels\n    print(\"=\" * 70)\n    print(\"STEP 2: LISTING HOTELS\")\n    print(\"=\" * 70)\n\n    # Find a city type location for hotel listing\n    city_location = None\n    for location in locations:\n        if location.get(\"placeType\") == \"CITY\":\n            city_location = location\n            break\n\n    if not city_location:\n        city_location = locations[0]\n\n    location_id = city_location.get(\"locationId\")\n    location_name = city_location.get(\"name\")\n\n    print(f\"\\nFetching hotels in {location_name}...\\n\")\n\n    hotels_response = client.list_hotels(geo_id=int(location_id), limit=5)\n\n    if not hotels_response.get(\"data\", {}).get(\"hotels\"):\n        print(f\"No hotels found in {location_name}\")\n        return\n\n    hotels = hotels_response[\"data\"][\"hotels\"]\n    print(f\"Found {hotels_response['data'].get('total', len(hotels))} hotels in {location_name}:\\n\")\n\n    hotel_location_ids = []\n    for idx, hotel in enumerate(hotels, 1):\n        hotel_location_id = hotel.get(\"locationId\")\n        hotel_name = hotel.get(\"name\")\n        rating = hotel.get(\"rating\", \"N/A\")\n        review_count = hotel.get(\"reviewCount\", 0)\n        address_data = hotel.get(\"address\", {})\n        street = address_data.get(\"street\", \"N/A\")\n        city = address_data.get(\"city\", \"N/A\")\n        phone = hotel.get(\"telephone\", \"Not available\")\n        price_range = hotel.get(\"priceRange\", \"N/A\")\n        latitude = hotel.get(\"latitude\", \"N/A\")\n        longitude = hotel.get(\"longitude\", \"N/A\")\n\n        print(f\"{idx}. {hotel_name}\")\n        print(f\"   ⭐ Rating: {rating}/5.0 ({review_count} reviews)\")\n        print(f\"   Address: {street}, {city}\")\n        print(f\"   Phone: {phone}\")\n        print(f\"   Price Range: {price_range}\")\n        print(f\"   Coordinates: ({latitude}, {longitude})\")\n        print(f\"   Location ID: {hotel_location_id}\\n\")\n\n        if hotel_location_id:\n            hotel_location_ids.append(hotel_location_id)\n\n    # Step 3: Get special offers for top hotels\n    print(\"=\" * 70)\n    print(\"STEP 3: FETCHING SPECIAL OFFERS\")\n    print(\"=\" * 70)\n\n    if hotel_location_ids:\n        for hotel_id in hotel_location_ids[:3]:\n            hotel_name = next(\n                (h.get(\"name\") for h in hotels if h.get(\"locationId\") == hotel_id),\n                f\"Hotel {hotel_id}\",\n            )\n            print(f\"\\nFetching special offers for: {hotel_name} (ID: {hotel_id})...\")\n\n            try:\n                details = client.get_place_details(int(hotel_id))\n\n                offers_data = details.get(\"data\", {}).get(\n                    \"BaAggregation_getSpecialOfferDetailsBulk\", []\n                )\n                if offers_data:\n                    for offer_item in offers_data:\n                        special_offers = offer_item.get(\"specialOffers\", [])\n                        if special_offers:\n                            print(f\"  ✓ Found {len(special_offers)} special offer(s):\")\n                            for offer in special_offers:\n                                offer_id = offer.get(\"specialOfferId\", \"N/A\")\n                                print(f\"    - Offer ID: {offer_id}\")\n                        else:\n                            print(\"  ✗ No special offers currently available\")\n                else:\n                    print(\"  ✗ No offer data available\")\n\n            except requests.exceptions.RequestException as e:\n                print(f\"  ✗ Error fetching details: {e}\")\n\n    # Summary\n    print(\"\\n\" + \"=\" * 70)\n    print(\"WORKFLOW SUMMARY\")\n    print(\"=\" * 70)\n    print(f\"\\nDestination searched: {query}\")\n    print(f\"Selected city: {location_name}\")\n    print(f\"Hotels retrieved: {len(hotels)}\")\n    print(f\"Special offers checked: {min(3, len(hotel_location_ids))} hotels\")\n    print(\"\\nTop hotel recommendations:\")\n\n    for idx, hotel in enumerate(hotels[:3], 1):\n        hotel_name = hotel.get(\"name\")\n        rating = hotel.get(\"rating\", \"N/A\")\n        review_count = hotel.get(\"reviewCount\", 0)\n\n        print(f\"  {idx}. {hotel_name}\")\n        print(f\"     ⭐ {rating}/5.0 ({review_count} reviews)\\n\")\n\n\nif __name__ == \"__main__\":\n    main()","endpoints":["search_location","list_hotels","get_place_details"],"has_session":false,"front_facing_description":"Search for travel destinations and discover hotels with detailed reviews and ratings from TripAdvisor's community. Get comprehensive place information including amenities, photos, and visitor insights to plan your perfect trip."},"sdk_delivery_state":"legacy","summary":"Search locations, list hotels, and get place details from TripAdvisor","updated_at":"2026-07-23T02:20:45.785703+00:00","user_variants":[],"latest_version":7,"user_status":null,"user_scraper_id":null,"contributes_to_marketplace":true,"pinned_version":null,"seo_content":{"faqs":[{"a":"TripAdvisor offers a Content API for select partners at developers.tripadvisor.com, but access requires approval and is restricted to qualified use cases. This Parse API provides structured access to location search, hotel listings, and special offers without requiring a TripAdvisor developer account.","q":"Does TripAdvisor have an official developer API?"},{"a":"Each page returns up to 30 hotel objects, each containing `locationId`, `name`, `address`, `latitude`, `longitude`, `telephone`, `image`, `rating`, `reviewCount`, `priceRange`, and `url`. To paginate, increment the `offset` parameter by 30 (e.g., 0, 30, 60). The response echoes both `geo_id` and `offset` so you can verify the request parameters against the result.","q":"What does `list_hotels` return, and how does pagination work?"},{"a":"`search_location` returns results for restaurants, attractions, and other place types alongside hotels — you can identify them via the `placeType` field. However, dedicated listing endpoints for restaurants or attractions (equivalent to `list_hotels`) are not currently part of this API. You can fork it on Parse and revise to add those listing endpoints.","q":"Are restaurant or attraction listings available, not just hotels?"},{"a":"The current endpoints expose `reviewCount` (an integer) and `rating` per hotel, but do not return individual review text, review titles, or reviewer profiles. You can fork the API on Parse and revise it to add a reviews endpoint that returns per-review content for a given `locationId`.","q":"Does the API return user reviews or review text?"},{"a":"The endpoint is specifically scoped to special offer data via `BaAggregation_getSpecialOfferDetailsBulk`. It does not return general hotel metadata such as amenities, check-in policies, or room types. If a property has no active special offers, the `specialOffers` array will be empty.","q":"What is a known limitation of the `get_place_details` endpoint?"}],"keywords":["tripadvisor hotel API","tripadvisor location search API","hotel listings by city API","tripadvisor geo ID hotels","hotel rating and review count API","tripadvisor special offers API","travel destination geocoding API","hotel price range API","tripadvisor locationId lookup","paginated hotel listings API","tripadvisor place details API","hotel coordinates API","tripadvisor search endpoint"],"use_cases":["Build a hotel price-range comparison tool using `priceRange` and `rating` fields from `list_hotels`","Resolve destination names to geographic IDs for use in downstream travel itinerary apps via `search_location`","Display hotel contact information and direct booking links using `telephone` and `url` fields","Surface special hotel promotions by chaining `list_hotels` results into `get_place_details`","Geocode hotels for map-based UIs using `latitude` and `longitude` from `list_hotels`","Filter search results by `placeType` to separate city-level geo nodes from individual attractions or hotels"],"meta_title":"TripAdvisor API – Hotels, Locations & Offers","generated_at":"2026-05-21T20:43:50.466917+00:00","lead_paragraph":"The TripAdvisor API exposes 3 endpoints covering location search, hotel listings, and place-level offer details. Use `search_location` to resolve any city, region, or attraction name into a `locationId` and geographic coordinates, then pass the resulting `geo_id` to `list_hotels` to retrieve paginated hotel records including ratings, review counts, price ranges, phone numbers, and images. Each response uses consistent integer IDs that chain across endpoints.","schema_version":2,"meta_description":"Search TripAdvisor locations, list hotels by geo ID, and fetch special offers. Get ratings, review counts, price ranges, and coordinates via 3 structured endpoints.","primary_category":"travel","long_description_md":"## Endpoints and Data Shape\n\nThe `search_location` endpoint accepts a free-text `query` (e.g., `'London'` or `'New York'`) and returns an array of location objects. Each object includes `locationId`, `name`, `placeType`, `latitude`, `longitude`, `isGeo`, `address`, `url`, `parentName`, and `parentType`. This is the standard entry point for resolving human-readable names into the integer IDs the other endpoints require.\n\n## Hotel Listings\n\n`list_hotels` takes a required `geo_id` integer — obtained from `search_location` or known in advance (e.g., `60763` for New York City, `186338` for London) — and returns up to 30 hotels per page. Pagination is controlled via the `offset` parameter in multiples of 30, and the response echoes both `geo_id` and `offset` for consistency. Each hotel record includes `locationId`, `name`, `address`, `latitude`, `longitude`, `telephone`, `image`, `rating`, `reviewCount`, `priceRange`, and a direct TripAdvisor `url`.\n\n## Place Details and Special Offers\n\n`get_place_details` accepts a `location_id` integer (from either of the other endpoints) and returns special offer data for that property. The response is structured under `BaAggregation_getSpecialOfferDetailsBulk`, an array of objects containing `locationId` and a `specialOffers` array. This endpoint is suited for surfacing current promotions tied to a specific hotel rather than general metadata.\n\n## Coverage Notes\n\nAll three endpoints return TripAdvisor `url` fields, making it straightforward to deep-link users to the original listing. `placeType` in `search_location` results distinguishes between geo nodes (cities, regions) and point-of-interest types (hotels, attractions, restaurants), which is useful when you need to filter search results before passing IDs downstream.","generated_with_model":"global.anthropic.claude-sonnet-4-6","secondary_categories":["reviews_ratings","maps_geo"]},"primary_category":"travel","secondary_categories":["reviews_ratings","maps_geo"],"access_requirements":[]}