# Trip.com & Ctrip Scraper - Hotels, Prices & Reviews 携程 (`memo23/trip-com-scraper`) Actor

Scrape Trip.com and Ctrip (携程) hotels and guest reviews. Hotels: price and total incl. taxes, star, score, coordinates. Reviews: sub-ratings, photos, original and translated text, hotel replies. No login. Hotels $2.5-4.5, reviews $1.5-3.5 per 1,000 by plan.

- **URL**: https://apify.com/memo23/trip-com-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Travel, AI, Automation
- **Features:** Limited permissions
- **Stats:** 44 total users, 5 monthly users, 96.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 hotels

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Hotels Scraper 🏨

**Scrape hotels and guest reviews from [Trip.com](https://www.trip.com).** Search a city by dates to pull matching hotels — name, star rating, guest score, price (with total incl. taxes), coordinates and more — or point it at a hotel to pull **every guest review** with ratings, sub-ratings, trip type, room and the hotel's reply. No login or API key needed. JSON or CSV.

![How the Trip.com Hotels Scraper works](https://raw.githubusercontent.com/muhamed-didovic/muhamed-didovic.github.io/main/assets/how-it-works-tripcom.png)

### ✨ Why use this scraper

- **Two verticals in one actor.** Scrape **hotels** (search a city + dates) *and* **reviews** (per hotel) — most scrapers do only one.
- **Many hotels per run.** Pass a whole list of hotels and get one dataset back — no re-running the actor once per property.
- **The deepest hotel schema — up to 60 fields.** Name, star rating, guest score + review count, **nightly price and total incl. taxes**, discount strike-price, coordinates, address, city, category, images, tags and Trip.com rankings.
- **Full reviews with sub-ratings.** Every review carries the text, overall rating **and** sub-ratings (location / service / room / facility), trip type, room, check-in date, language, helpful-count, photos, **video** — and **the hotel's reply** with its date and language.
- **Original *and* translated text.** Non-English reviews come with Trip.com's machine translation alongside the original, so a mixed-language property is analysable as one set.
- **Cheap scheduled monitoring.** Set `cutoffDate` and re-runs stop the moment they reach reviews you already have, instead of re-walking the hotel's whole history.
- **Filter before you pay.** Narrow by date range, rating band, language, or reviews-with-media — filtered-out reviews are never charged.
- **Real prices, real totals.** Both the nightly rate and the all-in total (incl. taxes & fees), plus discounts — as Trip.com actually shows them.
- **No login or API key.** Fast, cheap and reliable; failed requests are retried automatically.
- **Flat, spreadsheet-ready rows.** One row per hotel or per review. Open the CSV and filter.

### 🔁 Coming from another Trip.com scraper?

The things people most often ask other Trip.com/Ctrip scrapers to add are already in every row here:

| What you may be missing | Field in this actor |
|---|---|
| **Hotel ID on each review** | `hotelId` (plus `hotelUrl`) |
| **Aggregated hotel scores**, not just per-review ratings | `hotelRatingOverall` + `hotelRatingLocation` / `Service` / `Room` / `Facility`, `hotelReviewCount` |
| **Review language** | `language` (and `contentTranslated` when Trip.com has a translation) |
| **Room name and traveller type** | `roomName`, `travelType` |
| **Many hotels in one run** | `hotelUrls` / `hotelIds` take lists — each hotel keeps its own reviews and its own aggregate scores |

Every field above is populated on real output, not aspirational — run the reviews example below and check for yourself.

### 🎯 Use cases

| You are… | Use it to… |
|---|---|
| **Revenue / OTA analyst** | Track hotel prices (incl. taxes) and availability across a city over time. |
| **Hotel / brand** | Monitor competitors' scores, rankings and guest sentiment (reviews mode). |
| **Reputation / CX team** | Pull every review for a property with sub-ratings and trip type for analysis. |
| **Travel app / aggregator** | Feed structured hotel + review data into your own product. |
| **Researcher** | Build a dataset of hotel pricing, quality and guest feedback by market. |

### 📥 Supported inputs

| Mode | Input | Output |
|---|---|---|
| **Hotels — city** | `cityId: "338"` + `checkIn` / `checkOut` | Matching hotels for that city + dates |
| **Hotels — URL** | `searchUrls: ["https://www.trip.com/hotels/list?city=338&checkin=…"]` | Hotels for that pasted list URL |
| **Reviews** | `hotelUrls: ["https://www.trip.com/hotels/detail/?hotelId=2194717"]` (or `hotelIds`) | Every guest review for each hotel |

The **city ID** is the `city=` value in any Trip.com hotel list URL (e.g. `338` = London). Pass as many hotel URLs or IDs as you like in a single run.

**Ctrip (携程):** Ctrip hotel URLs and IDs are accepted and work for any property that Trip.com also lists — the two sites share a master hotel ID for those. A Ctrip-only property returns no reviews.

**Not supported:** booking, member-only prices, or anything behind a Trip.com login.

### 🔄 How it works

1. **Hotels** — for each city/URL the actor collects every hotel Trip.com lists and pages through the results, flattening each hotel to one row.
2. **Reviews** — for each hotel it collects guest reviews up to the full review count shown on Trip.com.
3. **Emit** — hotels are de-duplicated by hotel ID, reviews by review ID; everything is pushed as flat rows, ready for JSON or CSV.

### ⚙️ Input parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `cityId` | string | — | Trip.com city ID (the `city=` value in a list URL). |
| `checkIn` / `checkOut` | string | ~30 days out, 1 night | Dates, `YYYY-MM-DD`. Leave empty to default to ~30 days from today; past dates are bumped forward automatically. |
| `adults` / `rooms` | integer | 2 / 1 | Occupancy. |
| `currency` | string | `USD` | Price currency. |
| `searchUrls` | array | — | Paste Trip.com hotel list URLs (alternative to city + dates). |
| `hotelUrls` | array | — | Hotel detail URLs (Trip.com or Ctrip) → scrape their **reviews**. |
| `hotelIds` | array | — | Hotel IDs → scrape their **reviews**. |
| `maxReviewsPerHotel` | integer | 100 | Cap on reviews per hotel (reviews mode). |
| `sortBy` | string | `mostRelevant` | `mostRelevant`, `mostRecent`, `ratingHighToLow`, `ratingLowToHigh`. |
| `cutoffDate` | string | — | Keep only reviews **after** this day (`YYYY-MM-DD`). Forces newest-first and stops early. |
| `reviewsFromDate` / `reviewsToDate` | string | — | Keep reviews inside this day range (`YYYY-MM-DD`, inclusive). |
| `minRating` / `maxRating` | integer | — | Keep reviews inside this rating band (Trip.com's 0-10 scale). |
| `reviewLanguages` | array | — | Keep only these language codes, e.g. `["en","zh"]`. |
| `onlyWithMedia` | boolean | `false` | Skip text-only reviews. |
| `maxItems` | integer | 200 | Max rows per run. Free-tier capped at 100. |
| `maxConcurrency` | integer | 6 | Parallel fetches. |
| `proxy` | object | Residential | Residential recommended. The default works out of the box. |

#### Example — hotels

```json
{ "cityId": "338", "checkIn": "2026-07-20", "checkOut": "2026-07-21", "maxItems": 100 }
```

#### Example — reviews, several hotels at once

```json
{
  "hotelIds": ["2194717", "346403", "704886"],
  "maxReviewsPerHotel": 200,
  "sortBy": "mostRecent"
}
```

#### Example — incremental monitoring (run it on a schedule)

```json
{ "hotelIds": ["346403"], "cutoffDate": "2026-07-20", "maxReviewsPerHotel": 500 }
```

Only reviews posted after 20 July come back, and pagination stops at the first older one — so a daily run costs a page or two instead of the property's entire history.

#### Example — mine the complaints

```json
{ "hotelIds": ["346403"], "maxRating": 6, "reviewLanguages": ["en"], "maxReviewsPerHotel": 300 }
```

### 📊 Output overview

Two row shapes share one dataset. **Hotel** rows (hotels mode) carry the property, pricing and location; **review** rows (reviews mode) carry one guest review each. Prices come both as the nightly rate and the all-in total incl. taxes, exactly as Trip.com displays them.

### 📦 Output samples

**Hotel row:**

```json
{
  "hotelId": "2194717",
  "name": "The Dorchester",
  "url": "https://www.trip.com/hotels/detail/?hotelId=2194717",
  "starRating": 5,
  "guestScore": 9.8,
  "scoreDescription": "Outstanding",
  "reviewCount": 95,
  "price": 1690,
  "displayPrice": "US$1,690",
  "totalPrice": "Total (incl. taxes & fees): US$2,028",
  "cityName": "London",
  "address": "Mayfair",
  "latitude": 51.507018,
  "longitude": -0.152243,
  "category": "Hotel",
  "rankLabel": "2026 Global 100 - Luxury Hotels",
  "imageCount": 6,
  "source": "search"
}
```

**Review row:**

```json
{
  "reviewId": "1784337459",
  "hotelId": "2194717",
  "hotelUrl": "https://www.trip.com/hotels/detail/?hotelId=2194717",
  "content": "入住期間有問題諮詢前台，工作人員耐心細緻講解…",
  "contentTranslated": "During my stay, I had some questions and the front desk staff were incredibly patient…",
  "translatedLanguage": "en",
  "translationSource": "Translation provided by AI",
  "rating": 10,
  "ratingScale": 10,
  "ratingLevel": "Outstanding",
  "ratingLocation": 10,
  "ratingService": 10,
  "ratingRoom": 10,
  "ratingFacility": 10,
  "reviewerName": "Unterwegszailushang",
  "reviewerRegion": "China",
  "reviewerRegionCode": "CN",
  "reviewerLevel": "Review Expert",
  "reviewerReviewCount": 41,
  "travelType": "Business traveler",
  "roomName": "Superior Room",
  "createDate": "2025-12-16 23:10:22",
  "checkinDate": "2025-12-01 00:00:00",
  "language": "zh",
  "usefulCount": 0,
  "reviewSource": "ctrip",
  "imageUrls": ["https://ak-d.tripcdn.com/images/0232p12000ta6blfsF926_W_1280_853_R5_Q70.jpg"],
  "videoUrls": ["https://video.c-ctrip.com/videos/230bcn14x99lg9cocA694.mp4"],
  "videoCoverUrls": ["https://ak-d.tripcdn.com/images/0200l12000srmwzsg705C_W_350_350_R5_Q70.jpg"],
  "hotelReply": "下次回上海，會再次入住金茂全景房…",
  "hotelReplyTranslated": "Next time I return to Shanghai, I will stay in the Jinmao Panoramic Room…",
  "hotelReplyDate": "2026-02-08 00:00:00",
  "hotelReplyLanguage": "zh",
  "hotelRatingOverall": 9.4,
  "hotelRatingLocation": 9.5,
  "hotelRatingService": 9.3,
  "hotelRatingRoom": 9.5,
  "hotelRatingFacility": 9.2,
  "hotelReviewCount": 18439,
  "source": "review"
}
```

### 🗂 Key output fields

| Field | Meaning |
|---|---|
| `name` / `starRating` / `guestScore` / `reviewCount` | Hotel name, official stars, guest score and how many reviews. |
| `price` / `displayPrice` / `totalPrice` / `strikePrice` | Nightly price, as displayed, the all-in total incl. taxes, and any pre-discount price. |
| `latitude` / `longitude` / `address` / `cityName` | Where the hotel is. |
| `category` / `rankLabel` / `tags` | Property type, Trip.com ranking, highlights. |
| `content` / `rating` / `ratingScale` / `ratingLevel` | *(review)* The review text, overall score, the top of the scale, and the label. |
| `contentTranslated` / `translatedLanguage` / `translationSource` | *(review)* Trip.com's machine translation of a non-English review, and its attribution. |
| `ratingLocation` / `ratingService` / `ratingRoom` / `ratingFacility` | *(review)* Sub-ratings. |
| `travelType` / `roomName` / `checkinDate` | *(review)* Trip type, room stayed in, stay date. |
| `reviewerName` / `reviewerRegion` / `reviewerLevel` / `reviewerReviewCount` | *(review)* Who wrote it — country, Trip.com tier, how prolific. |
| `imageUrls` / `videoUrls` / `videoCoverUrls` | *(review)* Full-size review photos, video files and their poster frames. |
| `hotelReply` / `hotelReplyTranslated` / `hotelReplyDate` / `hotelReplyLanguage` | *(review)* The hotel's response and its translation, when it came and in what language. |
| `hotelRatingOverall` + `hotelRating*` / `hotelReviewCount` | *(review)* The property's aggregate scores, repeated on every row so a CSV stands alone. |
| `usefulCount` / `reviewSource` | *(review)* Helpful votes, and which site the review came from. |

### ❓ FAQ

**Do I need a Trip.com account or API key?**
No — no login and nothing to supply. The actor reads public data only.

**Where do I find the city ID?**
Open a hotel search on Trip.com and copy the `city=` value from the URL (e.g. `.../hotels/list?city=338` → `338`).

**How many hotels does a city search return?**
The top hotels for that city and dates (ranked as Trip.com ranks them), each with the full field set. For a specific hotel's complete data, use reviews mode with its URL.

**How many reviews can I get per hotel?**
Up to the hotel's full review count — paginated automatically. Cap it with `maxReviewsPerHotel`.

**Can I scrape several hotels in one run?**
Yes. `hotelUrls` and `hotelIds` both take lists, and the hotels are fetched in parallel into a single dataset.

**How do I keep a scheduled run cheap?**
Set `cutoffDate` to the last day you scraped. The run switches to newest-first and stops at the first review older than that day, so it reads a page or two rather than the whole history. Filtered-out reviews are never charged.

**Are non-English reviews translated?**
Trip.com machine-translates reviews on its side and the actor passes that through as `contentTranslated` — and the hotel's reply as `hotelReplyTranslated`. Coverage is high for established reviews but the newest ones can arrive before Trip.com has translated them — in that case `content` is populated and `contentTranslated` is `null`. Sorting by `mostRelevant` gives the best translation coverage.

**Does it work with Ctrip (携程)?**
Yes for any hotel listed on both sites — paste the Ctrip URL or ID and it resolves to the same property. A Ctrip-exclusive hotel isn't in Trip.com's index and returns nothing.

**Can I filter by rating or language?**
Yes — `minRating` / `maxRating`, `reviewLanguages`, `onlyWithMedia` and the date range. Trip.com doesn't offer these as filters, so the actor applies them as it reads; a narrow historical window means paging back to reach it.

**Why is `price` sometimes null?**
Some listings show no bookable rate for the given dates; `displayPrice` reflects what Trip.com returns.

**How fresh is the data?**
Live — each run hits the current listings and reviews.

### 💬 Support

Found a bug or need an extra field? Open an issue on the actor's **Issues** tab and we'll take a look.

### 🛠 Additional services

Need scheduled runs, another travel site, or a custom feed? Reach out via the Apify contact form on the actor page.

### 🔎 Explore more scrapers

More travel and hospitality scrapers from the same developer, so you can cover every booking platform with one consistent output style:

- [Expedia + Hotels.com Reviews](https://apify.com/memo23/expedia-scraper): guest reviews from Expedia hotels, Expedia activities and Hotels.com in one actor
- [VRBO Scraper](https://apify.com/memo23/vrbo-scraper): vacation-rental properties, availability calendar and full reviews
- [Airbnb Scraper](https://apify.com/memo23/airbnb-scraper): listings with prices, reviews, calendar and revenue estimates
- [Booking.com Hotel Scraper](https://apify.com/memo23/booking-scraper): hotel ratings, review counts and prices
- [Agoda Hotel Scraper](https://apify.com/memo23/agoda-scraper): hotel listings and prices
- [Hotels.com Reviews](https://apify.com/memo23/hotels-scraper): guest feedback and sentiment for Hotels.com properties
- [TripAdvisor Scraper](https://apify.com/memo23/tripadvisor-scraper): hotels, restaurants and reviews
- [Google Hotels Scraper](https://apify.com/memo23/google-hotels-scraper): prices from every booking site, a rate calendar and reviews

See the [full memo23 actor catalog](https://apify.com/memo23).

***

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/trip-com-scraper`).

**Purpose:** Scrape Trip.com hotels (search a city by dates) and guest reviews (per hotel), including Ctrip-shared properties — one flat row per hotel or per review, with prices incl. taxes and full sub-ratings.

**Minimal input:**

```json
{ "cityId": "338", "checkIn": "2026-09-01", "checkOut": "2026-09-02", "maxItems": 25 }
```

Reviews mode instead: `{ "hotelIds": ["2194717"], "maxReviewsPerHotel": 25 }` (or `hotelUrls`); paste list URLs via `searchUrls` as an alternative to `cityId` + dates.

**Output:** one row per hotel or per review. Hotel rows — hotelId, name, url, starRating, guestScore, scoreDescription, reviewCount, price, displayPrice, totalPrice, strikePrice, cityName, address, latitude, longitude, category, rankLabel, tags, imageCount, source. Review rows — reviewId, hotelId, hotelUrl, content, contentTranslated, translatedLanguage, rating, ratingScale, ratingLevel, ratingLocation, ratingService, ratingRoom, ratingFacility, reviewerName, reviewerRegion, reviewerLevel, travelType, roomName, createDate, checkinDate, language, usefulCount, reviewSource, imageUrls, videoUrls, hotelReply, hotelReplyTranslated, hotelRatingOverall, hotelReviewCount, source.

**Behaviors an agent should know:**

- Presence of `hotelUrls`/`hotelIds` selects reviews mode; `cityId` or `searchUrls` selects hotels mode.
- Always set `maxItems` (default 200, free-tier 100) and `maxReviewsPerHotel` (default 100) to bound reviews pulls.
- For scheduled monitoring set `cutoffDate` — the run switches to newest-first and stops at the first older review; hotels dedupe by hotel ID, reviews by review ID.
- Review filters (`minRating`/`maxRating`, `reviewLanguages`, `onlyWithMedia`, date range) are applied as the actor reads, and filtered-out reviews are never charged.
- Pay-per-event billing — see the Pricing tab on the actor page.
- Public data only — no booking, member-only prices, or anything behind a Trip.com login; Ctrip-exclusive hotels return nothing.

***

### ⚠️ Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Trip.com, Trip.com Group, Ctrip, or any of their subsidiaries or affiliates. All trademarks mentioned are the property of their respective owners.

The scraper accesses only publicly available hotel and review pages — no authenticated endpoints, member-only prices, or content behind a Trip.com login. Users are responsible for ensuring their use complies with Trip.com's Terms of Service, applicable data-protection law (GDPR, CCPA, etc.), and any contractual obligations of their own organisation.

***

### SEO Keywords

trip.com scraper, trip.com hotels scraper, scrape trip.com, trip.com api, trip.com hotel data, trip.com reviews scraper, hotel price scraper, hotel reviews scraper, ctrip scraper, travel data scraper, hotel data extractor, ota price monitoring, hotel rate scraper, guest reviews scraper, trip.com hotel prices, hotel ranking data, apify trip.com, hotel json csv export, hotel review sentiment data, trip.com listings scraper

# Actor input Schema

## `searchUrls` (type: `array`):

Trip.com hotel list URLs, e.g. https://www.trip.com/hotels/list?city=338 — optionally add checkin=YYYY/MM/DD\&checkout=YYYY/MM/DD to pin dates (missing or past dates default to ~30 days out). On-page filters and sort in the URL are carried over.

## `cityId` (type: `string`):

Trip.com city ID (the `city=` value in a hotel list URL). E.g. 338 = London, 359 = Paris, 347 = New York.

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

Check-in date, YYYY-MM-DD. Leave empty to default to ~30 days from today; past dates are bumped forward automatically.

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

Check-out date, YYYY-MM-DD. Leave empty for 1 night after check-in.

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

Number of adult guests.

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

Number of rooms.

## `currency` (type: `string`):

Price currency.

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

Trip.com or Ctrip hotel detail URLs, e.g. https://www.trip.com/hotels/detail/?hotelId=2194717 — their reviews are scraped.

## `hotelIds` (type: `array`):

Hotel IDs to scrape reviews from (alternative to Hotel URLs above).

## `maxReviewsPerHotel` (type: `integer`):

Cap on reviews pulled per hotel in reviews mode.

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

Order Trip.com returns reviews in. Ignored (forced to Most recent) when a cutoff date is set.

## `cutoffDate` (type: `string`):

Only keep reviews posted after this date (YYYY-MM-DD). Best for recurring runs: pagination stops at the first older review instead of walking the hotel's whole history.

## `reviewsFromDate` (type: `string`):

Only keep reviews posted on or after this date (YYYY-MM-DD).

## `reviewsToDate` (type: `string`):

Only keep reviews posted on or before this date (YYYY-MM-DD).

## `minRating` (type: `integer`):

Only keep reviews rated at or above this, on Trip.com's 0-10 scale. Leave empty for all.

## `maxRating` (type: `integer`):

Only keep reviews rated at or below this, on Trip.com's 0-10 scale. Set to 6 to mine complaints.

## `reviewLanguages` (type: `array`):

Only keep reviews written in these language codes, e.g. en, zh, ja, de. Leave empty for all languages.

## `onlyWithMedia` (type: `boolean`):

Skip text-only reviews.

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

Hard cap on hotel rows per run. Each kept hotel is one paid result. Default 200. Free-tier users are capped at 100.

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

How many search sources to paginate in parallel. 5-8 is the reliable sweet spot.

## `proxy` (type: `object`):

Leave empty — the actor already routes all traffic through its own built-in residential proxy at no extra cost to you. Only set this if you want to use your own proxies.

## Actor input object example

```json
{
  "searchUrls": [
    "https://www.trip.com/hotels/list?city=338"
  ],
  "adults": 2,
  "rooms": 1,
  "currency": "USD",
  "maxReviewsPerHotel": 100,
  "sortBy": "mostRelevant",
  "cutoffDate": "",
  "onlyWithMedia": false,
  "maxItems": 200,
  "maxConcurrency": 6
}
```

# 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 = {
    "searchUrls": [
        "https://www.trip.com/hotels/list?city=338"
    ],
    "cutoffDate": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/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 = {
    "searchUrls": ["https://www.trip.com/hotels/list?city=338"],
    "cutoffDate": "",
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/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 '{
  "searchUrls": [
    "https://www.trip.com/hotels/list?city=338"
  ],
  "cutoffDate": ""
}' |
apify call memo23/trip-com-scraper --silent --output-dataset

```

## MCP server setup

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