# Trip.com Hotel & Room Scraper (`datawebot/trip-hotel-scraper`) Actor

Extract room listings and live prices from any Trip.com hotel page. Supports custom check-in/out dates, guest counts, and multiple hotels per run. Works with all Trip.com country subdomains (th, sg, id, etc.).

- **URL**: https://apify.com/datawebot/trip-hotel-scraper.md
- **Developed by:** [Datawebot](https://apify.com/datawebot) (community)
- **Categories:** Travel, Real estate
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 hotel scrapes

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Trip.com Hotel & Room Scraper

Extract room listings and live prices from any Trip.com hotel page. Supports custom check-in/out dates, guest counts, and multiple hotels per run. Works with all Trip.com country subdomains (th, sg, id, etc.).

---

### Features

- **Room names** — in the local language of the Trip.com subdomain (e.g. Thai on `th.trip.com`)
- **Prices** — both VAT-inclusive and VAT-exclusive (÷ 1.07 for Thailand)
- **Original / discounted prices** when a strikethrough price is shown
- **Room attributes** — bed type, max occupancy, breakfast inclusion, free cancellation, pay-later
- **Anti-detection** — randomised browser fingerprint (user-agent, WebGL, platform)
- **Supports any Trip.com country subdomain** — `th.trip.com`, `www.trip.com`, `sg.trip.com`, etc.

---

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `hotelUrls` | array | ✅ | List of `{url, name}` objects pointing to Trip.com hotel pages |
| `checkinDate` | string | | Check-in date `YYYY-MM-DD`. Default: 7 days from today |
| `checkoutDate` | string | | Check-out date `YYYY-MM-DD`. Default: check-in + 1 night |
| `rooms` | integer | | Number of rooms (1–10). Default: `1` |
| `adults` | integer | | Number of adults (1–10). Default: `2` |
| `children` | integer | | Number of children (0–6). Default: `0` |
| `proxyConfiguration` | object | | Apify proxy configuration (residential or datacenter) |
| `proxyUrl` | string | | Custom proxy URL, e.g. `http://user:pass@host:port` |
| `headless` | boolean | | Run browser without UI. Default: `true` |

#### Example input

```json
{
  "hotelUrls": [
    {
      "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
      "name": "JW Marriott Bangkok"
    },
    {
      "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1500545/marriott-hotel-sukhumvit-bangkok",
      "name": "Bangkok Marriott Sukhumvit"
    }
  ],
  "checkinDate": "2026-05-01",
  "checkoutDate": "2026-05-02",
  "rooms": 1,
  "adults": 2,
  "children": 0
}
````

***

### Output

Each item in the dataset represents one bookable room option.

| Field | Type | Description |
|---|---|---|
| `hotelName` | string | Hotel name as provided in input |
| `hotelUrl` | string | Hotel page URL (without query params) |
| `checkin` | string | Check-in date |
| `checkout` | string | Check-out date |
| `roomId` | string | Internal room ID from Trip.com |
| `roomName` | string | Room name |
| `roomType` | string | Room type category |
| `bedType` | string | Bed configuration |
| `maxOccupancy` | integer | Maximum number of guests |
| `priceInclVat` | float | Price including VAT (as displayed on Trip.com) |
| `priceExclVat` | float | Price excluding VAT (÷ 1.07) |
| `originalPriceInclVat` | float | Original (before discount) price including VAT |
| `originalPriceExclVat` | float | Original price excluding VAT |
| `breakfastIncluded` | boolean | Whether breakfast is included |
| `freeCancellation` | boolean | Whether free cancellation is available |
| `payLater` | boolean | Whether pay-at-hotel is available |

#### Example output item

```json
{
  "hotelName": "JW Marriott Bangkok",
  "hotelUrl": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
  "checkin": "2026-05-01",
  "checkout": "2026-05-02",
  "roomId": "1606182637",
  "roomName": "Deluxe King Room",
  "roomType": "Deluxe",
  "bedType": "King",
  "maxOccupancy": 2,
  "priceInclVat": 6900,
  "priceExclVat": 6448.60,
  "originalPriceInclVat": 0,
  "originalPriceExclVat": 0,
  "breakfastIncluded": false,
  "freeCancellation": false,
  "payLater": false
}
```

***

### How it works

1. Builds a full Trip.com hotel URL with check-in/out dates and guest counts
2. Launches a headless Chromium browser with anti-detection (randomised fingerprint)
3. Listens for two internal Trip.com APIs:
   - `getHotelRoomListOversea` — list of available rooms and prices
   - `getHotelRoomPopInfoPCOnline` — detailed room information (name, bed type, etc.)
4. Scrolls the page to trigger the API calls
5. Merges and parses the two responses into structured room records

***

### Proxy

Trip.com generally works without a proxy from Apify's servers. A proxy is only needed if you encounter IP blocks or CAPTCHAs at high scraping volumes.

- **Apify Proxy** (recommended if needed): enable via the `Proxy Configuration` input field — supports residential and datacenter proxies
- **Custom proxy**: provide a URL in the `Custom Proxy URL` field, e.g. `http://user:pass@proxy-host:port`

***

### Limits & notes

- One run per hotel page; each hotel takes ~20–40 seconds
- Prices reflect what Trip.com shows for the given dates, guest count, and currency of the subdomain
- Room names may appear in the local language depending on the Trip.com subdomain used
- The actor does **not** book rooms or submit any forms

***

### Version history

| Version | Date | Notes |
|---|---|---|
| 0.1 | 2026-04-02 | Initial release |

# Actor input Schema

## `hotelUrls` (type: `array`):

List of Trip.com hotel page URLs to scrape. Each item must be a JSON object with `url` and `name` fields.

Example:

```json
[
  {"url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok", "name": "JW Marriott Bangkok"}
]
```

## `checkinDate` (type: `string`):

Check-in date in YYYY-MM-DD format. Defaults to 7 days from today.

## `checkoutDate` (type: `string`):

Check-out date in YYYY-MM-DD format. Defaults to check-in + 1 night.

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

Number of rooms

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

Number of adults

## `children` (type: `integer`):

Number of children

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

Optional. Use Apify's built-in residential or datacenter proxies to avoid IP blocks. Recommended if you scrape many hotels or run into rate limits.

## `proxyUrl` (type: `string`):

Optional. Your own proxy URL, e.g. `http://user:pass@host:port`. Ignored if Apify Proxy Configuration is set.

## `headless` (type: `boolean`):

Run the browser without a visible UI. Disable only for local debugging.

## Actor input object example

```json
{
  "rooms": 1,
  "adults": 2,
  "children": 0,
  "headless": true
}
```

# Actor output Schema

## `rooms` (type: `string`):

Scraped room and pricing data from Trip.com

## `summary` (type: `string`):

Summary of the scraping run

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datawebot/trip-hotel-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("datawebot/trip-hotel-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call datawebot/trip-hotel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datawebot/trip-hotel-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

````json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Trip.com Hotel & Room Scraper",
        "description": "Extract room listings and live prices from any Trip.com hotel page. Supports custom check-in/out dates, guest counts, and multiple hotels per run. Works with all Trip.com country subdomains (th, sg, id, etc.).",
        "version": "0.1",
        "x-build-id": "APuPGvGJk5PS4Ru1n"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datawebot~trip-hotel-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datawebot-trip-hotel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datawebot~trip-hotel-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datawebot-trip-hotel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datawebot~trip-hotel-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datawebot-trip-hotel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "hotelUrls"
                ],
                "properties": {
                    "hotelUrls": {
                        "title": "Hotel URLs",
                        "type": "array",
                        "description": "List of Trip.com hotel page URLs to scrape. Each item must be a JSON object with `url` and `name` fields.\n\nExample:\n```json\n[\n  {\"url\": \"https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok\", \"name\": \"JW Marriott Bangkok\"}\n]\n```"
                    },
                    "checkinDate": {
                        "title": "Check-in Date",
                        "type": "string",
                        "description": "Check-in date in YYYY-MM-DD format. Defaults to 7 days from today."
                    },
                    "checkoutDate": {
                        "title": "Check-out Date",
                        "type": "string",
                        "description": "Check-out date in YYYY-MM-DD format. Defaults to check-in + 1 night."
                    },
                    "rooms": {
                        "title": "Rooms",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of rooms",
                        "default": 1
                    },
                    "adults": {
                        "title": "Adults",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of adults",
                        "default": 2
                    },
                    "children": {
                        "title": "Children",
                        "minimum": 0,
                        "maximum": 6,
                        "type": "integer",
                        "description": "Number of children",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Optional. Use Apify's built-in residential or datacenter proxies to avoid IP blocks. Recommended if you scrape many hotels or run into rate limits."
                    },
                    "proxyUrl": {
                        "title": "Custom Proxy URL",
                        "type": "string",
                        "description": "Optional. Your own proxy URL, e.g. `http://user:pass@host:port`. Ignored if Apify Proxy Configuration is set."
                    },
                    "headless": {
                        "title": "Headless Mode",
                        "type": "boolean",
                        "description": "Run the browser without a visible UI. Disable only for local debugging.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
````
