# Expedia Hotel Search Scraper (`scrapeai/expedia-search-scraper`) Actor

Scrapes hotel search results from Expedia.com. Extracts name, price, rating, stars, location, amenities, and more.

- **URL**: https://apify.com/scrapeai/expedia-search-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Expedia Hotel Search Scraper

High-performance, production-grade **Expedia Hotel Search Scraper** built on Apify SDK and Playwright. Extracts live, dynamic hotel listings and deep property details with rich pricing, guest ratings, star classifications, addresses, coordinates, room types, policies, amenities, and high-resolution photo galleries.

***

### 🌟 Key Capabilities

- 🚀 **Multi-Layer Live Extraction Pipeline**:
  - **Layer 1: Live Network API Interception** — Intercepts and queries live Expedia / Hotels.com Autosuggest & Lodging Network APIs dynamically based on user input.
  - **Layer 2: Network & GraphQL Interception** — Intercepts live `LodgingSearchQuery`, `PropertySearchQuery`, and REST payloads asynchronously.
  - **Layer 3: Embedded State & JSON-LD** — Extracts pre-rendered `__NEXT_DATA__`, `__APOLLO_STATE__`, and Schema.org `Hotel` JSON-LD structures.
  - **Layer 4: Resilient Multi-Pattern DOM UI Scraping** — Full coverage of modern card layouts, badges, and responsive UI components.
- 🎯 **Strict Pagination & Execution Limit Control**:
  - Dynamically enforces user-defined `maxItems` limits with hard stop conditions.
  - Progressive infinite scroll and dynamic DOM height hydration.
  - Automatic detection and triggering of "Show more results" AJAX pagination.
- 🛡️ **Anti-Bot & Verification Bypass**:
  - Built-in DataDome interactive slider solving with human-like mouse trajectory emulation.
  - Browser fingerprint randomization with realistic viewport, user-agent, and header rotation.
  - Native support for Apify Residential and custom proxy configurations.
- 📊 **Zero-Null Data Enrichment**:
  - Normalizes and enriches missing fields from fallback layers to ensure the richest live output.

***

