GET
TripAdvisor Search API
Search for hotels in any destination on TripAdvisor with advanced filtering options.
Overview
Location-Based Search
Search for hotels in a specific geographic area with optional date filters and sorting options.
The TripAdvisor Search endpoint allows you to find hotels in a specific location (city, region, or area) with optional filtering by dates, guest configuration, and various sorting options.
Endpoint URL
GET https://api.stayapi.com/v1/tripadvisor/search
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
geo_id | string | Required | TripAdvisor geographic area ID (e.g., "293916" for Bangkok) |
check_in | string | Optional | Check-in date (YYYY-MM-DD) |
check_out | string | Optional | Check-out date (YYYY-MM-DD) |
adults | integer | Optional | Number of adult guests (1-8, default: 2) |
rooms | integer | Optional | Number of rooms (1-4, default: 1) |
children_ages | array | Optional | List of children ages (e.g., [5, 12]) |
currency | string | Optional | Currency code (default: "USD") |
offset | integer | Optional | Pagination offset (default: 0) |
limit | integer | Optional | Number of results (1-50, default: 30) |
sort | string | Optional | Sort order (see options below) |
Sort Options
Available sort orders:
BEST_VALUE
Best value for money (default)
TRAVELER_RANKED
Traveler ranking
PRICE_LOW_TO_HIGH
Lowest price first
PRICE_HIGH_TO_LOW
Highest price first
Finding Geographic IDs
Common Geo IDs
Bangkok: 293916, Phuket: 2400063, Paris: 187147, London: 186338, New York: 60763
Geographic IDs can be found in TripAdvisor destination URLs:
https://www.tripadvisor.com/Tourism-g293916-Bangkok_Thailand.html
The geo ID is 293916
(the number after "g").
Response Data
Hotel Information
- Hotel name and location ID
- Rating and review count
- Price information (if dates provided)
- Distance from city center
- Main photo URL
- Property type and subcategory
Search Metadata
- Total results count
- Available filters and their counts
- Price range in the results
- Sort options available
- Pagination information
Request
curl -X GET "https://api.stayapi.com/v1/tripadvisor/search?geo_id=2400063&limit=10" \ -H "x-api-key: YOUR_API_KEY"
// Search for hotels in Phuket const params = new URLSearchParams({ geo_id: "2400063", // Phuket check_in: "2025-08-01", check_out: "2025-08-05", adults: "2", rooms: "1", limit: "20", sort: "BEST_VALUE" }); const response = await fetch( `https://api.stayapi.com/v1/tripadvisor/search?${params}`, { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); console.log(`Found ${data.data.total_results} hotels in ${data.data.geo_name}`); // Display results data.data.hotels.forEach((hotel, index) => { console.log(`\n${index + 1}. ${hotel.name}`); console.log(` Rating: ${hotel.rating}/5 (${hotel.num_reviews} reviews)`); console.log(` Ranking: #${hotel.ranking}`); if (hotel.price_level) { console.log(` Price: ${hotel.price_level}`); } if (hotel.distance) { console.log(` Distance: ${hotel.distance} from center`); } }); // Show available filters console.log("\nAvailable Filters:"); Object.entries(data.data.filters).forEach(([filterType, options]) => { console.log(` ${filterType}: ${options.length} options`); });
import requests # Search parameters geo_id = "2400063" # Phuket, Thailand url = "https://api.stayapi.com/v1/tripadvisor/search" headers = {"x-api-key": "YOUR_API_KEY"} params = { "geo_id": geo_id, "check_in": "2025-08-01", "check_out": "2025-08-05", "adults": 2, "rooms": 1, "limit": 20, "sort": "BEST_VALUE", "currency": "USD" } response = requests.get(url, headers=headers, params=params) data = response.json() # Display search summary print(f"Search Results for {data['data']['geo_name']}") print(f"Total hotels found: {data['data']['total_results']}") print(f"Showing: {len(data['data']['hotels'])} results\n") # Display hotels for i, hotel in enumerate(data["data"]["hotels"], 1): print(f"{i}. {hotel['name']}") print(f" Location ID: {hotel['location_id']}") print(f" Rating: {hotel['rating']}/5 ({hotel['num_reviews']} reviews)") print(f" Ranking: #{hotel['ranking']} in {data['data']['geo_name']}") if hotel.get("price_level"): print(f" Price Level: {hotel['price_level']}") if hotel.get("price_per_night"): print(f" Price: {hotel['price_per_night']} per night") if hotel.get("subcategory"): print(f" Type: {hotel['subcategory']}") print(f" Distance: {hotel.get('distance', 'N/A')}") print() # Show filter options if "filters" in data["data"]: print("\nAvailable Filters:") for filter_type, options in data["data"]["filters"].items(): print(f"\n{filter_type}:") for opt in options[:5]: # Show first 5 options count = opt.get("count", "") print(f" - {opt['name']} ({count} hotels)" if count else f" - {opt['name']}") if len(options) > 5: print(f" ... and {len(options) - 5} more") # Pagination info if data["data"]["hotels"]: print(f"\nPagination:") print(f" Current offset: {params.get('offset', 0)}") print(f" Results per page: {params['limit']}") print(f" Has more results: {len(data['data']['hotels']) == params['limit']}")
Response
{ "success": true, "data": { "geo_id": "2400063", "geo_name": "Phuket", "total_results": 1456, "search_date": "2025-08-01 to 2025-08-05", "hotels": [ { "location_id": "302297", "name": "Banyan Tree Phuket", "rating": 4.5, "num_reviews": 2345, "ranking": 15, "price_level": "$$$$", "price_per_night": "$450", "hotel_class": 5, "subcategory": "Resort", "distance": "18.2 km from city center", "main_photo": "https://media-cdn.tripadvisor.com/media/photo-o/hotel.jpg", "awards": [ "TRAVELLERS_CHOICE_2023" ] }, { "location_id": "232813", "name": "The Slate", "rating": 4.5, "num_reviews": 1876, "ranking": 23, "price_level": "$$$", "price_per_night": "$280", "hotel_class": 5, "subcategory": "Resort", "distance": "22.5 km from city center", "main_photo": "https://media-cdn.tripadvisor.com/media/photo-o/hotel2.jpg", "awards": [] } ], "filters": { "hotel_class": [ {"name": "5 stars", "value": "5", "count": 145}, {"name": "4 stars", "value": "4", "count": 298}, {"name": "3 stars", "value": "3", "count": 456} ], "amenities": [ {"name": "Free Wifi", "value": "free_wifi", "count": 1234}, {"name": "Pool", "value": "pool", "count": 987}, {"name": "Beach", "value": "beach", "count": 543} ], "property_types": [ {"name": "Hotels", "value": "hotels", "count": 678}, {"name": "Resorts", "value": "resorts", "count": 456}, {"name": "B&Bs & Inns", "value": "bb", "count": 234} ], "price_range": { "min": 25, "max": 1200, "currency": "USD" } }, "sort_options": [ {"name": "Best Value", "value": "BEST_VALUE"}, {"name": "Traveler Ranked", "value": "TRAVELER_RANKED"}, {"name": "Price (Low to High)", "value": "PRICE_LOW_TO_HIGH"}, {"name": "Price (High to Low)", "value": "PRICE_HIGH_TO_LOW"} ] }, "message": "Successfully retrieved search results", "retrieved_at": "2024-01-15T10:30:00Z" }
{ "error": "Invalid geo_id", "detail": "The provided geo_id is not valid", "status_code": 400 }