# 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:** 58 total users, 11 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

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

## 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. Must not be in the past. Defaults to 7 days from today.

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

Check-out date in YYYY-MM-DD format. Must be after check-in date. 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
{
  "hotelUrls": [
    {
      "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
      "name": "JW Marriott Bangkok"
    }
  ],
  "checkinDate": "2026-10-01",
  "checkoutDate": "2026-10-02",
  "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 = {
    "hotelUrls": [
        {
            "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
            "name": "JW Marriott Bangkok"
        }
    ],
    "checkinDate": "2026-10-01",
    "checkoutDate": "2026-10-02",
    "rooms": 1,
    "adults": 2
};

// 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 = {
    "hotelUrls": [{
            "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
            "name": "JW Marriott Bangkok",
        }],
    "checkinDate": "2026-10-01",
    "checkoutDate": "2026-10-02",
    "rooms": 1,
    "adults": 2,
}

# 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(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 '{
  "hotelUrls": [
    {
      "url": "https://th.trip.com/hotels/bangkok-hotel-detail-1257190/jw-marriott-hotel-bangkok",
      "name": "JW Marriott Bangkok"
    }
  ],
  "checkinDate": "2026-10-01",
  "checkoutDate": "2026-10-02",
  "rooms": 1,
  "adults": 2
}' |
apify call datawebot/trip-hotel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datawebot/trip-hotel-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/mI186daZ0S5AtAIf7/builds/6D2l3MhaToO6Ggq5H/openapi.json
