# Trip.com Hotel Data Scraper with Advanced Filters (`hotels-scrapers/trip-hotel-scraper`)

Powerful Trip.com hotel/accomendation data scraper & API. Collect prices (original, current, total), ratings, reviews, room types, amenities, images, promotions. Apply advanced filters, monitor markets, build dashboards, or call via REST & schedule. Exports JSON or CSV fast.

- **URL**: https://beta-securitybyobscurity.apify.com/hotels-scrapers/trip-hotel-scraper.md
- **Developed by:** [Hotels Scraper](https://beta-securitybyobscurity.apify.com/hotels-scrapers) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 13 total users, 6 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per event

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

# README

## 🏨 Trip.com Hotel Scraper

> **Professional hotel data extraction for competitive analysis and market intelligence**

Extract comprehensive hotel data from Trip.com for pricing analysis, market research, and competitive intelligence. This scraper provides real-time access to hotel information including prices, ratings, amenities, and promotional offers across multiple destinations worldwide.

### 🎯 What This Scraper Does

The Trip.com Hotel Scraper extracts detailed hotel information from Trip.com's search results, providing you with:

- **Real-time pricing data** (current, original, and total prices with taxes)
- **Hotel details** (name, ID, location, star rating, distance from landmarks)
- **Guest feedback** (ratings, descriptions, and review counts)
- **Room information** (type, occupancy, bed configuration, features)
- **Promotional information** (discounts, member deals, special offers)
- **High-quality images** and visual content
- **Booking insights** (last booked information, availability)

### 🚀 Quick Start

#### 1. Get Your Search URL

1. Visit [trip.com](https://www.trip.com)
2. Search for hotels with your desired filters (location, dates, guests, etc.)
3. Copy the complete URL from your browser

#### 2. Configure the Scraper

```json
{
  "filterArgs": [
    "https://www.trip.com/hotels/search?cityId=24317&checkIn=2025-07-26&checkOut=2025-07-27&adult=2&children=0&curr=USD&starlist=4"
  ],
  "limitPerPage": 50,
  "totalLimit": 200
}
```

#### 3. Run and Get Results

The scraper will return structured JSON data ready for analysis.

### 📊 Data Output Example

```json
{
  "hotel_id": "717668",
  "name": "Hotel Europe Saint Severin",
  "star_rating": 3,
  "rating": 8.6,
  "rating_description": "Very Good",
  "reviews": 67,
  "location": "Near Louvre Museum Latin Quarter Show on map",
  "room_type": "Classic Room",
  "occupancy": 2,
  "bed_type": [
    "double"
  ],
  "original_price": 172,
  "current_price": 167,
  "total_price": 0.196,
  "discount": "US$5 Off",
  "promotion_type": "Limited Time Offer",
  "images": [
    "https://ak-d.tripcdn.com/images/0226912000ajv31vu9D73_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/02029120008lvukmmFB41_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/220w0s000000hzre9671C_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/220k0g000000825piE2DC_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/22090s000000hw4ow4677_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/0226912000ajv31vu9D73_R_600_600_R5_D.jpg_.webp",
    "https://ak-d.tripcdn.com/images/02029120008lvukmmFB41_R_600_600_R5_D.jpg_.webp"
  ],
  "last_booked": "Only 2 left at this price",
  "source_url": "https://trip.com/hotels/list?city=192&provinceId=0&countryId=31&checkIn=2025-07-26&checkOut=2025-07-27&lat=0&lon=0&districtId=0&barCurr=USD&searchType=CT&searchWord=Paris&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false",
  "page_number": 1
}
```

### ⚙️ Configuration Options

| Parameter        | Type    | Required | Description                                                    |
|------------------|---------|----------|----------------------------------------------------------------|
| `filterArgs`     | array   | Yes      | List of Trip.com URLs or search parameters                   |
| `limitPerPage`   | number  | No       | Maximum hotels per page (default: `100`)                      |
| `totalLimit`     | number  | No       | Total hotels to scrape (default: `100`)                       |

#### Supported URL Formats

The scraper accepts multiple input formats:

- **Full URLs**: `https://www.trip.com/hotels/search?cityId=...&checkIn=...`
- **Query parameters**: `?cityId=24317&checkIn=2025-07-26&checkOut=2025-07-27`
- **Search filters**: `cityId=24317&adult=2&children=0&curr=USD`

### 🌍 Global Coverage

This scraper works with Trip.com's extensive network covering:

- **Global Markets**: Europe, Americas, Asia-Pacific, Middle East, Africa
- **All Hotel Types**: Budget, mid-range, luxury, resorts, boutique hotels
- **Multiple Currencies**: USD, EUR, GBP, CNY, and more
- **Localized Content**: Support for multiple languages and regions

### 💼 Use Cases

#### For Hotel Managers & Revenue Analysts

- **Competitive pricing analysis** - Monitor competitor prices in real-time
- **Market positioning** - Understand your hotel's competitive landscape
- **Revenue optimization** - Identify pricing opportunities and market gaps
- **Seasonal trend analysis** - Track price fluctuations across seasons

#### For Market Researchers & Consultants

- **Market intelligence** - Comprehensive data for hospitality reports
- **Investment analysis** - Evaluate hotel markets for opportunities
- **Demand forecasting** - Analyze booking patterns and market demand
- **Geographic expansion** - Research new markets and landscapes

#### For Travel & Hospitality Platforms

- **Price comparison features** - Build competitive price tools
- **Market data integration** - Feed real-time pricing into platforms
- **Analytics dashboards** - Create market intelligence dashboards
- **API development** - Build APIs powered by real-time hotel data

### 🔧 Technical Details

#### TypeScript Interface

```typescript
interface HotelData {
  hotel_id?: string;
  name: string;
  star_rating?: number;
  rating?: number;
  rating_description?: string;
  reviews?: number;
  location?: string;
  room_type?: string;
  occupancy?: number;
  bed_type?: string[];
  room_features?: string[];
  original_price?: number;
  current_price?: number;
  total_price?: number;
  discount?: string;
  promotion_type?: string;
  images?: string[];
  last_booked?: string;
  source_url: string;
  page_number: number;
}
```

#### Python Pydantic Model

```python
from pydantic import BaseModel
from typing import Optional, List

class HotelData(BaseModel):
    hotel_id: Optional[str]
    name: str
    star_rating: Optional[int]
    rating: Optional[float]
    rating_description: Optional[str]
    reviews: Optional[int]
    location: Optional[str]
    room_type: Optional[str]
    occupancy: Optional[int]
    bed_type: Optional[List[str]]
    room_features: Optional[List[str]]
    original_price: Optional[float]
    current_price: Optional[float]
    total_price: Optional[float]
    discount: Optional[str]
    promotion_type: Optional[str]
    images: Optional[List[str]]
    last_booked: Optional[str]
    source_url: str
    page_number: int
```

### 🎯 Key Features

- **Real-time data** - Get current pricing and availability information
- **Comprehensive coverage** - Extract all available hotel details
- **Flexible filtering** - Use Trip.com's built-in search filters
- **Structured output** - Clean JSON data ready for analysis
- **Scalable** - Handle multiple URLs and large datasets
- **Reliable** - Built with robust error handling and retry logic
- **Smart scrolling** - Automatically detects end of results
- **Rich data extraction** - Includes images, room details, and booking insights

### 🔄 Scrolling and Pagination

The scraper implements intelligent scrolling to load all available hotels:

- **Infinite scroll detection** - Automatically scrolls until target count reached
- **End detection** - Recognizes "The following properties meet some of your requirements:" message
- **Dynamic loading** - Handles Trip.com's dynamic content loading
- **Performance optimized** - Efficient scrolling with proper wait times

### 🚀 Get Started Today

Start extracting valuable hotel market data to gain competitive insights and make data-driven decisions in the hospitality industry.

**Ready to begin? Configure your scraper and start collecting hotel intelligence now!**

# Actor input Schema

## `filterArgs` (type: `array`):

List of Trip.com hotel search URLs or filter parameters. The easiest way is to search on trip.com, apply your filters, and copy the complete URL from your browser.

## `limitPerPage` (type: `integer`):

Maximum number of hotels to scrape per search page.

## `totalLimit` (type: `integer`):

Total maximum number of hotels to scrape across all URLs.

## Actor input object example

```json
{
  "filterArgs": [
    "https://trip.com/hotels/list?city=192&provinceId=0&countryId=31&checkIn=2025-07-26&checkOut=2025-07-27&lat=0&lon=0&districtId=0&barCurr=USD&searchType=CT&searchWord=Paris&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false"
  ],
  "limitPerPage": 100,
  "totalLimit": 100
}
```

# 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 = {
    "filterArgs": [
        "https://trip.com/hotels/list?city=192&provinceId=0&countryId=31&checkIn=2025-07-26&checkOut=2025-07-27&lat=0&lon=0&districtId=0&barCurr=USD&searchType=CT&searchWord=Paris&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false"
    ],
    "limitPerPage": 100,
    "totalLimit": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("hotels-scrapers/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 = {
    "filterArgs": ["https://trip.com/hotels/list?city=192&provinceId=0&countryId=31&checkIn=2025-07-26&checkOut=2025-07-27&lat=0&lon=0&districtId=0&barCurr=USD&searchType=CT&searchWord=Paris&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false"],
    "limitPerPage": 100,
    "totalLimit": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("hotels-scrapers/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 '{
  "filterArgs": [
    "https://trip.com/hotels/list?city=192&provinceId=0&countryId=31&checkIn=2025-07-26&checkOut=2025-07-27&lat=0&lon=0&districtId=0&barCurr=USD&searchType=CT&searchWord=Paris&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false"
  ],
  "limitPerPage": 100,
  "totalLimit": 100
}' |
apify call hotels-scrapers/trip-hotel-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Trip.com Hotel Data Scraper with Advanced Filters",
        "description": "Powerful Trip.com hotel/accomendation data scraper & API. Collect prices (original, current, total), ratings, reviews, room types, amenities, images, promotions. Apply advanced filters, monitor markets, build dashboards, or call via REST & schedule. Exports JSON or CSV fast.",
        "version": "1.0",
        "x-build-id": "o4j0AxBNL3947JWfH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/hotels-scrapers~trip-hotel-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-hotels-scrapers-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/hotels-scrapers~trip-hotel-scraper/runs": {
            "post": {
                "operationId": "runs-sync-hotels-scrapers-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/hotels-scrapers~trip-hotel-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-hotels-scrapers-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": [
                    "filterArgs"
                ],
                "properties": {
                    "filterArgs": {
                        "title": "🔗 Search URLs",
                        "type": "array",
                        "description": "List of Trip.com hotel search URLs or filter parameters. The easiest way is to search on trip.com, apply your filters, and copy the complete URL from your browser.",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "limitPerPage": {
                        "title": "📄 Hotels Per Page",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of hotels to scrape per search page.",
                        "default": 100
                    },
                    "totalLimit": {
                        "title": "🎯 Total Hotels Limit",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Total maximum number of hotels to scrape across all URLs.",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
