DEV Community

Himanshu Agrawal
Himanshu Agrawal

Posted on

Trustpilot Reviews API in Python: Get Any Company's Reviews and Find the Top Complaints

Disclosure: I built the Trustpilot Reviews API used in this guide and earn from its paid plans on RapidAPI.

If you are building a product in a crowded market, your competitors' one-star reviews are the best free research you will find: real customers listing what made them angry enough to write. The same goes for your own brand, where a bad review answered in hours reads very differently from one left alone for a week.

Reading reviews by hand stops working after the first dozen. Trustpilot's own APIs start with a Trustpilot Business account, and its product for reading other companies' reviews (Data Solutions) begins with a waitlist. This guide uses a Trustpilot Reviews API on RapidAPI with plain requests, and no Trustpilot account. As a real example, it looks at a big web host, Hostinger: its overall rating, its latest 100 one- and two-star reviews, how fast it answers them and what the complaints are about.

Setup

Subscribe to the Basic plan on the API page (free, 50 requests a month) and copy your x-rapidapi-key. Keep it out of your code:

export RAPIDAPI_KEY="your-key"
Enter fullscreen mode Exit fullscreen mode

On Windows, use set RAPIDAPI_KEY=your-key. One helper covers both endpoints:

import os
import requests

HOST = "trustpilot-reviews-api3.p.rapidapi.com"
HEADERS = {"x-rapidapi-host": HOST, "x-rapidapi-key": os.environ["RAPIDAPI_KEY"]}


def get(path, **params):
    resp = requests.get(f"https://{HOST}{path}", params=params, headers=HEADERS, timeout=90)
    resp.raise_for_status()
    return resp.json()["data"]
Enter fullscreen mode Exit fullscreen mode

Step 1: The company at a glance

company takes the domain shown on the company's Trustpilot page, its website URL or a Trustpilot review link.

company = get("/trustpilot/v1/company", company="hostinger.com")
total = company["totalReviews"]
print(f"{company['companyName']}: TrustScore {company['trustScore']}, {total:,} reviews "
      f"({company['reviewsLast12Months']:,} in the last 12 months)")
for stars in ["5", "4", "3", "2", "1"]:
    n = company["ratingDistribution"][stars]
    print(f"  {stars}-star {n:>7,} {n / total:>6.1%}")
Enter fullscreen mode Exit fullscreen mode

Output (run on 11 November 2026):

Hostinger: TrustScore 4.6, 73,948 reviews (16,799 in the last 12 months)
  5-star  64,355  87.0%
  4-star   3,160   4.3%
  3-star     654   0.9%
  2-star     567   0.8%
  1-star   5,212   7.0%
Enter fullscreen mode Exit fullscreen mode

A 4.6 TrustScore with 87% five-star reviews looks great, and it is. But 7% one-star reviews out of nearly 74,000 is still more than 5,000 unhappy customers, and that is the part worth reading.

Step 2: The latest bad reviews

bad = get("/trustpilot/v1/reviews", company="hostinger.com", stars="1,2", sort="recency", limit=100)
print(f"{len(bad)} one- and two-star reviews, published {bad[-1]['publishedDate'][:10]} to {bad[0]['publishedDate'][:10]}")
Enter fullscreen mode Exit fullscreen mode
100 one- and two-star reviews, published 2026-10-27 to 2026-11-10
Enter fullscreen mode Exit fullscreen mode

That is 100 bad reviews in two weeks. One call returns up to 100 reviews, newest first. Each comes with its rating, title, full text, dates, author country, language, verification status, likes, the company's reply and a link. This call took about 33 seconds, the slowest one in this guide, which is why the helper waits up to 90 seconds.

Step 3: How fast does the company answer?

from datetime import datetime
from statistics import median


def parse(ts):
    return datetime.fromisoformat(ts.replace("Z", "+00:00"))


answered = [r for r in bad if r["replyDate"]]
hours = [(parse(r["replyDate"]) - parse(r["publishedDate"])).total_seconds() / 3600 for r in answered]
print(f"Answered: {len(answered)} of {len(bad)}, median reply time {median(hours):.0f} hours")

