# Viator Tours and Activities Search API Documentation

List the tours and activities Viator offers in one destination, 24 per page: product code, title, description, destination, from price (USD), rating, review count, duration in minutes, free cancellation, languages, badges, image and Viator url. Page with the page parameter; has_more and next_page tell you when more pages exist. A page beyond the last page is a not billable 404. Prices are in USD.

- **Documentation:** [https://scrappa.co/docs/viator-api/viator_search](https://scrappa.co/docs/viator-api/viator_search)
- **API group:** Viator API
- **Endpoint:** `GET https://scrappa.co/api/viator/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 |
| --- | --- | --- | --- |
| `destination_id` | integer | Yes | Viator destination id, a whole number. Example: 538 for Lisbon, 511 for Rome, 479 for Paris. |
| `page` | integer | No | 1-based page number, 24 activities per page. Defaults to 1. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/viator/search?destination_id=538"
```

## Example response

```json
{
    "success": true,
    "data": {
        "destination_id": 538,
        "page": 1,
        "total_pages": 142,
        "total_results": 3396,
        "activities": [
            {
                "position": 1,
                "product_code": "70273P7",
                "title": "Small Group Tour to Sintra, Pena Palace, Cabo Roca and Cascais",
                "url": "https://www.viator.com/tours/Lisbon/Tour-to-Sintra-Pena-Palace-Cabo-da-Roca-Regaleira-and-Cascais/d538-70273P7",
                "description": "Explore beyond Lisbon city limits and see several of Portugal\u2019s top attractions in one day on this seamless, small-group tour.",
                "destination": {
                    "id": 538,
                    "name": "Lisbon, Portugal"
                },
                "price": {
                    "amount": 80.11,
                    "currency": "USD"
                },
                "rating": 4.9,
                "review_count": 5009,
                "duration_minutes": 480,
                "free_cancellation": true,
                "likely_to_sell_out": true,
                "languages": [
                    "en",
                    "es",
                    "fr",
                    "it",
                    "pt"
                ],
                "badges": [
                    "likely_to_sell_out",
                    "recommended_by_travellers"
                ],
                "image_url": "https://dynamic-media.tacdn.com/media/photo-o/32/b1/71/7e/caption.jpg?w=1600&h=1000&s=1"
            }
        ],
        "has_more": true,
        "next_page": 2
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. No upstream call is made and the response is not billable. |
| 404 | Not Found | The destination does not exist, or the page is beyond the last result page (PAGE_NOT_FOUND). This response is not billable. |
| 503 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | Viator could not be reached or blocked the request on every attempt. This response is not billable. |

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