### 📥 Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `destination` | String | ✅ **Yes** | `"New York City"` | City, region, landmark, or hotel name to search. |
| `checkIn` | String | No | — | Check-in date in `YYYY-MM-DD` format. |
| `checkOut` | String | No | — | Check-out date in `YYYY-MM-DD` format. |
| `adults` | Integer | No | `2` | Number of adult guests (1–8). |
| `rooms` | Integer | No | `1` | Number of rooms (1–8). |
| `sortBy` | String | No | `"recommended"` | Sort order: `recommended`, `price_low_to_high`, `price_high_to_low`, `star_rating_desc`, `review_score_desc`. |
| `maxItems` | Integer | No | `25` | Maximum number of hotel listings to extract (1–300). |
| `scrapeDetails` | Boolean | No | `false` | When `true`, opens each hotel page in parallel to extract detailed descriptions, room categories, check-in/out times, and full photo galleries. |
| `proxyConfiguration` | Object | No | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` | Proxy settings. Residential proxies are strongly recommended. |

#### Example Input (`INPUT.json`)

```json
{
  "destination": "Paris",
  "checkIn": "2026-09-10",
  "checkOut": "2026-09-15",
  "adults": 2,
  "rooms": 1,
  "sortBy": "recommended",
  "maxItems": 50,
  "scrapeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

***

### 📤 Output Format

Each hotel is saved directly to the default Apify Dataset as a clean, structured JSON record.

#### Example Output Record

```json
{
  "rank": 1,
  "hotelId": "6206679",
  "name": "Hotel Le Meurice Dorchester Collection",
  "stars": 5,
  "rating": 9.4,
  "ratingText": "Exceptional",
  "reviewCount": "2,847 reviews",
  "price": "$620 nightly",
  "pricePerNight": "$620",
  "totalPrice": "$3,100 total",
  "originalPrice": "$780",
  "discount": "20% off",
  "currency": "USD",
  "neighborhood": "1st arrondissement",
  "address": "228 Rue de Rivoli, Paris, 75001",
  "distanceFromCenter": "0.2 km from city center",
  "latitude": 48.8651,
  "longitude": 2.3297,
  "badge": "VIP Access",
  "freeCancellation": true,
  "freeCancellationDate": "Free cancellation before Sep 8",
  "breakfastIncluded": true,
  "reserveNowPayLater": true,
  "amenities": [
    "Free WiFi",
    "Spa and wellness center",
    "Michelin-star Restaurant",
    "Fitness Center",
    "Bar & Lounge",
    "Pet friendly",
    "Room service"
  ],
  "thumbnail": "https://images.trvl-media.com/lodging/7000000/6200000/6206700/6206679/d1e2f3.jpg",
  "images": [
    "https://images.trvl-media.com/lodging/7000000/6200000/6206700/6206679/d1e2f3.jpg",
    "https://images.trvl-media.com/lodging/7000000/6200000/6206700/6206679/a4b5c6.jpg"
  ],
  "url": "https://www.expedia.com/Paris-Hotels-Hotel-Le-Meurice.h6206679.Hotel-Information",
  "description": "An iconic Parisian palace hotel blending 18th-century opulence with contemporary design.",
  "checkInTime": "3:00 PM",
  "checkOutTime": "12:00 PM",
  "roomTypes": [
    "Classic Room",
    "Deluxe Room with Tuileries Garden View",
    "Prestige Suite"
  ],
  "destination": "Paris",
  "checkIn": "2026-09-10",
  "checkOut": "2026-09-15",
  "adults": 2,
  "rooms": 1,
  "sortBy": "recommended",
  "scrapedAt": "2026-08-21T12:00:00.000Z"
}
```

***

### ⚡ Local Development & Execution

1. **Install Dependencies**:
   ```bash
   npm install
   ```

2. **Run Locally**:
   ```bash
   npm start
   ```

3. **Validate Dataset Schema**:
   ```bash
   npm run validate-datasets
   ```

***

### 🚀 Running on Apify

1. Deploy or import this actor to your Apify account:
   ```bash
   apify push
   ```
2. Configure search destination, dates, guests, and limit in the Apify Console.
3. Enable **Apify Residential Proxies** for maximum reliability against bot detection.
4. Click **Start** to run the Actor and download the dataset in JSON, CSV, Excel, or XML.

# Actor input Schema

## `destination` (type: `string`):

The destination to search hotels in (e.g. 'New York City', 'Paris', 'Tokyo').

## `checkIn` (type: `string`):

Check-in date in YYYY-MM-DD format. Leave empty for flexible dates.

## `checkOut` (type: `string`):

Check-out date in YYYY-MM-DD format. Leave empty for flexible dates.

## `adults` (type: `integer`):

Number of adult guests.

## `rooms` (type: `integer`):

Number of rooms.

## `sortBy` (type: `string`):

How to sort hotel results.

## `maxItems` (type: `integer`):

Maximum number of hotels to scrape.

## `domain` (type: `string`):

Expedia Group portal to search. (e.g. www.expedia.com or www.hotels.com)

## `proxyConfiguration` (type: `object`):

Proxy settings. Residential proxies strongly recommended for Cloudflare bypass.

## Actor input object example

```json
{
  "destination": "New York City",
  "checkIn": "2025-07-01",
  "checkOut": "2025-07-05",
  "adults": 2,
  "rooms": 1,
  "sortBy": "recommended",
  "maxItems": 25,
  "domain": "www.expedia.com",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped Expedia hotel search listings and details

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "destination": "New York City",
    "checkIn": "",
    "checkOut": "",
    "maxItems": 25,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/expedia-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "destination": "New York City",
    "checkIn": "",
    "checkOut": "",
    "maxItems": 25,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/expedia-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "destination": "New York City",
  "checkIn": "",
  "checkOut": "",
  "maxItems": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scrapeai/expedia-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapeai/expedia-search-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ABynpku6ETZTdMGU6/builds/dEhMRmmwqFld4v1dy/openapi.json
