# Trip.com Hotel Search

Search Trip.com hotel listing pages and extract normalized hotel cards.

- Platform: [Trip.com Travel](https://docs.upscrape.com/docs/platforms/tripcom)
- Capability ID: `tripcom.hotel.search`
- Cost: 1 credit per request
- Maximum runtime: 30 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "listing_url": "https://nz.trip.com/hotels/london-hotels-list-338/",
    "max_pages": 1,
    "page": 1
  },
  "capability": "tripcom.hotel.search"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `adults` | `integer` | No |  |
| `amenities` | `array<string>` | No |  |
| `check_in` | `string` | No | Check-in date in YYYY-MM-DD |
| `check_out` | `string` | No | Check-out date in YYYY-MM-DD |
| `children` | `integer` | No |  |
| `currency` | `string` | No |  |
| `listing_url` | `string` | Yes | Trip.com hotel listing URL |
| `locale` | `string` | No |  |
| `max_pages` | `integer` | No |  |
| `page` | `integer` | No |  |
| `rooms` | `integer` | No |  |

### Example input

```json
{
  "listing_url": "https://nz.trip.com/hotels/london-hotels-list-338/",
  "max_pages": 1,
  "page": 1
}
```

## Response

Successful output is returned in `results[0].data`. Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This redacted fixture is an example, not a fixed response schema.

```json
{
  "end_page": 1,
  "has_more": false,
  "input_url": "https://nz.trip.com/hotels/london-hotels-list-338/",
  "listings": [
    {
      "id": "2196184",
      "image_url": "https://ak-d.tripcdn.com/images/1mc2412000mkgxc0nF10B.jpg?proc=resize/m_r,w_700,h_448,8688&proc=format/f_webp",
      "page": 1,
      "position": 1,
      "rating": 8.6,
      "reviews": 676,
      "title": "Holiday Inn Express LONDON - LIMEHOUSE by IHG",
      "url": "https://nz.trip.com/hotels/london-hotel-detail-2196184/holiday-inn-express-london-limehouse-by-ihg/"
    },
    {
      "id": "2985758",
      "image_url": "https://ak-d.tripcdn.com/images/1mc4512000dl5w9gpC200.jpg?proc=resize/m_r,w_700,h_448,8688&proc=format/f_webp",
      "page": 1,
      "position": 2,
      "rating": 8.2,
      "reviews": 3017,
      "title": "Royal National Hotel",
      "url": "https://nz.trip.com/hotels/london-hotel-detail-2985758/royal-national-hotel-london/"
    },
    {
      "id": "128788146",
      "image_url": "https://ak-d.tripcdn.com/images/1mc1a12000nnt77hz6D87.jpg?proc=resize/m_r,w_700,h_448,8688&proc=format/f_webp",
      "page": 1,
      "position": 3,
      "rating": 8.2,
      "reviews": 1209,
      "title": "Zedwell Capsule Hotel Piccadilly Circus",
      "url": "https://nz.trip.com/hotels/london-hotel-detail-128788146/zedwell-capsule-hotel-piccadilly-circus/"
    }
  ],
  "pages_fetched": 1,
  "query": "London",
  "source_url": "https://nz.trip.com/hotels/london-hotels-list-338/",
  "start_page": 1,
  "total_found": 29
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `end_page` | `integer` | 1 |
| `has_more` | `boolean` | false |
| `input_url` | `string` | https://nz.trip.com/hotels/london-hotels-list-338/ |
| `listings` | `array` | 3 items |
| `listings` | `array` | 3 items |
| `pages_fetched` | `integer` | 1 |
| `query` | `string` | London |
| `source_url` | `string` | https://nz.trip.com/hotels/london-hotels-list-338/ |
| `start_page` | `integer` | 1 |
| `total_found` | `integer` | 29 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
