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

Standalone public-page Trip.com scraper with detailed structured live output.

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

## Pricing

from $2.49 / 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Trip.com Scraper

### Overview

Extract public Trip.com listing pages. This is a standalone Apify Actor for **Trip.com** with its own input schema, source adapter, dataset, run summary, diagnostics, and output files.

### Features

- Extracts publicly visible listing fields and structured page data.
- Opens detail pages when available to enrich title, price, address, features, media, and facts.
- Deduplicates records by source listing URL or identifier.
- Emits only source-backed live records with `dataOrigin: "live-page"`.
- Omits unknown values instead of inventing them or inserting JSON `null` values.
- Saves per-run status and access-block diagnostics in `storage/key_value_stores/default`.

### Default source URL

`https://www.trip.com/hotels/list?city=359`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | source default | Public search, listing, or detail URLs for this portal. |
| `maxItemsPerActor` | integer | 10 | Maximum detailed records. |
| `maxPagesPerActor` | integer | 2 | Maximum list/search pages. |
| `includeDetails` | boolean | true | Enrich records from detail pages. |
| `includeRawData` | boolean | true | Keep selected structured source data. |
| `proxyEnabled` | boolean | false | Use an authorized Apify or user-supplied proxy. |
| `maxRequestRetries` | integer | 3 | Bounded retry/backoff for transient failures. |

### Sample live output

