# Trustpilot Scraper (`mm_actors/trustpilot-apify-actor`) Actor

Scrape reviews from Trustpilot.

- **URL**: https://apify.com/mm\_actors/trustpilot-apify-actor.md
- **Developed by:** [MedMatch Team](https://apify.com/mm_actors) (community)
- **Categories:** E-commerce, Lead generation, News
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Trustpilot Reviews Scraper

Scrape customer reviews for any business listed on Trustpilot. This Apify actor uses Chrome impersonation via `curl_cffi` with your browser cookies to bypass bot detection and extract structured review data.

### Capabilities

- Scrape reviews from any Trustpilot business page
- Extract both recent and historical reviews
- Get structured data including:
  - Review text and titles
  - Star ratings (1-5)
  - Reviewer names and country
  - Review dates
  - Review language
  - Business reply text and date
- Filter by date range or number of pages
- Filter by review language
- Chrome impersonation with injected cookies for reliable access

### Input Format

Provide input in JSON format with the following parameters:

```json
{
  "tp_domain": "nike.com",
  "page_count": 10,
  "languages": "all",
  "cookies": [
    {
      "name": "session",
      "value": "abc123",
      "domain": ".trustpilot.com",
      "path": "/"
    }
  ]
}
````

- `tp_domain` (required): The business slug from the Trustpilot URL, e.g. `nike.com` from `trustpilot.com/review/nike.com`
- `cookies` (required): Your Trustpilot browser cookies — see [Passing Cookies](#passing-cookies) below
- `page_count` (optional): Maximum number of review pages to scrape (20 reviews per page). Leave blank when using date filtering.
- `start_date` (optional): Only keep reviews on or after this date (`YYYY-MM-DD`). Cannot be used together with `page_count`.
- `end_date` (optional): Only keep reviews on or before this date (`YYYY-MM-DD`). Defaults to today if `start_date` is set.
- `languages` (optional): Comma-separated language codes to filter reviews, e.g. `en,de,fr`. Defaults to `all`.
- `proxy_settings` (optional): Apify proxy configuration object.

### Passing Cookies

Trustpilot uses bot detection that requires valid browser cookies to access review pages reliably. You need to export cookies from a logged-in browser session and paste them into the `cookies` input field.

#### How to export cookies

1. Open [trustpilot.com](https://www.trustpilot.com) in Chrome or Firefox and log in (or simply browse normally to get session cookies set)
2. Install a browser extension such as [EditThisCookie](https://www.editthiscookie.com/) (Chrome) or [Cookie Quick Manager](https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/) (Firefox)
3. Click the extension icon while on `trustpilot.com` and export all cookies as JSON
4. Paste the exported array directly into the `cookies` field of the actor input

The exported format should look like this:

```json
[
  {
    "name": "OptanonConsent",
    "value": "...",
    "domain": ".trustpilot.com",
    "path": "/"
  },
  {
    "name": "tp.session",
    "value": "...",
    "domain": ".trustpilot.com",
    "path": "/"
  }
]
```

> **Note:** Cookies expire over time. If the actor starts returning errors or empty results, re-export fresh cookies from your browser.

### Date Filtering

When `start_date` is provided, the actor scrapes pages in recency order and stops once it encounters 10 consecutive reviews older than the start date. This means it may scrape more pages than strictly necessary — set a `page_count` cap alongside the date filter if you want to limit resource usage.

```json
{
  "tp_domain": "nike.com",
  "start_date": "2024-01-01",
  "end_date": "2024-03-31",
  "cookies": [...]
}
```

### Output Information

The actor returns a dataset of reviews with the following structure:

```json
{
  "ID": "abc123def456",
  "Reviewer": "Jane Smith",
  "Country": "GB",
  "Date": "2024-03-15",
  "Title": "Great product, fast delivery",
  "ReviewText": "Really happy with my purchase...",
  "Rating": 5,
  "Language": "en",
  "BusinessReply": "Thank you for your feedback!",
  "BusinessReplyDate": "2024-03-16",
  "ReviewURL": "https://www.trustpilot.com/reviews/abc123def456"
}
```

#### Field Descriptions

| Field | Description |
|-------|-------------|
| `ID` | Unique identifier for the review |
| `Reviewer` | Display name of the reviewer |
| `Country` | Two-letter country code of the reviewer |
| `Date` | Date the review was published (`YYYY-MM-DD`) |
| `Title` | Title of the review |
| `ReviewText` | Full text content of the review |
| `Rating` | Star rating (1–5) |
| `Language` | Language code of the review (e.g. `en`, `de`) |
| `BusinessReply` | Business response text, if any |
| `BusinessReplyDate` | Date the business responded (`YYYY-MM-DD`) |
| `ReviewURL` | Direct link to the review on Trustpilot |

### Usage

1. **Export cookies**: Follow the steps in [Passing Cookies](#passing-cookies) above
2. **Configure input**: Provide the `tp_domain`, your cookies, and optional page/date limits
3. **Run the actor**: Execute via the Apify platform, API, or CLI (`apify run`)
4. **Access results**: Retrieve structured review data from the dataset

For detailed usage instructions on Apify, see the [Apify documentation](https://docs.apify.com/platform).

# Actor input Schema

## `tp_domain` (type: `string`):

The business slug from the Trustpilot URL, e.g. 'example.com' from trustpilot.com/review/example.com

## `page_count` (type: `integer`):

Maximum number of review pages to scrape (20 reviews per page). Leave blank when using date filtering.

## `start_date` (type: `string`):

Only keep reviews on or after this date (YYYY-MM-DD). Requires scraping all pages until reviews are older than this date.

## `end_date` (type: `string`):

Only keep reviews on or before this date (YYYY-MM-DD). Defaults to today if start\_date is set.

## `cookies` (type: `array`):

Trustpilot cookies as a JSON array of {name, value, domain, path} objects. Export from browser DevTools or a cookie extension.

## `languages` (type: `string`):

Comma-separated language codes to filter reviews (e.g. 'en,de,fr'). Defaults to 'all'.

## `request_delay` (type: `number`):

Seconds to wait between page requests. Increase to reduce the chance of being blocked. Defaults to 0.5.

## `proxy_settings` (type: `object`):

Apify proxy configuration.

## Actor input object example

```json
{
  "languages": "all",
  "request_delay": 0.5
}
```

# Actor output Schema

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

Complete review data including reviewer info, ratings, business replies, and review URLs.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("mm_actors/trustpilot-apify-actor").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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call mm_actors/trustpilot-apify-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mm_actors/trustpilot-apify-actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Trustpilot Scraper",
        "description": "Scrape reviews from Trustpilot.",
        "version": "1.0",
        "x-build-id": "OlNdwpOh13JkbEoIk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mm_actors~trustpilot-apify-actor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mm_actors-trustpilot-apify-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/mm_actors~trustpilot-apify-actor/runs": {
            "post": {
                "operationId": "runs-sync-mm_actors-trustpilot-apify-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/mm_actors~trustpilot-apify-actor/run-sync": {
            "post": {
                "operationId": "run-sync-mm_actors-trustpilot-apify-actor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "tp_domain",
                    "cookies"
                ],
                "properties": {
                    "tp_domain": {
                        "title": "Trustpilot Domain",
                        "type": "string",
                        "description": "The business slug from the Trustpilot URL, e.g. 'example.com' from trustpilot.com/review/example.com"
                    },
                    "page_count": {
                        "title": "Number of Pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of review pages to scrape (20 reviews per page). Leave blank when using date filtering."
                    },
                    "start_date": {
                        "title": "Start Date",
                        "type": "string",
                        "description": "Only keep reviews on or after this date (YYYY-MM-DD). Requires scraping all pages until reviews are older than this date."
                    },
                    "end_date": {
                        "title": "End Date",
                        "type": "string",
                        "description": "Only keep reviews on or before this date (YYYY-MM-DD). Defaults to today if start_date is set."
                    },
                    "cookies": {
                        "title": "Trustpilot Cookies",
                        "type": "array",
                        "description": "Trustpilot cookies as a JSON array of {name, value, domain, path} objects. Export from browser DevTools or a cookie extension."
                    },
                    "languages": {
                        "title": "Review Languages",
                        "type": "string",
                        "description": "Comma-separated language codes to filter reviews (e.g. 'en,de,fr'). Defaults to 'all'.",
                        "default": "all"
                    },
                    "request_delay": {
                        "title": "Request Delay (seconds)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Seconds to wait between page requests. Increase to reduce the chance of being blocked. Defaults to 0.5.",
                        "default": 0.5
                    },
                    "proxy_settings": {
                        "title": "Proxy Settings",
                        "type": "object",
                        "description": "Apify proxy configuration."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
