# Trip.com Attractions Search

Search trip.com attraction and experience listings with destination/date filters and pagination.

- Platform: [Trip.com Travel](https://docs.upscrape.com/docs/platforms/tripcom)
- Capability ID: `tripcom.attractions.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": {
    "adults": 2,
    "children": 0,
    "currency": "GBP",
    "destination": "London",
    "locale": "en",
    "max_pages": 2,
    "max_results": 10,
    "page": 1,
    "query": "London"
  },
  "capability": "tripcom.attractions.search"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `adults` | `integer` | No |  |
| `children` | `integer` | No |  |
| `currency` | `string` | No |  |
| `date` | `string` | No | Optional attraction date filter in YYYY-MM-DD |
| `destination` | `string` | No | Optional destination name used by autocomplete-like endpoints |
| `locale` | `string` | No |  |
| `location_id` | `string` | No | Location identifier when available |
| `max_pages` | `integer` | No |  |
| `max_results` | `integer` | No |  |
| `page` | `integer` | No |  |
| `query` | `string` | Yes | Attraction search query |

### Example input

```json
{
  "adults": 2,
  "children": 0,
  "currency": "GBP",
  "destination": "London",
  "locale": "en",
  "max_pages": 2,
  "max_results": 10,
  "page": 1,
  "query": "London"
}
```

## 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
{
  "attractions": [
    {
      "attraction_id": "78696",
      "tags": [
        "attraction"
      ],
      "title": "The British Museum",
      "url": "https://www.trip.com/travel-guide/attraction/london/the-british-museum-78696/"
    },
    {
      "attraction_id": "81747",
      "tags": [
        "attraction"
      ],
      "title": "London Eye",
      "url": "https://www.trip.com/travel-guide/attraction/london/london-eye-81747/"
    },
    {
      "attraction_id": "78709",
      "tags": [
        "attraction"
      ],
      "title": "Windsor Castle",
      "url": "https://www.trip.com/travel-guide/attraction/windsor/windsor-castle-78709/"
    }
  ],
  "currency": "GBP",
  "end_page": 1,
  "has_more": false,
  "locale": "en",
  "pages_fetched": 1,
  "query": "London",
  "source": "trip.com-attractions",
  "source_url": "https://www.trip.com/things-to-do/experiences/london-attractions/?adults=2&currency=GBP&destination=London&keyword=London&locale=en&q=London&query=London",
  "start_page": 1,
  "total_found": 51
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `attractions` | `array` | 3 items |
| `attractions` | `array` | 3 items |
| `currency` | `string` | GBP |
| `end_page` | `integer` | 1 |
| `has_more` | `boolean` | false |
| `locale` | `string` | en |
| `pages_fetched` | `integer` | 1 |
| `query` | `string` | London |
| `source` | `string` | trip.com-attractions |
| `source_url` | `string` | https://www.trip.com/things-to-do/experiences/london-attractions/?adult… |
| `start_page` | `integer` | 1 |
| `total_found` | `integer` | 51 |

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