
How to Scrape Viator Data: Complete Guide for 2026
Learn how to scrape Viator travel data using Python and Node.js with AlterLab's API. Covers anti-bot handling, structured extraction, pricing, and best practices for 2026.
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeThis guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.
TL;DR
To scrape Viator, send a request to AlterLab's API with the target URL. Use Python or Node.js SDKs, rely on auto‑escalating tiers for anti‑bot handling, and optionally extract structured JSON with Cortex. Start at T1; the API promotes to T3/T4 as needed, charging only for the successful tier.
Why collect travel data from Viator?
Viator lists tours, activities, and experiences worldwide. Engineers extract this data for:
- Market research: Compare activity pricing across cities to inform product positioning.
- Price monitoring: Track seasonal fluctuations and dynamic discount patterns.
- Data analysis: Build recommendation engines or travel trend reports using publicly listed ratings and descriptions.
Technical challenges
Travel sites like viator.com deploy standard anti‑bot protections: rate limiting per IP, User‑Agent scrutiny, and lightweight JavaScript checks that can block raw HTTP requests. AlterLab's Smart Rendering API manages proxy rotation, header normalization, and headless browser fallback so you receive the public HTML without manually solving challenges.
Quick start with AlterLab API
See the Getting started guide for SDK installation. Below are ready‑to‑run examples for Python and Node.js.
import alterlab
client = alterlab.Client("YOUR_API_KEY")
response = client.scrape("https://www.viator.com/tours/London/Eiffel-Tower-Summit-Experience/d5072-12345TOUR")
print(response.text[:500])import { AlterLab } from "alterlab";
const client = new AlterLab({ apiKey: "YOUR_API_KEY" });
const response = await client.scrape("https://www.viator.com/tours/London/Eiffel-Tower-Summit-Experience/d5072-12345TOUR");
console.log(response.text.slice(0, 500));curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-d '{"url": "https://www.viator.com/tours/London/Eiffel-Tower-Summit-Experience/d5072-12345TOUR"}'These snippets retrieve the raw HTML of a public tour page. AlterLab automatically selects the lowest viable tier (starting at T1) and upgrades if the response indicates a block.
Extracting structured data
Once you have the HTML, you can parse visible fields with CSS selectors. Common Viator data points include:
- Tour title (
h1.tour-title) - Price (
span.price) - Average rating (
div.rating-stars) - Description (
div.description)
In Python with BeautifulSoup:
from bs4 import BeautifulSoup
soup = BeautifulSoup(response.text, "html.parser")
title = soup.select_one("h1.tour-title").get_text(strip=True)
price = float(soup.select_one("span.price").get_text(strip=True).replace("$", ""))
rating = float(soup.select_one("div.rating-stars")["data-rating"])
description = soup.select_one("div.description").get_text(strip=True)
print({"title": title, "price": price, "rating": rating, "description": description})Node.js equivalent with Cheerio:
import cheerio from "cheerio";
const $ = cheerio.load(response.text);
const title = $("h1.tour-title").text().trim();
const price = parseFloat($("span.price").text().replace("$", ""));
const rating = parseFloat($("div.rating-stars").attr("data-rating"));
const description = $("div.description").text().trim();
console.log({ title, price, rating, description });Structured JSON extraction with Cortex
AlterLab's Cortex API returns typed JSON directly, eliminating the need for local parsing. Provide a JSON Schema that matches the fields you want.
import alterlab
client = alterlab.Client("YOUR_API_KEY")
result = client.extract(
url="https://www.viator.com/tours/London/Eiffel-Tower-Summit-Experience/d5072-12345TOUR",
schema={
"type": "object",
"properties": {
"title": {"type": "string"},
"price": {"type": "number"},
"rating": {"type": "number"},
"description": {"type": "string"}
},
"required": ["title", "price"]
}
)
print(result.data) # Typed JSON outputCortex handles JavaScript rendering and anti‑bot challenges internally, delivering consistent structured output.
Cost breakdown
AlterLab's pricing is usage‑based. The table below shows the cost per request and per 1,000 requests for each tier. For Viator, typical pages require JavaScript rendering and light anti‑bot handling, so the effective tier is often T3 (Stealth) or T4 (Browser). AlterLab auto‑escalates—you begin at T1 and only pay for the tier that succeeds.
| Tier | Use Case | Cost per Request | Cost per 1,000 | Requests per $1 |
|---|---|---|---|---|
| T1 — Curl | Static HTML, no JS needed | $0.0002 | $0.20 | 5,000 |
| T2 — HTTP | Standard pages with headers | $0.0003 | $0.30 | 3,333 |
| T3 — Stealth | Protected pages, anti-bot active | $0.002 | $2.00 | 500 |
| T4 — Browser | Full JS rendering required | $0.004 | $4.00 | 250 |
| T5 — CAPTCHA | CAPTCHA solving + JS rendering | $0.02 | $20.00 | 50 |
See the AlterLab pricing page for the latest rates and volume discounts.
Best practices
- Rate limiting: Start with one request per second per IP; adjust based on response headers.
- Robots.txt: Check
https://www.viator.com/robots.txtfor disallowed paths before scaling. - Dynamic content: Use Cortex or set
render_js:trueif initial HTML lacks the data you need. - Error handling: Retry failed requests with exponential backoff; inspect
response.statusfor tier‑specific hints. - Headers: AlterLab supplies a realistic browser User‑Agent; you can add custom headers via the
headersparameter if needed.
Scaling up
For large datasets:
- Batch requests: Send up to 100 URLs per batch using the
/v1/scrape/batchendpoint to reduce overhead. - Scheduling: Use AlterLab's scheduling feature** lets you define cron expressions for recurring scrapes (e.g., daily price checks).
- Handling results: Stream responses to a file or database; avoid holding all HTML in memory.
- Responsible scaling: Monitor your API usage dashboard and stay within the rate limits you set for Viator.
Key takeaways
- AlterLab abstracts anti‑bot complexity with
Was this article helpful?
Frequently Asked Questions
Related Articles

GetApp Data API: Extract Structured JSON in 2026
Learn how to build a robust data pipeline using a GetApp data API. Extract structured product reviews and ratings into clean JSON with AlterLab's Extract API.
Herald Blog Service

SourceForge Data API: Extract Structured JSON in 2026
Learn how to extract structured JSON from SourceForge using AlterLab's Extract API with schema validation, pagination, and cost estimates.
Herald Blog Service

How to Scrape GetYourGuide Data: Complete Guide for 2026
Learn how to scrape GetYourGuide for travel data using Python and Node.js. Master structured data extraction with AlterLab's API and Cortex AI.
Herald Blog Service
Popular Posts
Recommended

How to Scrape AliExpress: Complete Guide for 2026

Why Your Headless Browser Gets Detected (and How to Fix It)

AlterLab vs Firecrawl: In-Depth Review with Benchmarks & Code Examples

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

Why Your Headless Browser Gets Detected (and How to Fix It)

AlterLab vs Firecrawl: In-Depth Review with Benchmarks & Code Examples

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Anti-Bot Handling API
Automatic challenge handling for protected sites — works out of the box.
JavaScript Rendering API
Render SPAs and dynamic content with headless Chromium.
Pricing
5-tier pricing from $0.0002/page. 5,000 free requests to start.
Documentation
API reference, SDKs, quickstart guides, and tutorials.
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.