waiting = [r for r in bad if not r["replyDate"]]
if waiting:
    print(f"Not answered yet: {len(waiting)}, all published since {min(r['publishedDate'] for r in waiting)[:10]}")
Enter fullscreen mode Exit fullscreen mode
Answered: 91 of 100, median reply time 22 hours
Not answered yet: 9, all published since 2026-11-09
Enter fullscreen mode Exit fullscreen mode

Hostinger answers almost every bad review, usually within a day, and the 9 without a reply were all less than two days old. That is a high bar: if you compete with them, slow replies on your own profile will stand out. The company call also returns Trustpilot's own figures, replyPercentage (the share of negative reviews answered) and averageDaysToReply: 98.9% and 0.79 days here, in line with this sample.

Step 4: What are people complaining about?

A keyword list per topic gets you a first answer in a few lines:

TOPICS = {
    "AI bot instead of a human": ["human", "real person", "chatbot", "robot",
                                  "ai assistant", "ai agent", "ai support", "ai bot", "ai chat"],
    "refund or billing": ["refund", "charged", "billing", "renew", "invoice", "cancel"],
    "account suspended or locked": ["suspend", "locked", "blocked"],
    "domain or DNS": ["domain", "dns"],
    "site down or data lost": ["offline", "downtime", "deleted", "lost", "backup"],
    "ID verification": ["verification", "verify", "identity"],
}

english = [r for r in bad if r["language"] == "en"]
counts = {topic: 0 for topic in TOPICS}
for r in english:
    text = f"{r['title'] or ''} {r['text'] or ''}".lower()
    for topic, words in TOPICS.items():
        if any(w in text for w in words):
            counts[topic] += 1

print(f"Complaint topics in {len(english)} English reviews:")
for topic, n in sorted(counts.items(), key=lambda kv: kv[1], reverse=True):
    print(f"  {topic:<29}{n:>3}  {n / len(english):.0%}")
Enter fullscreen mode Exit fullscreen mode
Complaint topics in 79 English reviews:
  AI bot instead of a human     38  48%
  refund or billing             30  38%
  account suspended or locked   21  27%
  domain or DNS                 21  27%
  site down or data lost        17  22%
  ID verification               11  14%
Enter fullscreen mode Exit fullscreen mode

Nearly half of these English reviews (38 of 79) talk about a chatbot, an AI assistant or not reaching a human, and refunds or billing come second. If you compete in hosting, "a human answers your ticket" is a pitch these customers just wrote for you. The other 21 reviews are in French, Spanish, German and other languages, which English keywords cannot see.

Step 5: Get new bad reviews every morning

For your own brand, the job that matters is spotting new bad reviews while you can still help. since returns only reviews published from a date on, so a daily cron job only needs this:

from datetime import date, timedelta


def new_bad_reviews(domain):
    """One- and two-star reviews published since yesterday (UTC dates)."""
    since = (date.today() - timedelta(days=1)).isoformat()
    return get("/trustpilot/v1/reviews", company=domain, stars="1,2", since=since, limit=100)
Enter fullscreen mode Exit fullscreen mode

Post each result's title, rating and reviewUrl to Slack or email, and someone on your team sees it the same morning.

What it costs

Each call is one request, so this tutorial used 2 of the 50 free monthly requests on the Basic plan, and the daily alert uses about 30 a month. If you need more: Pro is $9.99 a month for 1,000 requests, Ultra $29.99 for 3,000 and Mega $99 for 10,000.

Limits worth knowing

  • Up to 100 reviews per call, newest first. sort="relevance" uses Trustpilot's own order instead.
  • Filters: stars (for example 1,2), language (en, de and so on), since (YYYY-MM-DD) and verified=true.
  • Reviews are cached for 1 hour and company details for 6 hours, so a repeat call within that time returns at once with "cached": true.
  • The data source is sometimes slow. One of my company calls timed out with a 502; the retry came back in 7 seconds. Retry a 502 or 504 once before you give up.
  • Keyword buckets are rough: they miss synonyms and other languages. For better tagging, send the review text and your topic list to an LLM.
  • These are public reviews, but they are written by people. Follow Trustpilot's terms and your privacy law, and don't republish reviewer names.

Note: this tutorial was written with AI assistance. The outputs are from real API calls, and the code was tested against those responses.

Top comments (0)