# Trip.com Scraper (`dtrungtin/trip-com-scraper`) Actor

Extract structured product data from [Amazon.com](https://www.amazon.com) at scale. Provide one or more Amazon search or category URLs and this Actor will crawl through all result pages, visit each product listing, and return a clean dataset with prices, images, reviews, dimensions, and more.

- **URL**: https://apify.com/dtrungtin/trip-com-scraper.md
- **Developed by:** [Tin](https://apify.com/dtrungtin) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 94.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Hotels Scraper

### What does Trip.com Hotels Scraper do?

Trip.com Hotels Scraper extracts **all hotels from any [Trip.com](https://www.trip.com/hotels/) hotel search results page** — names, nightly and total prices, guest ratings, review counts, star ratings, room offers, locations, GPS coordinates and photos. Give it the URL of a Trip.com hotel list for your city and dates, and it automatically pages through the entire result set (thousands of properties per city).

Trip.com itself never serves more than ~1,100 results for a single search — and only a few hundred for filtered searches — no matter how far you scroll. Even a human visitor cannot view more than that window per query. The scraper maximizes coverage transparently: **oversized searches are automatically split into narrower price-range sub-searches and re-scraped under multiple sort orders** (using the site's own filter system). For very large cities, complete coverage of every listed property is still not guaranteed by a single city-wide URL — for maximum depth, add several narrower start URLs (e.g. one per district or star rating, configured on Trip.com and copied from the address bar).

Running it on the [Apify platform](https://apify.com) adds API access, scheduling, integrations (Google Sheets, webhooks, Zapier), automatic proxy rotation and run monitoring on top.

### Why use Trip.com Hotels Scraper?

- **Price monitoring** — track nightly and total prices for a whole city across dates and currencies.
- **Market research** — analyze hotel supply, star distribution, ratings and review volumes in any destination.
- **Competitor analysis** — see how properties position themselves: room types, discounts, promotional tags.
- **Travel planning tools** — feed structured hotel data (with coordinates for maps) into your own apps.

### How to use Trip.com Hotels Scraper

1. Open [Trip.com hotel search](https://www.trip.com/hotels/), pick your city, check-in/check-out dates, guests and any filters.
2. Copy the URL from the browser address bar (it looks like `https://www.trip.com/hotels/list?city=286&checkIn=2026-07-30&...`).
3. Paste it into the **Start URLs** field of the Actor input.
4. Optionally set **Max hotels** to limit the run (0 scrapes everything).
5. Click **Start** and download the results from the **Output** tab when the run finishes.

#### Free-text search URLs (no city ID)

A URL like `https://www.trip.com/hotels/list?searchWord=3-star hotels near Hanoi Old Quarter&adult=2` — the kind an AI agent typically composes — normally renders **0 properties** on Trip.com, because the site only resolves free text to a location through its search-suggestion service, which a hand-built URL skips. The scraper detects this and performs the resolution itself: the phrase above is rewritten into a Hanoi city search filtered to the Old Quarter area and 3-star properties. When Trip.com's suggestions cannot make sense of the text at all, the run logs a warning asking for a rephrased search or a copied URL with a city ID.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `startUrls` | array | Trip.com hotel list URLs (`https://www.trip.com/hotels/list?...`). City, dates, guests, currency and filters are all taken from the URL. Free-text `searchWord` URLs without a city ID are resolved automatically. |
| `maxItems` | integer | Maximum number of hotels to scrape across all URLs. `0` = all (default). |
| `maxPaginationRounds` | integer | Safety cap on infinite-scroll rounds per page (~12 hotels per round). `0` = unlimited (default). |
| `proxyConfiguration` | object | Proxy settings. **RESIDENTIAL proxies are strongly recommended** — Trip.com blocks datacenter IPs. |

```json
{
    "startUrls": [
        { "url": "https://www.trip.com/hotels/list?city=286&checkIn=2026-07-30&checkOut=2026-07-31&crn=1&adult=2&children=0&locale=en_xx" }
    ],
    "maxItems": 0,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

One dataset item per hotel. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
    "hotelId": 2843746,
    "name": "Hanoi Elpis Hotel",
    "url": "https://www.trip.com/hotels/detail/?cityId=286&hotelId=2843746&checkIn=2026-07-30&checkOut=2026-07-31...",
    "stars": 3,
    "starType": "star",
    "rating": 8.1,
    "ratingDescription": "Very good",
    "reviewCount": 149,
    "locations": ["Hồ Hoàn Kiếm Area", "Near Hanoi Old Quarter"],
    "highlights": ["Family room", "Spa", "Ideal location"],
    "tags": ["Limited Time Offer", "68% off"],
    "roomName": "Deluxe Double Room",
    "bedInfo": "1 queen bed",
    "price": 18,
    "originalPrice": 60,
    "totalPrice": 20,
    "currency": "USD",
    "category": "Hotel",
    "city": "Hanoi",
    "latitude": 21.033695,
    "longitude": 105.84736,
    "imageUrl": "https://ak-d.tripcdn.com/images/0220b120009tqriha68AD_R_600_600_R5_D.jpg_.webp",
    "checkIn": "2026-07-30",
    "checkOut": "2026-07-31",
    "adults": 2,
    "children": 0,
    "scrapedAt": "2026-07-30T14:50:34.328Z"
}
```

### Data fields

| Field | Description |
| --- | --- |
| `hotelId` | Trip.com hotel ID |
| `name` / `englishName` | Hotel name (localized / English) |
| `url` | Direct link to the hotel detail page with your dates pre-filled |
| `stars` / `starType` | Official class: 1–5, `star` (hotels) or `diamond` (apartments, homestays) |
| `rating` / `ratingDescription` / `reviewCount` | Guest score (0–10), verbal rating, number of reviews |
| `locations` / `highlights` / `tags` | Nearby landmarks, property highlights, promotional tags |
| `roomName` / `bedInfo` | Cheapest offered room and its bed configuration |
| `price` / `originalPrice` / `totalPrice` / `currency` | Nightly price, pre-discount price, total incl. taxes & fees |
| `category` / `city` / `latitude` / `longitude` | Property type and geolocation (from the list API; not available for the first ~12 server-rendered results) |
| `imageUrl` | Main photo |
| `checkIn` / `checkOut` / `adults` / `children` | Search parameters the prices refer to |

### How much does it cost to scrape Trip.com?

A run scrapes roughly **12 hotels per scroll round** and a full city (≈5,000 hotels) takes about 15–30 minutes on a single browser, which corresponds to roughly 0.5–1 compute units plus residential proxy traffic. Use `maxItems` to keep test runs small.

### Tips

- **Use RESIDENTIAL proxies.** Trip.com's anti-bot system ("whaleguard") blocks the hotel list API on datacenter IPs. The Actor detects this, logs a warning and retires the session, but only residential proxies give reliably complete results.
- **Hotel photos are not downloaded** — the scraper blocks photo requests to cut bandwidth and speed up runs. The `imageUrl` field still contains the photo URL (taken from Trip.com's list API); only the first ~12 server-rendered results of each sub-search may have `imageUrl: null`.
- **Duplicate-free by design.** Price-range sub-searches can overlap at band boundaries; the scraper deduplicates by hotel ID across the whole run. Properties without a bookable price for your dates may be missing from split (5,000+) searches, since they fall outside every price band.
- The **currency** of returned prices follows what Trip.com serves for your session/locale — set the `curr`/`barCurr` parameter in the start URL to influence it, and check the `currency` field in the output.
- Keep the `locale=en_xx` parameter in the URL; the scraper's block detection expects the English UI.
- One start URL = one search. To scrape multiple cities or date ranges, add multiple URLs.

### FAQ, disclaimers, and support

**Is it legal to scrape Trip.com?** This Actor extracts only publicly available data shown to any visitor. Always review Trip.com's Terms of Service and applicable law (e.g., GDPR for personal data — this Actor does not collect personal data) and consult your legal counsel before using scraped data commercially.

**The run finished with fewer hotels than expected.** Check the log for the "whaleguard" warning — it means the API was blocked mid-run. Re-run with RESIDENTIAL proxies.

Found a bug or missing a field? Please open an issue in the Actor's **Issues** tab — feedback is welcome. Custom modifications can be arranged on request.

# Actor input Schema

## `startUrls` (type: `array`):

Trip.com hotel list URLs to scrape (https://www.trip.com/hotels/list?...). Configure the city, check-in/check-out dates, guests and filters on Trip.com, then copy the URL from the address bar. URLs with only a free-text searchWord (no city ID), e.g. ?searchWord=3-star hotels near Hanoi Old Quarter, are resolved automatically via Trip.com's search suggestions.

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

Maximum number of hotels to scrape across all start URLs (0 = scrape all available).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.trip.com/hotels/list?city=286&provinceId=0&countryId=111&checkIn=2026-07-30&checkOut=2026-07-31&barCurr=VND&searchType=CT&crn=1&adult=2&children=0&travelPurpose=0&domestic=false&locale=en_xx"
    }
  ],
  "maxItems": 10
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.trip.com/hotels/list?city=286&provinceId=0&countryId=111&checkIn=2026-07-30&checkOut=2026-07-31&barCurr=VND&searchType=CT&crn=1&adult=2&children=0&travelPurpose=0&domestic=false&locale=en_xx"
        }
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("dtrungtin/trip-com-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 = {
    "startUrls": [{ "url": "https://www.trip.com/hotels/list?city=286&provinceId=0&countryId=111&checkIn=2026-07-30&checkOut=2026-07-31&barCurr=VND&searchType=CT&crn=1&adult=2&children=0&travelPurpose=0&domestic=false&locale=en_xx" }],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("dtrungtin/trip-com-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 '{
  "startUrls": [
    {
      "url": "https://www.trip.com/hotels/list?city=286&provinceId=0&countryId=111&checkIn=2026-07-30&checkOut=2026-07-31&barCurr=VND&searchType=CT&crn=1&adult=2&children=0&travelPurpose=0&domestic=false&locale=en_xx"
    }
  ],
  "maxItems": 10
}' |
apify call dtrungtin/trip-com-scraper --silent --output-dataset

```

## MCP server setup

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