Skip to content

About

Python, JavaScript and cURL examples for collecting structured Tripadvisor places through Apify.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Tripadvisor places scraper with Python, JavaScript and cURL

Run Tripadvisor Places & Ratings Data Scraper from Apify's web interface without writing code, or integrate it with Python, JavaScript or cURL to collect structured hotel, restaurant, attraction and activity data.

This repository is a public integration companion. It contains runnable request examples, a checked-in input, sanitized output samples and field guides. It does not contain the private Actor source code.

Open Tripadvisor Places & Ratings Data Scraper on Apify

What this repository helps you do

  • Collect normalized Tripadvisor place records for a country, city, region, locality or place.
  • Process hotels, restaurants, attractions and activities with ratings, rankings, coordinates and public contact fields.
  • Enrich a known public Tripadvisor place or category URL and export the Dataset as JSON, CSV, Excel or JSONL.
  • Build travel research, local SEO, directory and market-analysis workflows around a hosted Apify Actor.

Example result

The repository includes a sanitized representative result in data/sample-output.json and a tabular version in data/sample-output.csv.

{
  "id": "25440380",
  "name": "Pignic Iberico",
  "type": "RESTAURANT",
  "category": "restaurant",
  "locationString": "Madrid",
  "latitude": 40.41755,
  "longitude": -3.703918,
  "rating": 4.9,
  "numReviews": 883,
  "ranking": "#1 of 14,992 places to eat in Madrid",
  "address": "calle de Tetuan 19 Bajo, 28013 Madrid Spain",
  "phone": null,
  "email": null,
  "website": "https://example.com/sanitized",
  "webUrl": "https://www.tripadvisor.com/Restaurant_Review-g187514-d25440380-Reviews-Pignic_Iberico-Madrid.html",
  "language": "en",
  "currency": "USD",
  "scrapedAt": "2026-09-25T15:01:01.929Z"
}

Run without code

You can run the hosted Actor directly from the Apify web interface.

  1. Open Tripadvisor Places & Ratings Data Scraper on Apify.
  2. In the Input tab, enter a country, city, locality or place in query, or clear it and add public Tripadvisor URLs under startUrls.
  3. Review the result limit, category switches, language, currency and optional photo limit.
  4. Click Start, then open the Dataset tab when the run finishes.
  5. Export the Dataset as JSON, CSV, Excel or JSONL for your workflow.

Use docs/no-code-guide.md for the field-by-field walkthrough and data/sample-input.json for a bounded first run.

Try it with Apify's free plan

Apify's Free plan includes $5 in monthly prepaid usage for Store Actors and your own Actors. No credit card is required to start. This can cover a small first test while credit is available; it is not unlimited usage.

Unused credits expire at the end of the billing cycle and do not roll over. Check the current Apify pricing before running a larger collection.

Quick start for developers

Python

1. Install the client

pip install -r examples/python/requirements.txt

2. Set your Apify token

export APIFY_API_TOKEN="your-token"

On Windows PowerShell:

$env:APIFY_API_TOKEN = "your-token"

3. Run the example

python examples/python/request.py

The example reads data/sample-input.json, starts the hosted Actor and prints the returned Dataset items.

Input example

The smallest useful request is a bounded query:

{
  "query": "Madrid, Spain",
  "maxItemsPerQuery": 1,
  "collectAll": false,
  "includeHotels": true,
  "includeRestaurants": true,
  "includeAttractions": true
}

The complete checked-in contract is in data/sample-input.json. See docs/input-reference.md for every field, default and limit.

Request examples

cURL

See examples/curl-request.md for a synchronous Dataset request.

Python

See examples/python/request.py. It uses the official apify-client package and does not require the Actor source code locally.

JavaScript

See examples/javascript/request.mjs for a Node.js request using the Apify HTTP API.

All examples use the hosted Actor and an API token supplied through the environment. They do not expose proxy settings, bypass access controls or require private implementation files.

Output fields

The most useful fields are:

Field Meaning
id Stable Tripadvisor location identifier used for deduplication.
name, type, category Place identity and normalized category.
locationString, latitude, longitude, addressObj Geographic and address data when available.
rating, numReviews, ranking Public rating, review-count and ranking signals.
phone, email, website, webUrl Public contact and listing links when exposed by Tripadvisor.
photo, photos, photoCount Primary photo and optional additional media.
hours, amenities, cuisine, mealTypes Category-specific details when available.
reviews Review previews included in the place detail response, not a complete review archive.
query, language, currency, scrapedAt Request context and collection timestamp.

See docs/output-reference.md for the complete output contract and null/empty-field behavior.

Common use cases

Read docs/use-cases.md for complete examples covering:

  • destination and travel-inventory research;
  • local SEO and directory preparation;
  • restaurant, hotel and attraction comparison;
  • CSV export and downstream data processing.

Scrape Tripadvisor places with Python

Use the hosted Actor from a scheduled script, notebook or backend service by loading the checked-in JSON and calling the API. The Python example waits for completion and prints Dataset items; for larger jobs, persist the run ID and consume the Dataset asynchronously.

Export Tripadvisor place data to CSV

The Dataset is available in structured formats from Apify. The included data/sample-output.csv shows a compact tabular projection suitable for spreadsheets; the hosted Dataset retains the complete nested fields.

FAQ

See docs/faq.md for answers derived from the published Actor behavior.

Limits and pricing

maxItemsPerQuery accepts 1–10,000 places for each query or URL when collectAll is disabled. startUrls accepts up to 20 public Tripadvisor URLs.

With collectAll enabled, pagination continues until the source is exhausted or maxTotalItemsPerRun is reached. That run-wide safety cap defaults to 10,000 and accepts up to 50,000 places. Results are deduplicated by Tripadvisor location ID, so the final Dataset may contain fewer rows than the sum of target limits.

The billable unit is one unique place successfully delivered to the Dataset. Searches, URLs, failed place requests and empty runs do not create a place-item charge. Apify resolves the customer's tier and applies the configured price:

Apify tier Price per delivered place Equivalent per 1,000 delivered places
FREE $0.001 $1.00
BRONZE $0.0009 $0.90
SILVER $0.0008 $0.80
GOLD $0.00075 $0.75
PLATINUM $0.00075 $0.75
DIAMOND $0.00075 $0.75

The per-1,000 values are comparison equivalents; billing remains per delivered place. If collection cannot complete the requested scope, delivered rows remain available but the run reports failure so partial output is not mistaken for complete coverage.

Hosted version

Use the hosted version when you need repeatable execution, batching, scheduling, API access or Dataset storage without maintaining scraping infrastructure:

Open Tripadvisor Places & Ratings Data Scraper on Apify

Responsible use

Use the returned data lawfully and respect the terms, access rules, database rights and privacy obligations that apply to your use case. Protect exported Datasets, minimize retention and do not commit API tokens or other credentials to this repository.

Support

For a problem with these examples, open a GitHub issue with the command, sanitized input and error message. For an execution problem, include the Apify run ID but never include your token.

License

This repository is released under the MIT License. It contains integration examples and sanitized samples; the hosted Actor is operated separately on Apify.

About

Python, JavaScript and cURL examples for collecting structured Tripadvisor places through Apify.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors