GET
TripAdvisor Hotel Prices API
Extract real-time hotel pricing from multiple providers via TripAdvisor's GraphQL API.
Overview
Real-Time Pricing
Get current prices from multiple booking providers including Booking.com, Expedia, Hotels.com, and more.
The TripAdvisor Hotel Prices endpoint provides real-time pricing information from various booking providers for specific dates. Compare prices across platforms and get direct booking links.
Endpoint URL
GET https://api.stayapi.com/v1/tripadvisor/hotel/prices/{location_id}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
location_id | string | Required | TripAdvisor location ID (path parameter) |
check_in | string | Required | Check-in date (YYYY-MM-DD) |
check_out | string | Required | 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) |
currency | string | Optional | Currency code (default: "USD") |
Response Structure
Price Information
provider_name
- Booking site nameprice
- Display price (formatted)price_amount
- Numeric price valuecurrency
- Price currencybooking_url
- Direct booking link
Provider Details
- Provider logo URL
- Provider display name
- Price type (per night, total stay, etc.)
- Any special offers or tags
Summary Data
- Lowest available price
- Average price across providers
- Total number of providers
- Price range (min to max)
Common Providers
Typical booking providers include:
Booking.com
Expedia
Hotels.com
Agoda
Trip.com
Hotel Website
Price Variations
Prices can vary significantly between providers. Always check multiple sources for the best deal.
Request
curl -X GET "https://api.stayapi.com/v1/tripadvisor/hotel/prices/305165?check_in=2025-08-01&check_out=2025-08-03&adults=2&rooms=1" \ -H "x-api-key: YOUR_API_KEY"
const locationId = "305165"; const params = new URLSearchParams({ check_in: "2025-08-01", check_out: "2025-08-03", adults: "2", rooms: "1", currency: "USD" }); const response = await fetch( `https://api.stayapi.com/v1/tripadvisor/hotel/prices/${locationId}?${params}`, { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); // Display price summary console.log(`Hotel: ${data.data.hotel_name}`); console.log(`Check-in: ${data.data.check_in}`); console.log(`Check-out: ${data.data.check_out}`); console.log(`Nights: ${data.data.nights}`); console.log(`\nLowest price: ${data.data.summary.lowest_price}`); console.log(`Average price: ${data.data.summary.average_price}`); // Display prices by provider console.log("\nPrices by provider:"); data.data.prices.forEach(offer => { console.log(` ${offer.provider_name}: ${offer.price}`); if (offer.booking_url) { console.log(` Book at: ${offer.booking_url}`); } });
import requests from datetime import datetime, timedelta # Set dates check_in = (datetime.now() + timedelta(days=30)).strftime("%Y-%m-%d") check_out = (datetime.now() + timedelta(days=32)).strftime("%Y-%m-%d") location_id = "305165" url = f"https://api.stayapi.com/v1/tripadvisor/hotel/prices/{location_id}" headers = {"x-api-key": "YOUR_API_KEY"} params = { "check_in": check_in, "check_out": check_out, "adults": 2, "rooms": 1, "currency": "USD" } response = requests.get(url, headers=headers, params=params) data = response.json() # Display hotel and date info print(f"Hotel: {data['data']['hotel_name']}") print(f"Dates: {data['data']['check_in']} to {data['data']['check_out']}") print(f"Nights: {data['data']['nights']}") print(f"Guests: {data['data']['adults']} adults, {data['data']['rooms']} room(s)") # Price summary summary = data["data"]["summary"] print(f"\nPrice Summary:") print(f" Lowest: {summary['lowest_price']}") print(f" Average: {summary['average_price']}") print(f" Highest: {summary['highest_price']}") print(f" Providers: {summary['provider_count']}") # Sort prices and display prices = sorted(data["data"]["prices"], key=lambda x: x["price_amount"]) print(f"\nAvailable Rates:") for i, offer in enumerate(prices, 1): print(f"{i}. {offer['provider_name']:15} {offer['price']:>10}") if offer.get("special_offer"): print(f" ⭐ {offer['special_offer']}") # Best deal if prices: best = prices[0] print(f"\nBest Deal: {best['provider_name']} at {best['price']}") print(f"Book now: {best['booking_url']}")
Response
{ "success": true, "data": { "location_id": "305165", "hotel_name": "The Siam", "check_in": "2025-08-01", "check_out": "2025-08-03", "nights": 2, "adults": 2, "rooms": 1, "currency": "USD", "prices": [ { "provider_name": "Booking.com", "provider_logo": "https://static.tacdn.com/img2/branding/hotels/booking_logo.png", "price": "$450", "price_amount": 450.00, "price_type": "per_night", "total_price": "$900", "total_amount": 900.00, "booking_url": "https://www.tripadvisor.com/Commerce?p=BookingCom&src=123456&url=https%3A%2F%2Fwww.booking.com%2Fhotel%2Fth%2Fthe-siam.html", "special_offer": null }, { "provider_name": "Expedia", "provider_logo": "https://static.tacdn.com/img2/branding/hotels/expedia_logo.png", "price": "$465", "price_amount": 465.00, "price_type": "per_night", "total_price": "$930", "total_amount": 930.00, "booking_url": "https://www.tripadvisor.com/Commerce?p=Expedia&src=123456&url=https%3A%2F%2Fwww.expedia.com%2Fhotel", "special_offer": "Free cancellation" }, { "provider_name": "Hotels.com", "provider_logo": "https://static.tacdn.com/img2/branding/hotels/hotelscom_logo.png", "price": "$442", "price_amount": 442.00, "price_type": "per_night", "total_price": "$884", "total_amount": 884.00, "booking_url": "https://www.tripadvisor.com/Commerce?p=HotelsCom2&src=123456&url=https%3A%2F%2Fwww.hotels.com", "special_offer": "Collect 1 free night" }, { "provider_name": "Official Site", "provider_logo": null, "price": "$425", "price_amount": 425.00, "price_type": "per_night", "total_price": "$850", "total_amount": 850.00, "booking_url": "https://www.thesiamhotel.com/reservations", "special_offer": "Best rate guarantee" } ], "summary": { "lowest_price": "$425", "lowest_provider": "Official Site", "highest_price": "$465", "highest_provider": "Expedia", "average_price": "$445.50", "provider_count": 4, "currency": "USD" } }, "message": "Successfully retrieved hotel prices", "retrieved_at": "2024-01-15T10:30:00Z" }
{ "error": "Invalid dates", "detail": "Check-out date must be after check-in date", "status_code": 400 }