```json
{
    "actorName": "trip-com-scraper",
    "sourcePortal": "Trip.com",
    "recordType": "accommodation",
    "listingId": "996749",
    "listingUrl": "https://www.trip.com/hotels/detail/?hotelId=996749",
    "title": "NASA BANGKOK - Airport Rail Link Ramkhamhang",
    "description": "With a stay at Nasa Bangkok in Bangkok (Ramkhamhaeng), you'll be a 4-minute drive from Rajamangala National Stadium and 7 minutes from Terminal 21 Shopping Mall. This 4-star hotel is 4.6 mi (7.4 km) from Pratunam Market and 5 mi (8.1 km) from Siam Paragon Mall. Make use of convenient amenities such as complimentary wireless Internet access, concierge services, and gift shops/newsstands. You can enjoy a meal at the restaurant serving the guests of Nasa Bangkok, or stop in at the grocery/convenience store. Featured amenities include complimentary wired Internet access, a 24-hour front desk, and luggage storage. Make yourself at home in one of the 460 air-conditioned rooms featuring refrigerators and LCD televisions. Complimentary wireless Internet access keeps you connected, and cable programming is available for your entertainment. Private bathrooms with shower/tub combinations feature complimentary toiletries and hair dryers. Conveniences include phones, as well as desks and complimentary bottled water.",
    "listingType": "stay",
    "propertyType": "accommodation",
    "price": {
        "display": "US$16",
        "value": 16,
        "currency": "USD",
        "period": "per night"
    },
    "address": {
        "full": "44 Sukhumvit 71 Rd, Suan Luang, Bangkok, 10250, Thailand",
        "locality": "Bangkok",
        "country": "Thailand",
        "latitude": 13.74299,
        "longitude": 100.601648
    },
    "features": {
        "yearBuilt": 2000
    },
    "photos": [
        "https://ak-d.tripcdn.com/images/1mc0t12000btgb5fd35A4_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc2g12000bs2xp1pB8A2_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc3q12000c93s84zAD71_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc1j12000bs32wcdDB2C_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc2x12000c3ktfqo6AE3_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc2312000c3kxbckA862_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc4f12000c93qes4D659_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc5g12000c3kxle4E226_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc5y12000c3kx3j434A1_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc1f12000c3kvp4yC437_R_960_660_R5_D.jpg",
        "https://ak-d.tripcdn.com/images/1mc0c12000c3kvjfk924D_R_960_660_R5_D.jpg"
    ],
    "amenities": [
        "Public parking",
        "Luggage storage",
        "Restaurant",
        "Cafe",
        "Conference room",
        "Wi-Fi in public areas"
    ],
    "facts": {
        "stars": 4,
        "reviewScore": "8",
        "reviewCount": 16489,
        "roomName": "Standard Double Or Twin Room",
        "checkIn": "20260910",
        "checkOut": "20260911",
        "priceExplanation": "Total (incl. taxes & fees): US$18",
        "bedTypes": [
            "1 double bed or 2 single beds"
        ],
        "highlights": [
            {
                "title": "Vintage vibes",
                "desc": "Key cards and 80s-90s style bathrooms add to the nostalgic, vintage atmosphere.",
                "tagId": "1315",
                "treeNodeId": "1315",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/115.png"
            },
            {
                "title": "Ideal location",
                "desc": "Close to the airport link station, offering convenient access to the airport and city center. 1,752 guests were happy with the property's location.",
                "tagId": "1701",
                "treeNodeId": "25919",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/25919.png"
            },
            {
                "title": "Delicious breakfast",
                "desc": "Enjoy a delicious breakfast that delights your taste buds. 81% of guests were especially impressed by the breakfast here.",
                "tagId": "1745",
                "treeNodeId": "4785",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/4785.png"
            },
            {
                "title": "Scenic restaurant",
                "tagId": "1625",
                "treeNodeId": "1625",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/28.png"
            },
            {
                "title": "Great views",
                "desc": "A unique view of the light rail passing by offers a pleasant and surprising experience.",
                "tagId": "643",
                "treeNodeId": "1271",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/116.png"
            },
            {
                "title": "Free parking",
                "desc": "Free parking is spacious, safe, and offers a very convenient experience.",
                "tagId": "80009001",
                "treeNodeId": "1152",
                "icon": "https://pages.c-ctrip.com/wireless-app/imgs/hotel_detail/new_short_icons/t_light/26.png"
            }
        ],
        "renovatedYear": "2022",
        "propertyLabels": [
            "Opened: 2000",
            "Renovated: 2022",
            "Number of Rooms: 460"
        ],
        "policies": {
            "checkInAndOut": {
                "title": "Check-in and Check-out Times",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-ruli.png",
                "boldIcon": "timeoutlined",
                "content": [
                    {
                        "title": "Check-in: ",
                        "description": "14:00–24:00"
                    },
                    {
                        "title": "Check-out: ",
                        "description": "Before 12:00"
                    },
                    {
                        "description": "Front desk hours: 24/7"
                    },
                    {
                        "description": "The host or staff will greet you upon arrival"
                    }
                ]
            },
            "childPolicy": {
                "title": "Child policies",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-children.png",
                "boldIcon": "boldChild",
                "content": [
                    {
                        "description": "Children of all ages are welcome at this property.",
                        "type": 2
                    },
                    {
                        "description": "Additional fees may be charged for children using existing beds. Add the number of children to get a more accurate price.",
                        "type": 2
                    },
                    {
                        "extentions": [
                            {
                                "key": "childrenTipPopLayer",
                                "value": "Occupancy: 2 adults"
                            },
                            {
                                "key": "childrenTipPopLayerButton",
                                "value": "Add Your Child"
                            }
                        ],
                        "type": 2
                    }
                ]
            },
            "cribAndExtraBed": {
                "title": "Cribs and Extra Beds",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-children.png",
                "boldIcon": "boldBed",
                "content": [
                    {
                        "description": "For all room types, cribs cannot be added. Extra bed policies vary according to room type. Please refer to the relevant room type policy.",
                        "boldContent": "For all room types, cribs cannot be added. Extra bed policies vary according to room type. Please refer to the relevant room type policy.",
                        "type": 2
                    }
                ]
            },
            "breakfast": {
                "title": "Breakfast",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-breakfast.png",
                "boldIcon": "boldMeals",
                "content": [
                    {
                        "description": "Option: Set menu",
                        "type": 2
                    },
                    {
                        "description": "Cuisine: Western, Local cuisine",
                        "type": 2
                    },
                    {
                        "tab": {
                            "headers": [
                                "Age",
                                "Fee"
                            ],
                            "tableItems": [
                                {
                                    "tableDetails": [
                                        {
                                            "content": "Children 17 years old and under",
                                            "bold": "Children 17 years old and under"
                                        },
                                        {
                                            "content": "THB 190.00 (approx. US$5.76) per person"
                                        }
                                    ]
                                },
                                {
                                    "tableDetails": [
                                        {
                                            "content": "Adult",
                                            "bold": "Adult"
                                        },
                                        {
                                            "content": "THB 190.00 (approx. US$5.76) per person"
                                        }
                                    ]
                                }
                            ]
                        },
                        "type": 2
                    },
                    {
                        "description": "Contact the property to see if extra breakfast is available. If so, you can pay for it at the property.",
                        "type": 2
                    }
                ]
            },
            "deposit": {
                "title": "Deposit Policy",
                "icon": "https://pages.c-ctrip.com/wireless-app/icons/icon-df-chargesnotes.png",
                "boldIcon": "bankcard",
                "content": [
                    {
                        "title": "Deposit",
                        "description": "Deposit required"
                    },
                    {
                        "title": "Deposit Collection Methods",
                        "description": "A fixed amount of THB 500.00 (approx. US$15.15) is charged."
                    },
                    {
                        "title": "Deposit Payment Methods",
                        "description": "This property accepts cash"
                    },
                    {
                        "title": "Deposit Refund",
                        "description": "The deposit will be returned to the original account of payment on the day of check-out."
                    }
                ]
            },
            "pet": {
                "title": "Pets",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-pets.png",
                "boldIcon": "boldPet",
                "content": [
                    {
                        "description": "Pets are not allowed"
                    }
                ]
            },
            "serviceAnimal": {
                "title": "Service animals",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-pets.png",
                "boldIcon": "boldPet",
                "content": [
                    {
                        "description": "Service animals are not allowed"
                    }
                ]
            },
            "ageLimit": {
                "title": "Age Requirements",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-age.png",
                "boldIcon": "calendar",
                "content": [
                    {
                        "description": "The guest checking in must be between 18–65 years old."
                    }
                ]
            },
            "credit": {
                "title": "Paying at the hotel",
                "icon": "https://pages.c-ctrip.com/hotel_h5/rn/img/icon-df-pay.png",
                "boldIcon": "bankcard",
                "supportItems": [
                    {
                        "url": "https://ak-d.tripcdn.com/images/1p10q12000bwovk0y2B27.png"
                    },
                    {
                        "url": "https://ak-d.tripcdn.com/images/1p16412000bwovxdw8716.png"
                    },
                    {
                        "url": "https://ak-d.tripcdn.com/images/1p16912000bwovmkhE799.png"
                    },
                    {
                        "url": "https://ak-d.tripcdn.com/images/1p11q12000bwovxei16BB.png"
                    }
                ],
                "cashType": 1,
                "cashDesc": "Cash"
            },
            "recommendKeys": [
                "checkInAndOut",
                "childPolicy",
                "cribAndExtraBed"
            ],
            "japanSpaHotelPolicyInfo": {
                "guestInfo": {
                    "ageLimit": "The guest checking in must be between 18–65 years old."
                }
            }
        },
        "scoreBreakdown": [
            {
                "showName": "Cleanliness",
                "showScore": "7.8",
                "showType": "Cleanliness"
            },
            {
                "showName": "Amenities",
                "showScore": "7.3",
                "showType": "Amenities"
            },
            {
                "showName": "Location",
                "showScore": "8.8",
                "showType": "Location"
            },
            {
                "showName": "Service",
                "showScore": "8.0",
                "showType": "Service"
            }
        ]
    },
    "missingFields": [
        "bedrooms",
        "bathrooms",
        "area",
        "agent"
    ],
    "scrapedAt": "2026-09-10T13:10:55.092Z",
    "dataOrigin": "live-page"
}
```

