Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

TripAdvisor Review Scraper

Scrape TripAdvisor hotel reviews in Python or Node.js and export them to CSV or JSON — no proxies, no CAPTCHAs, no brittle HTML parsing.

Open In Colab License: MIT Powered by StayAPI

This scraper uses the StayAPI REST API under the hood: one HTTP call returns clean, structured review JSON for any hotel on TripAdvisor — StayAPI handles proxies, bot-detection, and page rendering server-side. Sign up for 50 free requests for testing the API.

Quickstart (60 seconds)

# 1. Get a free API key (50 free requests for testing the API): https://stayapi.com/users/sign_up
# 2. Install and run:
git clone https://github.com/stayapi/tripadvisor-review-scraper.git
cd tripadvisor-review-scraper
pip install -r requirements.txt
export STAYAPI_KEY="your-key"
python tripadvisor_review_scraper.py 187686 # The Savoy, London → CSV

Output:

Page 1: 20 reviews (total 20 of 7943)
Page 2: 20 reviews (total 40 of 7943)
...
Wrote 100 reviews to tripadvisor_reviews_187686.csv

Have a TripAdvisor URL instead of an ID? Pass it directly — the ID is parsed locally, no extra API request:

python tripadvisor_review_scraper.py "https://www.tripadvisor.com/Hotel_Review-g186338-d187686-Reviews-The_Savoy-London_England.html"

What you get

Reviews arrive newest-first as structured JSON with full text, ratings, reviewer profiles, and trip details (full sample →):

{
 "id": 1072501577,
 "rating": 5,
 "title": "Exceptional Afternoon Tea — The Service Made It Truly Special",
 "text": "What a wonderful experience. Afternoon tea was one of the things I was most looking forward to during our trip to London...",
 "language": "en",
 "published_date": "2026年08月10日",
 "helpful_votes": 0,
 "user": {
 "display_name": "Travel JunKie",
 "contribution_count": 76
 },
 "trip_info": {
 "stay_date": "2026年08月31日",
 "trip_type": "COUPLES"
 }
}

The CSV export flattens this to one row per review (sample CSV →) with columns: review_id, rating, title, text, language, published_date, stay_date, trip_type, reviewer_name, reviewer_hometown, reviewer_contributions, helpful_votes, photo_count.

Recipes

# All reviews for a hotel (0 = no limit; 20 reviews per API request)
python tripadvisor_review_scraper.py 187686 --max-reviews 0
# Only critical reviews (3 stars or below) — complaint mining
python tripadvisor_review_scraper.py 187686 --max-rating 3 --csv complaints.csv
# English-only reviews (TripAdvisor language codes: en, ja, es, fr, de, it, zhTW, ru, th...)
python tripadvisor_review_scraper.py 187686 --language en
# Raw JSON alongside the CSV (for your own pipeline)
python tripadvisor_review_scraper.py 187686 --json reviews.json

Reviews are always returned in publication-date order, newest first — paginate until you reach your date cutoff for period-based backfills.

Node.js version

Node 18+ with zero dependencies — the API does the heavy lifting:

cd node
export STAYAPI_KEY="your-key"
node scraper.js 187686 --max-reviews 100

Getting a location ID

Every TripAdvisor hotel URL contains the location ID as the -d segment:

https://www.tripadvisor.com/Hotel_Review-g186338-d187686-Reviews-The_Savoy-London_England.html
 ^^^^^^^ location ID: 187686

Pass either the full URL or the number — the scraper handles both.

Related

License

MIT. Review content belongs to its authors and TripAdvisor; use responsibly and respect applicable laws and terms.

About

Scrape TripAdvisor hotel reviews in Python or Node.js — no proxies, no CAPTCHAs. CSV export, 50 free requests. Powered by StayAPI (stayapi.com)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /