How to Collect Hotel Review Data by Language and Country

Published:

12 minute read

Enver Kaya
Written by: Enver Kaya
Hotel review card with language tabs, the selected DE tab in blue; stars, date and trip type shown, reviewer name hidden

Hotel review data collection turns a hotel's reviews into a clean table with rating, date, language and text fields. The same hotel's review list can come back in a different order depending on the visitor's language and country. A team that looks from one market sees complaints from other markets late, or never. This post covers the official API option, the fields to store, pagination and deduplication, and language detection.

Official partner APIs

The cleanest source of review data is the API a platform opens to its partners. An API returns typed fields, does not break when the page design changes, and states its terms of use up front. Two examples are publicly documented:

  • Tripadvisor Content API. The reviews endpoint returns the 5 most recent reviews for a location. Each review has a rating, publish date, trip_type, lang, the text and an is_machine_translated field.
  • Google Places API. Place details include up to 5 reviews. Each review carries the localized text in text and the text in its original language in originalText.

These limits matter. Five reviews are not a hotel's full history, they are a current sample. If you need the full archive, look at the booking platform's partner portal, the hotel's own review management tool or a licensed data source.

Move to collecting from pages only when none of these does the job. In that case, follow the site's terms and its robots.txt file, and keep requests slow.

Sorting by language and country

A review list is not a fixed list. It is a view built for the visitor. Sites usually read the language from the browser's Accept-Language header. They infer the country from the IP address, sometimes from the domain or a URL parameter. These signals can change the following in the list:

SignalWhat can change in the list
Language header or language parameterReviews in the visitor's language move up, or only those are shown
Country (IP address)Default order and the featured review selection
Translation settingA foreign-language review appears machine-translated into your language
"Most relevant" sortingThe platform's own weights, different results per market

The result: a team looking from Türkiye with a Turkish browser may see German guests' reviews at the end of the list, or translated. Which signal changes what differs from site to site. Test each target yourself. Pricing is a separate topic, covered in Do Hotel Prices Change by Country?.

For comparison, pin language and country together. To see the German market, use an IP that exits in Germany and a de-DE language header in the same request. You pick the country for the Residential Proxy in the dashboard, and you add the language header to the request:

bash
curl -s -x http://user:pass@pr.proxynet.io:8000 \
  -H "Accept-Language: de-DE,de;q=0.9,en;q=0.5" \
  "https://hotel-site.example/hotel/123/reviews?sort=newest&page=1"

Select "newest" sorting explicitly in the URL. "Most relevant" returns different results in each market. When two runs differ, you cannot tell whether the cause is the market or the sorting.

Fields to store

Each review is one row, and the row is limited to the fields the analysis needs. The rule is simple: every field should answer a question. The rating answers "is satisfaction dropping", the trip type answers "are families complaining".

FieldExampleNote
Review IDr1The deduplication key
Rating and scale4 / 5Store the scale separately, some sites rate out of 10
Dates2026-11-02Publish date required, stay date if available
Trip typeFamilyFamily, couple, business, solo, friends
Languagetr / trTwo columns: the platform's label and your detection
Translation flagfalseStore only the original text
TextOriginal languageNot the translated text
Market and timeDE/de, 2026-12-03Which country and language setting you saw the list with, and when

The two date fields say different things. The publish date is the day the review was written. The stay date can be weeks earlier, and it is the right field for seasonal analysis. If a relative date such as "a month ago" comes in, convert it to a real date at collection time. The next day, the same phrase points to a different day.

The market column is the one most often forgotten. Review data is usually part of a market research project, and comparisons run through this column. You can also store whether the hotel replied to the review as yes/no.

Reviewer names and personal fields

The reviewer name, profile photo and profile link add nothing to the analysis. If the question is "are cleanliness complaints rising at this hotel", the answer is in the text and the date, not in who wrote it. Leaving these fields out from the start has practical benefits:

  • The table stays lean. The schema shrinks, and every column has a use.
  • Deduplication holds. When a user changes their profile name, the same review shows up under two names. If you deduplicate by name, you miss the copies.
  • The leak surface shrinks. A field that is not in your table cannot leak.