### Local development

Run this folder as its own Actor:

```bash
apify run --input-file storage/key_value_stores/default/INPUT.json
```

Validate the Actor contract and stored live records:

```bash
apify validate-schema
node dataset-validator.js
```

### Access and compliance

If the source portal returns a challenge or access denial, the Actor records diagnostics and omits that page rather than fabricating output. Use only public pages and an authorized purpose. Proxy access can incur account costs and does not authorize bypassing CAPTCHA, authentication, robots directives, or other access controls.

### Output files

- `.actor`: Actor metadata and schemas.
- `src`: This portal's standalone adapter and shared extraction runtime.
- `storage/datasets/default`: Apify-style local result records.
- `storage/key_value_stores/default/RUN_SUMMARY.json`: run result and diagnostics summary.
- `output/dataset.json` and `output/dataset.jsonl`: exported live-only result files.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapeai/trip-com-scraper/changelog.md

# Actor input Schema

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

Public Trip.com search, listing, or detail URLs.

## `query` (type: `string`):

Optional query metadata passed to adapters. Use explicit public startUrls when the portal requires a concrete route or search identifier.

## `location` (type: `string`):

Optional city, postcode, state, country, or neighbourhood.

## `listingType` (type: `string`):

Preferred transaction or accommodation mode where supported.

