# Trustpilot Reviews Scraper — Full Pagination (`evanatlasx/trustpilot-reviews-scraper`) Actor

Scrape Trustpilot company reviews with real page-by-page pagination, star/language filters and dedupe. $0.0005 per review.

- **URL**: https://apify.com/evanatlasx/trustpilot-reviews-scraper.md
- **Developed by:** [evanatlasx](https://apify.com/evanatlasx) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 review scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Trustpilot Reviews Scraper

Scrape **public** Trustpilot company reviews with **real pagination** — it keeps paging (20 reviews per page) until `maxReviews` or the last page, instead of stopping after page one.

- Input a Trustpilot review URL (`https://www.trustpilot.com/review/www.apple.com`) or just a domain (`apple.com` — Trustpilot's own redirect resolves it to `www.apple.com`).
- Filter by star rating and review language, sort by most recent or most relevant.
- De-duplicated by `companyDomain + reviewId`.
- Invalid / unknown companies are logged and skipped; the run continues with the next company.
- Pay-per-event: one `review-scraped` event per review pushed to the dataset.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `companyUrls` | string\[] | — (required) | Review URLs or domains |
| `maxReviews` | integer | 50 | Per company, max 500 |
| `stars` | integer\[] | all | Any of 1–5 |
| `language` | string | Trustpilot default | e.g. `en`, `de` (sent as `languages=` filter) |
| `sortBy` | `recency` | `relevance` | `recency` | `relevance` = Trustpilot's default ordering |
| `requestDelayMs` | integer | 600 | Pause between page requests |

```json
{ "companyUrls": ["https://www.trustpilot.com/review/www.apple.com", "booking.com"], "maxReviews": 100, "stars": [1, 2] }
```

### Output

One dataset item per review:

```json
{
  "companyUrl": "https://www.trustpilot.com/review/www.apple.com",
  "companyDomain": "www.apple.com",
  "reviewId": "6ae28042249d9d9b014b4328",
  "rating": 4,
  "title": "…",
  "text": "…",
  "date": "2026-10-29T01:07:46.000Z",
  "experiencedDate": "2026-09-29T00:00:00.000Z",
  "language": "en",
  "countryCode": "US",
  "isVerified": false,
  "authorName": "…",
  "authorId": "69823c42508003ca728ad78d",
  "replyText": null,
  "replyDate": null,
  "reviewUrl": "https://www.trustpilot.com/reviews/6ae28042249d9d9b014b4328",
  "scrapedAt": "2026-10-30T06:44:06.692Z"
}
```

A `RUN_SUMMARY` record in the default key-value store lists per-company counts, pages fetched and skipped companies with their error / HTTP status.

### How it works

Reviews are read from the JSON that Trustpilot's own website (Next.js) loads for each review page: `/_next/data/<buildId>/review/<domain>.json?page=N&stars=…&languages=…&sort=…`. No login, no private API, no paywall bypass.

Trustpilot fronts its site with an AWS WAF **JavaScript challenge**. Plain HTTP clients usually get `HTTP 403 "Verifying your connection"`. When that happens the Actor opens one public review page in a regular Google Chrome via `playwright-core` (no stealth plugins, no CAPTCHA solving), lets it load as for any visitor, then reuses that browser's cookies for fast plain-HTTP pagination. The session is refreshed automatically if the token expires (403) or Trustpilot deploys a new build (404). Locally the session is cached for 20 minutes in the OS temp dir.

Network errors, HTTP 429 and 5xx are retried 3 times with exponential backoff (honouring `Retry-After`).

### Limitations

- **Public reviews only.** Only what Trustpilot shows anonymously on the public review page is collected. Trustpilot caps listing depth (e.g. ~100 pages when a star filter is applied).
- **Anti-bot protection.** Trustpilot may block automated traffic. In testing, plain HTTP got 403 from the WAF and **headless** Chrome was rejected as a bot; only a **headed** Chrome passed. The browser fallback therefore needs Google Chrome and a display (macOS/Windows desktop, or Linux with `DISPLAY`/Xvfb). The spec-mandated `apify/actor-node:20` image has **no Chrome** — on the Apify platform the Actor only works if plain HTTP is not challenged from the platform's IPs; otherwise each company fails with a clear 403 error. Using `apify/actor-node-playwright-chrome:20` (with Xvfb) would enable the fallback, but this has not been verified on the platform.
- **Structure-change risk.** The Actor depends on Trustpilot's internal Next.js data format and URL parameters (`page`, `stars`, `languages`, `sort`). Any site redesign may break it until updated.
- Headed Chrome means a browser window briefly opens when running locally.
- Respect Trustpilot's Terms of Service and applicable law (e.g. GDPR — reviews contain personal names) when using the data.

### Local development

```bash
npm install
node test/acceptance.js          # acceptance checks -> test/results.json
## or run the Actor with local storage (no Apify account needed):
mkdir -p storage/key_value_stores/default
echo '{"companyUrls":["apple.com"],"maxReviews":50}' > storage/key_value_stores/default/INPUT.json
npm start
```

# Actor input Schema

## `companyUrls` (type: `array`):

Trustpilot review page URLs (e.g. https://www.trustpilot.com/review/www.apple.com) or plain company domains (e.g. apple.com), which are turned into review URLs automatically.

## `maxReviews` (type: `integer`):

Maximum number of reviews to return for each company. Pages through results (20 per page) until this number or the last page is reached.

## `stars` (type: `array`):

Only return reviews with these star ratings (1-5). Leave empty for all ratings.

## `language` (type: `string`):

Optional two-letter language code (e.g. en, de). Passed to Trustpilot's language filter. Leave empty for Trustpilot's default.

## `sortBy` (type: `string`):

"recency" returns newest reviews first; "relevance" uses Trustpilot's default ordering.

## `requestDelayMs` (type: `integer`):

Pause between consecutive page requests to stay polite and avoid rate limiting.

## Actor input object example

```json
{
  "companyUrls": [
    "https://www.trustpilot.com/review/www.apple.com"
  ],
  "maxReviews": 50,
  "sortBy": "recency",
  "requestDelayMs": 600
}
```

# Actor output Schema

## `reviews` (type: `string`):

Scraped reviews (overview table).

## `reviewsFull` (type: `string`):

No description

## `summary` (type: `string`):

Per-company review counts, pages fetched and errors for skipped companies.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "companyUrls": [
        "https://www.trustpilot.com/review/www.apple.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("evanatlasx/trustpilot-reviews-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "companyUrls": ["https://www.trustpilot.com/review/www.apple.com"] }

# Run the Actor and wait for it to finish
run = client.actor("evanatlasx/trustpilot-reviews-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "companyUrls": [
    "https://www.trustpilot.com/review/www.apple.com"
  ]
}' |
apify call evanatlasx/trustpilot-reviews-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,evanatlasx/trustpilot-reviews-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WgjVhWbxlQe9uCHqF/builds/uYDKLlJKic28iBc1J/openapi.json