Do not keep the raw HTML or raw JSON response either. It contains names and profile links. Delete the raw response once the fields are parsed.

The reviewer's country is usually unnecessary too. For market analysis, look at the review's language and the market you saw the list in.

Pagination and duplicate reviews

Review lists are usually paginated by offset: page 2 means "skip the first 10 reviews, give me the next 10". If a new review is published while collection runs, the list shifts by one. The last review on page 1 shows up again at the top of page 2. This is the most common source of duplicates.

Duplicate sourceSymptomFix
Shifting offsetSame review on two pagesDeduplicate by review ID
Machine translationSame review in two languagesDrop the copy flagged as translated
Multiple marketsSame review in the DE and TR listLeave the market out of the key
Page without IDsSame text with whitespace differencesHash of normalized text, date and rating

Do not collect the whole list from scratch on every run. Start with "newest" sorting and stop when you see the newest review ID you already stored. Each run then fetches only new reviews, and the request count drops. Pagination types and stop conditions are covered in What Is Pagination?.

If the IP changes between pages, the site sees two separate visitors. If the sorting is tied to a cookie, the second page may come from a different order. Collect one hotel's pages in a single flow and keep the exit IP fixed for the whole flow. A Sticky Proxy does this for a duration you choose between 1 and 60 minutes.

Language detection

The platform's language label and the language of the text are not always the same. The label may come from the interface the review was written in, or from the platform's own guess. A review written in Turkish can appear with an English label. So detect the language from the text yourself and keep the platform label in a separate column.

Short text is the real trap. "Super!" is spelled the same in a Turkish, German and English review. The lingua library's documentation also notes that the probability gap between languages shrinks as text gets shorter. Do not invent a language for short or ambiguous text. Mark it as und (undetermined).

The code below reduces a raw review to the field list, detects the language and removes duplicates:

python
import hashlib
import re
import unicodedata

from lingua import Language, LanguageDetectorBuilder

# Load only the languages you collect: faster and more accurate
LANGUAGES = [Language.TURKISH, Language.ENGLISH, Language.GERMAN,
             Language.RUSSIAN, Language.ARABIC]
detector = (LanguageDetectorBuilder.from_languages(*LANGUAGES)
            .with_minimum_relative_distance(0.25)
            .build())

# Fields to store; reviewer name, photo and profile link are not on the list
FIELDS = ("review_id", "rating", "published", "trip_type",
          "lang", "translated", "text")


def normalize(text):
    text = unicodedata.normalize("NFKC", text)
    return re.sub(r"\s+", " ", text).strip().lower()


def detect_lang(text):
    if len(text) < 20:          # guesses on short text are unreliable
        return "und"
    lang = detector.detect_language_of(text)
    return lang.iso_code_639_1.name.lower() if lang else "und"


def record(raw, hotel_id, market):
    r = {field: raw.get(field) for field in FIELDS}
    r["hotel_id"] = hotel_id
    r["market"] = market        # which country/language setting you saw the list with
    r["lang_detected"] = detect_lang(r["text"] or "")
    return r


def key(r):
    if r["review_id"]:
        return f'{r["hotel_id"]}:{r["review_id"]}'
    digest = "|".join([r["hotel_id"], str(r["published"]),
                       str(r["rating"]), normalize(r["text"] or "")])
    return hashlib.sha256(digest.encode("utf-8")).hexdigest()


def dedupe(records):
    unique = {}
    for r in records:
        if r["translated"]:     # skip the machine-translated copy
            continue
        unique.setdefault(key(r), r)
    return list(unique.values())