## `propertyType` (type: `string`):

Optional portal-specific property type filter.

## `maxItemsPerActor` (type: `integer`):

Maximum detailed records emitted by each selected adapter.

## `maxPagesPerActor` (type: `integer`):

Maximum search/list pages followed per actor.

## `includeDetails` (type: `boolean`):

Open each listing detail page to enrich the output.

## `includeRawData` (type: `boolean`):

Keep selected JSON-LD, metadata, card data, and JSON responses under rawData.

## `scrollCount` (type: `integer`):

Number of incremental scrolls used for lazy-loaded results.

## `requestTimeoutSecs` (type: `integer`):

Maximum seconds allowed for one page.

## `maxConcurrency` (type: `integer`):

Concurrent browser pages. Keep low for public portals.

## `maxRequestRetries` (type: `integer`):

Retries for transient HTTP blocks and navigation failures. Retries use session rotation and backoff.

## `sameDomainDelaySecs` (type: `integer`):

Minimum delay between requests to the same portal, in seconds.

## `proxyEnabled` (type: `boolean`):

Use an authorized Apify or user-supplied proxy route when available. This does not bypass access controls and may incur proxy costs.

## `proxyUrls` (type: `array`):

Optional custom proxy URLs (http://user:pass@host:port) to route requests through.

## `serpApiKey` (type: `string`):

Optional SerpApi API key used as fallback data provider when portals are blocked.

## `captchaApiKey` (type: `string`):

Optional CapSolver, 2Captcha, or Anti-Captcha API key to automatically solve challenge pages.

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

Run Chromium without a visible window.

## `testMode` (type: `boolean`):

Run an offline fixture smoke test for every selected adapter instead of visiting websites.

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

Optional Apify proxy configuration used when proxyEnabled is true.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.trip.com/hotels/list?city=359"
    }
  ],
  "query": "",
  "location": "",
  "listingType": "sale",
  "propertyType": "",
  "maxItemsPerActor": 10,
  "maxPagesPerActor": 2,
  "includeDetails": true,
  "includeRawData": true,
  "scrollCount": 3,
  "requestTimeoutSecs": 45,
  "maxConcurrency": 2,
  "maxRequestRetries": 3,
  "sameDomainDelaySecs": 3,
  "proxyEnabled": false,
  "proxyUrls": [],
  "serpApiKey": "",
  "captchaApiKey": "",
  "headless": true,
  "testMode": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Detailed, non-null records from every selected adapter.

## `files` (type: `string`):

Run summary, per-actor counters, and blocked-page diagnostics.

# 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("scrapeai/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/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 '{}' |
apify call scrapeai/trip-com-scraper --silent --output-dataset

```

## MCP server setup

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