GET
# 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

GET https://api.stayapi.com/v1/meta/search 

## 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. |

#### 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 |
| --- | --- | --- |
| success | boolean | Whether the request was successful |
| hotel\_name | string | The hotel name used for the search |
| location | string | The location used for the search (null if not provided) |
| links | object | Object containing booking platform URLs (null if not found) |
| metadata.total\_results\_found | integer | Number of platforms where the hotel was found |
| metadata.retrieved\_at | string | UTC timestamp for the search result |
| message | string | Human-readable result message |

### Available Platforms

The `links` object may contain URLs for the following platforms:

#### OTA Platforms

- `booking_com`
- `expedia`
- `hotels_com`
- `agoda`

- `tripadvisor`
- `kayak`
- `priceline`

#### Hotel Chain Sites

- `marriott`
- `hilton`

- `ihg`
- `hyatt`

#### Official Website

- `official_website` - The hotel's own 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.

Perfect for price comparison features

### Affiliate Marketing

Generate affiliate revenue by providing users with direct booking links to partner platforms.

Maximize conversion opportunities

### Hotel Discovery Apps

Help users find and book hotels across multiple platforms from a single interface.

Streamline the booking process

### Travel Blogs & Content

Add booking options to hotel reviews and travel guides to monetize content.

Turn content into revenue

## Error Responses

### 404 No Results

The search completed but returned no organic results. Refine the hotel name or add a location. This is a completed lookup and counts as a request.

```
{
  "type": "https://api.stayapi.com/errors/not-found",
  "title": "No Results",
  "status": 404,
  "detail": "No search results found for this hotel",
  "error_code": "NO_RESULTS",
  "instance": "/v1/meta/search",
  "provider": "meta"
}
```

### 422 Validation Error

The required `hotel_name` parameter is missing or invalid.

```
{
  "type": "https://api.stayapi.com/errors/validation-error",
  "title": "Validation Error",
  "status": 422,
  "detail": "Request validation failed.",
  "error_code": "VALIDATION_ERROR",
  "instance": "/v1/meta/search",
  "provider": "meta"
}
```

### 502 Upstream Error

Hotel link search is temporarily unavailable or returned an unusable response; it can be retried.

```
{
  "type": "https://api.stayapi.com/errors/upstream-error",
  "title": "Upstream Error",
  "status": 502,
  "detail": "The upstream service could not complete the request.",
  "error_code": "UPSTREAM_ERROR",
  "instance": "/v1/meta/search",
  "provider": "meta"
}
```

#### Handling Upstream Errors

Treat a 502 as transient. Log the correlation\_id from the response and retry later using your normal application-level policy.

Request

```curl
curl -X GET "https://api.stayapi.com/v1/meta/search?hotel_name=Four%20Seasons%20Resort%20Bali&location=Jimbaran%2C%20Indonesia" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

Response

```json
{
  "success": true,
  "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.html",
    "kayak": null,
    "priceline": null,
    "marriott": null,
    "hilton": null,
    "ihg": null,
    "hyatt": null,
    "official_website": "https://www.fourseasons.com/jimbaran/"
  },
  "metadata": {
    "total_results_found": 6,
    "retrieved_at": "2025-01-07T12:50:26Z"
  },
  "message": "Successfully found 6 links for the hotel",
  "retrieved_at": "2025-01-07T12:50:26Z"
}
```

```json
{
  "type": "https://api.stayapi.com/errors/internal-error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An unexpected error occurred while processing the request.",
  "error_code": "CONFIGURATION_ERROR"
}
```