record() copies only the fields in the FIELDS list. Even if the raw response has a user object, it never reaches the table. key() uses the platform's review ID first. Without an ID, it builds a hash from the normalized text, date and rating. with_minimum_relative_distance(0.25) rejects the guess when two languages score too close and returns None. The 20-character threshold is our choice, tune it to your own data.

In our test, eight raw records came down to five. Two exact copies and one machine-translated copy were dropped. The copy without an ID and with a whitespace difference was caught by the normalized hash. "Super!" was marked und. A Turkish review with the platform label en was detected as tr.

Troubleshooting

When the collected table differs from what you expect, the problem is usually in the request's market signal or in the deduplication key.

SymptomLikely causeWhat to do
Same first page in every marketLanguage or country does not reach the requestCheck the exit IP's country and the language parameter in the URL
Total lower than the site showsThe list shows only one languageSet the language filter to "all languages"
High duplicate rateKey relies on the name or translated textSwitch to the review ID, drop translations
Dates shift every dayRelative dates not convertedConvert to real dates at collection time
Many und valuesShort reviews or an incomplete language listWiden the language list, accept short text as is
429 responseRequest rate too highSlow down, lengthen the intervals

How we tested

On 3 December 2026 we used Python 3.13.17, lingua-language-detector 2.2.0 and curl 8.23.0 on Windows 11. We ran the deduplication code on an eight-row synthetic review set. The set had two exact copies, one machine-translated copy, a copy without an ID that differed only in whitespace, a short text and a review whose label did not match its text.

We tried the curl command through a local test proxy that required a password and logged incoming headers. The Accept-Language header reached the target unchanged, and a wrong password returned 407. We did not collect from a real hotel site. The signals in the sorting table describe the mechanism, not a measurement.

The bottom line

Check the official API first. If it is not enough, collect each market with the country and language signals pinned together, with "newest" sorting, and deduplicate by review ID. Above all, do not lose the market column or the original text. The next step after a clean table is sentiment analysis, covered in Sentiment Analysis in Python.

Sources

Frequently asked questions

Which API is used to collect hotel reviews?

The platform's partner API. The Tripadvisor Content API and the Google Places API return reviews with rating, date and language fields. Both give at most five reviews per request, so they offer a current sample, not a full archive. If you need the full history, look at the booking platform's partner portal or the hotel's review management tool.

Why are the same hotel's reviews sorted differently by country?

The list is built for the visitor. The site reads the language from the browser's Accept-Language header and the country from the IP address. It may move reviews in the visitor's language up, translate foreign reviews or weight "most relevant" sorting by market. For comparison, pin language and country in the same request and choose "newest" sorting. Which signal changes what differs from site to site, so test each target yourself.

Do I need to store the reviewer's name?

No. Analysis questions are answered from the text, rating, date and language, not from who wrote it. A name bloats the table, breaks deduplication when the user changes their profile and adds a field that can leak. Base deduplication on the platform's review ID. Delete the raw HTML or JSON response once the fields are parsed.

Should machine-translated reviews be stored?

No, store only the original text. A translation is a second copy of the same review and inflates language counts. If the API gives a translation flag (such as is_machine_translated), drop the flagged copy. In Google Places, use the originalText field instead of text. If you collect from pages, turn off the site's translation setting. If you need translations, do them yourself at analysis time with a single tool.

How do you detect the language of short reviews?

Often you cannot, at least not reliably. One-word reviews such as "Super!" or "Great" are spelled the same in several languages. Mark these texts as und (undetermined) and leave them out of language comparisons. Their ratings can still count toward the overall average. Load only the languages you collect into the detection library. That way it cannot assign the text to unrelated languages it might confuse it with.

Which proxy type suits review collection?

A residential proxy with country targeting. An IP that exits in the target country shows the list a visitor in that market sees. Use a sticky session to keep the exit IP fixed while you collect one hotel's pages, and pick a duration between 1 and 60 minutes to match the length of the flow. Match the language header to the market's language on every request.

Ask ChatGPTAsk Claude