# Truspilot Reviews Scraper (`unlimitedleadtestinbox/truspilot-reviews-scraper`) Actor

Easily filter and extract thousands of reviews with data such as title, description, score, reviewer, country, company response, and much more from companies on Trustpilot.com and download them to multiple file formats.

- **URL**: https://apify.com/unlimitedleadtestinbox/truspilot-reviews-scraper.md
- **Developed by:** [unli](https://apify.com/unlimitedleadtestinbox) (community)
- **Categories:** Lead generation, E-commerce
- **Features:** Limited permissions
- **Stats:** 24 total users, 4 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

This Apify actor scrapes reviews from Trustpilot company pages with automatic pagination support. It extracts comprehensive data from each review including ratings, review text, author information, dates, and company details.

### Features

- ✅ Automatic pagination through all review pages
- ✅ Extracts comprehensive review data from JSON-LD structured data
- ✅ Respects rate limits with built-in delays
- ✅ Handles errors gracefully
- ✅ Configurable page limits and start page
- ✅ Detailed logging and statistics

### Input

The actor accepts the following input parameters:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `trustpilotUrl` | String | Yes | The URL of the Trustpilot company page (e.g., `https://www.trustpilot.com/review/www.amazon.com`) |
| `maxPages` | Integer | No | Maximum number of pages to scrape. Leave empty to scrape all pages. |
| `startPage` | Integer | No | Page number to start scraping from (default: 1) |

#### Example Input

```json
{
  "trustpilotUrl": "https://www.trustpilot.com/review/www.amazon.com",
  "maxPages": 10,
  "startPage": 1
}
```

### Output

The actor outputs a dataset where each item represents a single review with the following structure:

```json
{
  "reviewId": "123abc...",
  "author": {
    "name": "John Doe",
    "profileUrl": "https://www.trustpilot.com/users/..."
  },
  "rating": 5,
  "title": "Great service!",
  "text": "I had an amazing experience...",
  "date": "2024-01-15T10:30:00Z",
  "language": "en",
  "company": {
    "name": "Amazon",
    "url": "https://www.amazon.com",
    "aggregateRating": {
      "rating": 4.5,
      "reviewCount": 150000,
      "bestRating": 5,
      "worstRating": 1
    }
  },
  "source": "trustpilot",
  "pageUrl": "https://www.trustpilot.com/review/www.amazon.com?page=1",
  "extractedAt": "2024-01-20T15:45:00.000Z"
}
```

#### Output Fields

- **reviewId**: Unique identifier for the review
- **author.name**: Name of the review author
- **author.profileUrl**: Link to the author's Trustpilot profile
- **rating**: Star rating (1-5)
- **title**: Review headline/title
- **text**: Full review text
- **date**: Date when the review was published (ISO format)
- **language**: Language code of the review
- **company.name**: Name of the company being reviewed
- **company.url**: Company's website URL
- **company.aggregateRating**: Overall rating statistics for the company
- **source**: Always "trustpilot"
- **pageUrl**: URL of the page where the review was found
- **extractedAt**: Timestamp of when the data was extracted

### How It Works

1. The actor starts by fetching the first page (or the specified `startPage`)
2. It extracts all reviews from the JSON-LD structured data on the page
3. Reviews are saved to the dataset
4. If more reviews are found, it moves to the next page
5. Process continues until:
   - No more reviews are found
   - The `maxPages` limit is reached
   - An error occurs (after the first page)

### Usage Tips

#### Scraping All Reviews

To scrape all available reviews, simply provide the Trustpilot URL:

```json
{
  "trustpilotUrl": "https://www.trustpilot.com/review/www.example.com"
}
```

#### Limiting Pages

To scrape only the first 5 pages:

```json
{
  "trustpilotUrl": "https://www.trustpilot.com/review/www.example.com",
  "maxPages": 5
}
```

#### Starting from a Specific Page

To resume scraping from page 10:

```json
{
  "trustpilotUrl": "https://www.trustpilot.com/review/www.example.com",
  "startPage": 10
}
```

### Rate Limiting

The actor includes a 1-2 second delay between page requests to be respectful to Trustpilot's servers. This helps prevent your requests from being blocked.

### Error Handling

- If the first page fails to load, the actor will throw an error
- If subsequent pages fail, the actor will log the error and stop pagination gracefully
- All successfully scraped reviews are saved before any error occurs

### Limitations

- The actor extracts data from publicly available JSON-LD structured data
- Only reviews visible on the public pages are scraped
- The actor respects Trustpilot's robots.txt and rate limits

### Example Use Cases

1. **Competitor Analysis**: Monitor competitor reviews and ratings
2. **Brand Monitoring**: Track your company's reputation over time
3. **Market Research**: Analyze customer sentiment across multiple companies
4. **Data Analysis**: Export reviews for sentiment analysis and NLP projects

### Support

If you encounter any issues or have questions, please open an issue on the actor's GitHub repository or contact the developer.

### Legal Notice

This actor is provided for educational and research purposes. Please respect Trustpilot's Terms of Service and use this tool responsibly. Ensure you have the right to scrape and use the data according to applicable laws and regulations.

# Actor input Schema

## `trustpilotUrl` (type: `string`):

Full Trustpilot company URL (e.g., https://www.trustpilot.com/review/www.amazon.com)

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

Maximum number of reviews to scrape (1-100)

## Actor input object example

```json
{
  "trustpilotUrl": "https://www.trustpilot.com/review/www.apple.com",
  "maxReviews": 20
}
```

# 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 = {
    "trustpilotUrl": "https://www.trustpilot.com/review/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("unlimitedleadtestinbox/truspilot-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 = { "trustpilotUrl": "https://www.trustpilot.com/review/" }

# Run the Actor and wait for it to finish
run = client.actor("unlimitedleadtestinbox/truspilot-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 '{
  "trustpilotUrl": "https://www.trustpilot.com/review/"
}' |
apify call unlimitedleadtestinbox/truspilot-reviews-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unlimitedleadtestinbox/truspilot-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/QH9GU4DM1P7KOYd0b/builds/kjL0uCR5HhBaEmrVK/openapi.json
