> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# TripAdvisor Attractions API

> TripAdvisor things to do: contact, address, coordinates, rating breakdown, ranking, attraction types, Viator booking links, ticket offers and photos.

`POST /v1/data/tripadvisor/attractions/run`

**Pricing:** $0.002 per attraction ($2.00 per 1,000). Setting `maxPhotosPerPlace` above 0 adds \$0.0005 per delivered photo.

## Ways to call it

* **Search**: set `query` (optional: `maxResults`, `language`, `currency`, `includeTags`, `maxPhotosPerPlace`, `photosType`)
* **URL**: set `startUrls` (optional: `language`, `currency`, `includeTags`, `maxPhotosPerPlace`, `photosType`)

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**query** `string`

A location name or keyword to search, e.g. 'Rome' or 'Colosseum'. Use English place names for best coverage. (By Search mode.)

**startUrls** `string`

A TripAdvisor search or attraction page URL to extract attractions from. (By URL mode.)

Format e.g. `https://www.tripadvisor.com/hotels-g189158-lisbon_lisbon_district_central_portugal-hotels.html`.

**maxResults** `integer`

Number of attractions to return. Use 0 for all.

**language** `string` (default: en)

Language for the listing data.

**currency** `string` (default: USD)

Currency for prices.

**includeTags** `boolean` (default: true)

Pull review category tags (e.g. "Family-friendly", "Hidden gem").

**maxPhotosPerPlace** `integer` (default: 0)

Photos to fetch per attraction. Use 0 for none. Billed as an add-on per delivered photo.

**photosType** `string` (default: fromEveryone)

Which photo source to pull from.

Allowed values: `fromEveryone` (From Everyone), `fromManagement` (From Management), `fromTravelers` (From Travelers).

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/tripadvisor/attractions/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "query": "Rome",
    "maxResults": 10,
    "language": "en",
    "currency": "USD"
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/tripadvisor/attractions/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "query": "Rome",
    "maxResults": 10,
    "language": "en",
    "currency": "USD"
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/tripadvisor/attractions/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "query": "Rome",
  "maxResults": 10,
  "language": "en",
  "currency": "USD"
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one attraction, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `id` | ID | text |
| `name` | Name | text |
| `subcategories` | Subcategories | array |
| `tripadvisorUrl` | TripAdvisor URL | url |
| `description` | Description | text |
| `address` | Address | object |
| `latitude` | Latitude | number |
| `longitude` | Longitude | number |
| `nearestMetroStations` | Nearest Metro Stations | object\_array |
| `phone` | Phone | phone |
| `email` | Email | email |
| `website` | Website | url |
| `rating` | Rating | rating |
| `reviews` | Reviews | number |
| `ratingBreakdown` | Rating Breakdown | object |
| `reviewTags` | Review Tags | object\_array |
| `rank` | Rank | number |
| `rankOutOf` | Rank Out Of | number |
| `photos` | Photos | array |
| `photoCount` | Photo Count | number |
| `attractionTypes` | Attraction Types | array |
| `bookingUrl` | Booking URL | url |
| `lowestTicketPrice` | Lowest Ticket Price | text |
| `ticketOffers` | Ticket Offers | object\_array |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "tripadvisor/attractions",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "reviews": 3774,
      "rating": 4.7,
      "photos": [
        "https://media-cdn.tripadvisor.com/media/photo-o/10/88/06/40/20170903-155356-largejpg.jpg",
        "https://media-cdn.tripadvisor.com/media/photo-o/04/0e/93/9b/le-domus-romane-di-palazzo.jpg"
      ],
      "name": "Le Domus Romane di Palazzo Valentini",
      "email": null,
      "reviewTags": [
        {
          "tag": "trajan's column",
          "reviews": 180
        },
        {
          "tag": "glass floor",
          "reviews": 131
        }
      ],
      "rank": 30,
      "lowestTicketPrice": "$0.34",
      "ticketOffers": [
        {
          "title": "Roman Domus of Palazzo Valentini Ticket",
          "productCode": "14982P17",
          "price": "$30.60",
          "category": "Helicopter Tours",
          "url": "https://www.viator.com/tours/x/y/d0-14982P17"
        },
        {
          "title": "Palazzo Valentini Ancient Domus Underground Multimedia Experience",
          "productCode": "41353P66",
          "price": "$32.79",
          "category": "Helicopter Tours",
          "url": "https://www.viator.com/tours/x/y/d0-41353P66"
        }
      ],
      "attractionTypes": [
        "History Museums",
        "Architectural Buildings"
      ],
      "tripadvisorUrl": "https://www.tripadvisor.com/Attraction_Review-g187791-d2179620-Reviews-Le_Domus_Romane_di_Palazzo_Valentini-Rome_Lazio.html",
      "phone": "+39 06 8716 5343",
      "rankOutOf": "5767",
      "id": "2179620",
      "photoCount": 240,
      "description": null,
      "longitude": 12.484072,
      "subcategories": [
        "Sights & Landmarks",
        "Museums"
      ],
      "ratingBreakdown": {
        "oneStar": 31,
        "twoStar": 35,
        "threeStar": 119,
        "fourStar": 566,
        "fiveStar": 3025
      },
      "website": "https://www.palazzovalentini.it/domus-romane/",
      "latitude": 41.896053,
      "bookingUrl": "https://www.viator.com/tours/x/y/d0-14982P17",
      "nearestMetroStations": [
        {
          "name": "Fori Imperiali-Colosseo",
          "latitude": 41.891353607177734,
          "longitude": 12.491498947143555,
          "distance": 0.5019204353320863,
          "lines": [
            "B"
          ]
        },
        {
          "name": "Colosseo",
          "latitude": 41.891353607177734,
          "longitude": 12.491500854492188,
          "distance": 0.5019952659589325,
          "lines": [
            "B"
          ]
        }
      ],
      "address": {
        "street": "Foro Traiano 85",
        "city": "Rome",
        "state": null,
        "country": "Italy",
        "postalCode": "00186"
      }
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.