Hotel Meta Search API
Find booking links for any hotel across multiple platforms including Booking.com, Expedia, Hotels.com, and more.
Overview
Primary Use Case
Perfect for travel comparison sites, hotel booking aggregators, and applications that need to provide users with multiple booking options.
The Meta Search endpoint searches across multiple booking platforms to find direct links for a specific hotel. This allows your users to compare prices and book through their preferred platform.
Endpoint URL
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
hotel_name | string | Required | The name of the hotel to search for. Be as specific as possible for better results. |
location | string | Optional | The location of the hotel (city, region, country). Helps improve search accuracy. |
platforms | array | Optional | Specific platforms to search. If not provided, searches all available platforms. |
include_official | boolean | Optional | Whether to include the hotel's official website in results. Default: true |
Pro Tip
Include both hotel_name and location for the most accurate results. The more specific you are, the better the platform matching will be.
Response Format
Success Response (200 OK)
Field | Type | Description |
---|---|---|
status | string | Response status (always "success" for 200 responses) |
data.hotel_name | string | The hotel name used for the search |
data.location | string | The location used for the search |
data.links | object | Object containing booking platform URLs |
data.platform_count | integer | Number of platforms where the hotel was found |
data.official_website_detected | boolean | Whether the hotel's official website was found |
Available Platforms
The links
object may contain URLs for the following platforms:
booking_com
expedia
hotels_com
agoda
tripadvisor
kayak
priceline
official_website
Common Use Cases
Travel Comparison Sites
Show users multiple booking options for the same hotel, allowing them to compare prices and choose their preferred platform.
Affiliate Marketing
Generate affiliate revenue by providing users with direct booking links to partner platforms.
Hotel Discovery Apps
Help users find and book hotels across multiple platforms from a single interface.
Travel Blogs & Content
Add booking options to hotel reviews and travel guides to monetize content.
Error Responses
400 Bad Request
Missing required parameters or invalid parameter values.
{ "error": { "code": "bad_request", "message": "Missing required parameter: hotel_name", "details": "The hotel_name parameter is required for this endpoint" } }
404 Not Found
No results found for the specified hotel and location.
{ "error": { "code": "not_found", "message": "No booking links found for the specified hotel", "details": "Try using a more specific hotel name or check the spelling" } }
Handling Not Found Results
A 404 response doesn't mean your request was invalid - it means no booking links were found. Consider providing users with alternative search suggestions.
Rate Limits
This endpoint is subject to the standard StayAPI rate limits:
- Free tier: 100 requests per hour, 1,000 per day
- Professional tier: 1,000 requests per hour, 25,000 per day
- Enterprise tier: Custom limits available
curl -X GET "https://api.stayapi.com/v1/meta/search" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -G \ -d "hotel_name=Four Seasons Resort Bali" \ -d "location=Jimbaran, Indonesia" \ -d "include_official=true"
const response = await fetch("https://api.stayapi.com/v1/meta/search?" + new URLSearchParams({ hotel_name: "Four Seasons Resort Bali", location: "Jimbaran, Indonesia", include_official: "true" }), { headers: { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json" } }); const data = await response.json(); console.log(`Found ${data.data.platform_count} platforms:`); data.data.links && Object.entries(data.data.links).forEach(([platform, url]) => { console.log(`${platform}: ${url}`); });
import requests url = "https://api.stayapi.com/v1/meta/search" headers = { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json" } params = { "hotel_name": "Four Seasons Resort Bali", "location": "Jimbaran, Indonesia", "include_official": True } response = requests.get(url, headers=headers, params=params) data = response.json() if response.status_code == 200: links = data["data"]["links"] print(f"Found {len(links)} booking platforms:") for platform, url in links.items(): print(f" {platform}: {url}") else: print(f"Error: {response.status_code}") print(data.get("error", {}).get("message", "Unknown error"))
<?php $url = "https://api.stayapi.com/v1/meta/search"; $params = http_build_query([ "hotel_name" => "Four Seasons Resort Bali", "location" => "Jimbaran, Indonesia", "include_official" => true ]); $headers = [ "x-api-key: YOUR_API_KEY", "Content-Type: application/json" ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url . "?" . $params); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $data = json_decode($response, true); curl_close($ch); if ($data["status"] === "success") { echo "Found " . count($data["data"]["links"]) . " platforms:\n"; foreach ($data["data"]["links"] as $platform => $url) { echo "$platform: $url\n"; } } ?>
require "net/http" require "uri" require "json" uri = URI("https://api.stayapi.com/v1/meta/search") uri.query = URI.encode_www_form({ hotel_name: "Four Seasons Resort Bali", location: "Jimbaran, Indonesia", include_official: true }) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri) request["x-api-key"] = "YOUR_API_KEY" request["Content-Type"] = "application/json" response = http.request(request) data = JSON.parse(response.body) if response.code == "200" puts "Found #{data["data"]["links"].length} platforms:" data["data"]["links"].each do |platform, url| puts " #{platform}: #{url}" end else puts "Error: #{response.code}" puts data["error"]["message"] if data["error"] end
{ "status": "success", "data": { "hotel_name": "Four Seasons Resort Bali", "location": "Jimbaran, Indonesia", "links": { "booking_com": "https://www.booking.com/hotel/id/four-seasons-resort-bali-at-jimbaran-bay.html", "expedia": "https://www.expedia.com/Jimbaran-Hotels-Four-Seasons-Resort-Bali.h1234567.Hotel-Information", "hotels_com": "https://hotels.com/ho123456/four-seasons-resort-bali-jimbaran-indonesia/", "agoda": "https://www.agoda.com/four-seasons-resort-bali-at-jimbaran-bay/hotel/bali-id.html", "tripadvisor": "https://www.tripadvisor.com/Hotel_Review-g469404-d301386-Reviews-Four_Seasons_Resort_Bali_at_Jimbaran_Bay.html", "official_website": "https://www.fourseasons.com/jimbaran/", "kayak": "https://www.kayak.com/hotels/Four-Seasons-Resort-Bali-c47329.h123456.Hotel-Information" }, "platform_count": 7, "official_website_detected": true, "search_quality": "high", "response_time_ms": 245 } }
{ "error": { "code": "not_found", "message": "No booking links found for the specified hotel", "details": "Try using a more specific hotel name or check the spelling" } }