# Tripadvisor Search

Search Tripadvisor like the site search box. Each result has its position (from 1), location ID, name, type (hotel, restaurant, attraction, vacation_rental, destination or other), rating, review count, address, location, coordinates, image and Tripadvisor URL. Use the location ID with the place and reviews endpoints. Tripadvisor returns one result list per query without pages, so limit (1 to 20) is the only size control. A valid query without matches is a successful empty list.

- **Documentation:** [https://scrappa.co/docs/tripadvisor-api/tripadvisor_search](https://scrappa.co/docs/tripadvisor-api/tripadvisor_search)
- **API group:** Tripadvisor API
- **Endpoint:** `GET https://scrappa.co/api/tripadvisor/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | Yes | The search query (e.g. "pizza rome", "hilton paris") |
| `type` | string | No | Restrict results to one type: hotel, restaurant, attraction or destination. Default: all types |
| `limit` | integer | No | Results to return, 1 to 20. Default: 10 |
| `locale` | string | No | Locale for names and routes (e.g. en-US, de-DE). Default: en-US |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/tripadvisor/search?q=pizza+rome&limit=3"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "pizza rome",
        "results": [
            {
                "position": 1,
                "location_id": 4258943,
                "name": "Pizza in Trevi",
                "type": "restaurant",
                "address": "Via di San Vincenzo, 30-30A",
                "location": "Rome, Lazio, Italy",
                "latitude": 41.900665,
                "longitude": 12.483608,
                "image": "https://dynamic-media-cdn.tripadvisor.com/media/photo-o/15/b3/35/94/15-metri-da-fontana-di.jpg?w=800&h=-1&s=1",
                "url": "https://www.tripadvisor.com/Restaurant_Review-g187791-d4258943-Reviews-Pizza_in_Trevi-Rome_Lazio.html",
                "rating": 4.4,
                "review_count": 2714
            }
        ]
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 404 | Location Not Found | The Tripadvisor location does not exist. This response is not billable. |
| 502 | Invalid Source Response | Tripadvisor answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
