# Trustpilot Scraper (`automation-lab/trustpilot-scraper`) Actor

Scrape Trustpilot reviews and business profiles for brand reputation monitoring — ratings, review text, dates, verified status, and company replies. Export to JSON, CSV, or Excel.

- **URL**: https://apify.com/automation-lab/trustpilot-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Lead generation, Business
- **Stats:** 159 total users, 39 monthly users, 61.1% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.80 / 1,000 business scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Scraper

Scrape **Trustpilot reviews** and **business profiles** at scale. Extract review text, star ratings, trust scores, author info, verification status, company replies, and contact details — all in structured JSON, CSV, or Excel.

### What does Trustpilot Scraper do?

**[Trustpilot Scraper](https://apify.com/automation-lab/trustpilot-scraper)** extracts data from [Trustpilot](https://www.trustpilot.com) — the world's largest consumer review platform with 300M+ reviews.

It works in two modes:

- **Reviews mode** — scrape customer reviews for any business on Trustpilot. Get review text, star ratings (1-5), dates, author info, verification status, and company replies. Filter by star rating or an inclusive publication-date window, and sort by recency or relevance.
- **Search mode** — find businesses by keyword. Get trust scores, review counts, websites, emails, phone numbers, addresses, and categories.

Hybrid Playwright + HTTP extraction — a browser opens the first page and handles anti-bot checks, then lightweight HTTP requests fetch additional pages. No API key is needed. The Actor uses 1024 MB memory and pay-per-result pricing.

### Pair price monitoring with reputation monitoring

Use marketplace/product scrapers such as [Amazon Scraper](https://apify.com/automation-lab/amazon-scraper) and [Walmart Scraper](https://apify.com/automation-lab/walmart-scraper) to track prices and product signals, then run Trustpilot Scraper to monitor seller or brand reputation alongside that price data. Marketplace price movements show what changed; Trustpilot fields such as `rating`, `text`, `publishedDate`, `isVerified`, `hasReply`, `replyText`, and `replyDate` explain whether customers are raising quality, shipping, support, or trust concerns.

Trustpilot Scraper is the brand-reputation layer of an e-commerce monitoring bundle — it does not scrape marketplace product prices itself.

### Who is it for?

🏢 **Brand managers and reputation teams**

- Monitor your company's Trustpilot reviews daily
- Track star rating trends and review sentiment over time
- Get notified when negative reviews appear

📊 **Market researchers and analysts**

- Compare trust scores across competitors in your industry
- Analyze review distributions to find market gaps
- Study consumer sentiment patterns across categories

💼 **Sales and business development teams**

- Find companies by category with contact info (emails, phones, websites)
- Qualify leads by trust score and review volume
- Research potential partners before outreach

🤖 **Data scientists and AI teams**

- Build sentiment analysis datasets from real consumer reviews
- Train NLP models on verified vs. unverified review patterns
- Analyze reviewer behavior and review authenticity signals

📈 **Competitive intelligence professionals**

- Benchmark your trust score against competitors
- Track competitor review velocity and response rates
- Identify common complaints in competitor reviews

### Why use this scraper?

- ⚡ **Efficient hybrid scraping** — Playwright loads the first page, then HTTP pagination retrieves up to 20 reviews per page using 1024 MB memory
- 💰 **Pay per result** — no monthly subscription. Pay only for reviews/businesses you actually scrape
- 📦 **30+ fields per review** — title, text, rating, dates, author info, verification, company replies, likes
- 🏢 **Rich business data** — trust score, stars, review count, website, email, phone, address, categories
- 🔍 **Search and discover** — find businesses by keyword across all Trustpilot categories
- 📅 **Incremental date windows** — return only reviews published on, after, or before ISO date bounds
- 🔄 **Pagination built-in** — automatically fetches all pages up to your limit
- 📊 **Multiple export formats** — JSON, CSV, Excel, XML via Apify API
- 🔗 **API + integrations** — connect to Google Sheets, Slack, Zapier, Make, webhooks
- 🛡️ **No API key needed** — works with Trustpilot's public pages, no authentication required

### What data can you extract?

#### ⭐ Review data (25+ fields)

| Field | Description |
|-------|-------------|
| `reviewId` | Unique review identifier |
| `reviewUrl` | Direct link to the review |
| `title` | Review headline |
| `text` | Full review text |
| `rating` | Star rating (1-5) |
| `publishedDate` | When the review was posted (ISO 8601) |
| `experienceDate` | Date of the customer experience |
| `updatedDate` | Last update date (if edited) |
| `authorName` | Reviewer's display name |
| `authorLocation` | Reviewer's location |
| `authorCountry` | Reviewer's country code |
| `authorReviewCount` | Total reviews by this author on Trustpilot |
| `authorImageUrl` | Reviewer's profile image |
| `isVerified` | Whether the review is verified |
| `verificationLevel` | Verification status detail |
| `source` | Review source (Organic, Invitation) |
| `language` | Review language code |
| `likesCount` | Number of "useful" votes |
| `hasReply` | Whether the business replied |
| `replyText` | Business reply text |
| `replyDate` | Date of business reply |
| `businessName` | Name of the reviewed business |
| `businessDomain` | Domain of the reviewed business |

#### 🏢 Business data (18+ fields)

| Field | Description |
|-------|-------------|
| `businessId` | Unique business identifier |
| `name` | Business display name |
| `domain` | Business domain (e.g., stripe.com) |
| `trustScore` | Trustpilot trust score (0.0-5.0) |
| `stars` | Star rating (0-5 in 0.5 increments) |
| `numberOfReviews` | Total review count |
| `website` | Business website URL |
| `email` | Contact email |
| `phone` | Contact phone |
| `address` | Street address |
| `city` | City |
| `country` | Country |
| `zipCode` | ZIP/postal code |
| `categories` | Business categories (comma-separated) |
| `isClaimed` | Whether the business has claimed their profile |
| `profileUrl` | Trustpilot profile link |
| `logoUrl` | Business logo/screenshot URL |

### How much does it cost to scrape Trustpilot reviews?

This Actor uses **pay-per-event** pricing — you pay only for what you scrape.
No monthly Actor subscription is required. The one-time run-start charge is $0.001, and each review or business result uses tiered pricing based on your Apify plan:

| Apify plan tier | Price per result |
|---|---:|
| Free | $0.00345 |
| Bronze | $0.00300 |
| Silver | $0.00234 |
| Gold | $0.00180 |
| Platinum | $0.00120 |
| Diamond | $0.00084 |

#### Worked examples (Bronze tier, including the $0.001 start charge)

| Scenario | Results | Duration | Approximate charge |
|---|---:|---:|---:|
| 20 reviews for 1 business | 21 | ~3s | $0.064 |
| 100 reviews for 1 business | 101 | ~8s | $0.304 |
| 200 reviews for 1 business | 201 | ~50s | $0.604 |
| Search for 30 businesses | 30 | ~13s | $0.091 |

Check the live **Pricing** tab for the authoritative price for your plan. Any platform credits included with your Apify account may offset these Actor charges.

### How to scrape Trustpilot reviews

1. Go to [Trustpilot Scraper](https://apify.com/automation-lab/trustpilot-scraper) on Apify Store and click **Try for free**
2. Select **Reviews mode** (default)
3. Enter a business domain (e.g., `www.amazon.com`) or full Trustpilot URL
4. Optionally filter by star rating, publication date, or change sort order
5. Set your max results limit (start with 20 to test); this limit counts matching reviews per business URL
6. Click **Start** and wait for the run to complete
7. Download your data in JSON, CSV, Excel, or connect via API

**Search for businesses:**

```json
{
    "mode": "search",
    "searchQueries": ["car insurance", "web hosting"],
    "maxResults": 50
}
```

**Scrape 1-star reviews only:**

```json
{
    "mode": "reviews",
    "businessUrls": ["stripe.com", "paypal.com"],
    "reviewStars": 1,
    "reviewSort": "recency",
    "maxResults": 100
}
```

**Collect reviews published during an incremental window:**

```json
{
    "mode": "reviews",
    "businessUrls": ["www.amazon.com"],
    "reviewSort": "recency",
    "publishedDateFrom": "2026-08-01",
    "publishedDateTo": "2026-08-31T23:59:59Z",
    "maxResults": 100
}
```

Date bounds are inclusive. A date without a time uses the full UTC day (`publishedDateFrom` starts at 00:00:00.000 and `publishedDateTo` ends at 23:59:59.999). Reviews with missing or unparseable publication dates cannot match a bounded window. A valid window with no matching reviews still returns the business record rather than reporting an extraction failure.

### What input parameters does Trustpilot Scraper accept?

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `mode` | string | `reviews` | Scraping mode: `reviews` or `search` |
| `businessUrls` | string\[] | — | Business domains or Trustpilot URLs (reviews mode) |
| `reviewSort` | string | `recency` | Sort reviews: `recency` or `relevance` |
| `reviewStars` | integer | — | Filter by star rating (1-5). Omit for all ratings |
| `publishedDateFrom` | string | — | Inclusive ISO date/date-time lower bound (reviews mode) |
| `publishedDateTo` | string | — | Inclusive ISO date/date-time upper bound (reviews mode) |
| `searchQueries` | string\[] | — | Search keywords (search mode) |
| `maxResults` | integer | `100` | Max reviews or businesses per query/URL |

### Output examples

#### Review output

```json
{
    "type": "review",
    "reviewId": "69b9dc68a4efd1d63401b289",
    "reviewUrl": "https://www.trustpilot.com/reviews/69b9dc68a4efd1d63401b289",
    "businessName": "Amazon",
    "businessDomain": "www.amazon.com",
    "title": "Excellent customer service",
    "text": "Had an issue with my order and customer support resolved it within minutes...",
    "rating": 5,
    "publishedDate": "2026-03-15T10:30:00.000Z",
    "experienceDate": "2026-03-14T00:00:00.000Z",
    "updatedDate": null,
    "authorName": "Jane Doe",
    "authorLocation": "London, GB",
    "authorCountry": "GB",
    "authorReviewCount": 12,
    "authorImageUrl": "https://user-images.trustpilot.com/abc123/73x73.png",
    "isVerified": true,
    "verificationLevel": "verified",
    "source": "Invitation",
    "language": "en",
    "likesCount": 3,
    "hasReply": true,
    "replyText": "Thank you for your kind words, Jane!",
    "replyDate": "2026-03-16T08:00:00.000Z",
    "scrapedAt": "2026-03-18T12:00:00.000Z"
}
```

#### Business search output

```json
{
    "type": "business",
    "businessId": "50489e6800006400051ae0d6",
    "name": "Stripe",
    "domain": "stripe.com",
    "trustScore": 1.8,
    "stars": 2,
    "numberOfReviews": 16895,
    "website": "https://stripe.com/",
    "email": "https://support.stripe.com/contact",
    "phone": null,
    "address": "510 Townsend Street",
    "city": "San Francisco",
    "country": "United States",
    "zipCode": "94103",
    "categories": "Payment Service",
    "isClaimed": true,
    "profileUrl": "https://www.trustpilot.com/review/stripe.com",
    "logoUrl": "//s3-eu-west-1.amazonaws.com/tpd/logos/50489e68.../0x0.png",
    "scrapedAt": "2026-03-18T12:00:00.000Z"
}
```

### How do I get the best results?

- 🎯 **Use domain names** — enter `stripe.com` or `www.amazon.com` instead of full Trustpilot URLs
- 📉 **Filter by stars** — use `reviewStars: 1` to find only negative reviews for competitor analysis
- 🕐 **Sort by recency** — default sort gets the newest reviews first and can stop once pages are older than `publishedDateFrom`
- 📅 **Use date windows for scheduled runs** — set inclusive `publishedDateFrom` / `publishedDateTo` bounds to avoid exporting an unchanged review history
- 🔢 **Start small** — test with `maxResults: 20` before scaling up to thousands
- 🔍 **Combine modes** — use search to discover businesses, then reviews to deep-dive into specific ones
- ⏰ **Schedule runs** — set up daily or weekly scrapes to track review trends over time
- 💰 **Cost optimization** — Trustpilot shows 20 reviews per page, so costs scale linearly with pages fetched

### How to monitor Trustpilot reviews for your business

Trustpilot Scraper is ideal for setting up automated review monitoring — so you always know what customers are saying, without checking manually.

**Step-by-step setup:**

1. Open [Trustpilot Scraper](https://apify.com/automation-lab/trustpilot-scraper) in Apify Console
2. Enter your business domain (e.g., `yourcompany.com`) in **Reviews mode**
3. Set `reviewSort: recency` to get the newest reviews first
4. Set `publishedDateFrom` to the start of the period you need (and optionally `publishedDateTo`) so only that publication window is returned
5. Set `maxResults: 20-50` to keep each run fast and cheap
6. Enable **Scheduled runs** — daily or weekly depending on your review volume
7. Connect to **Slack or Discord** via integrations to get instant alerts on new reviews
8. Optionally filter by `reviewStars: 1` in a second scheduled run to catch negative reviews immediately

**Pro tip:** Run two scheduled scrapers in parallel — one for all new reviews (for the full picture) and one filtered to 1-star only (for urgent reputation management). Example calculation: a one-result Bronze-tier run is about $0.004 ($0.001 start + $0.003 result).

**Track competitors too:** Set up the same monitoring for 2-3 competitor domains. Getting a side-by-side daily feed of your reviews vs. theirs reveals patterns in what customers value — and where you're outperforming or falling behind.

### How to export Trustpilot reviews to CSV

Exporting Trustpilot reviews to CSV takes under a minute:

**From Apify Console (no code needed):**

1. Run the scraper with your target business domain
2. Open the **Dataset** tab when the run finishes
3. Click **Export** → choose **CSV**
4. Open in Excel, Google Sheets, or any BI tool

**Via API (for automation):**

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=csv&token=YOUR_TOKEN" \
  --output trustpilot-reviews.csv
```

**Auto-export to Google Sheets:**
Connect the scraper to Google Sheets via Apify's native integration. Every run automatically appends new rows to your spreadsheet — no manual downloads, no copy-pasting.

**Exported CSV columns include:** `reviewId`, `title`, `text`, `rating`, `publishedDate`, `authorName`, `authorLocation`, `isVerified`, `hasReply`, `replyText`, `businessName`, and more.

This makes Trustpilot data immediately usable in pivot tables, sentiment dashboards, or CRM imports.

### Integrations

Connect Trustpilot Scraper to your existing tools:

- 📊 **Trustpilot Scraper → Google Sheets** — export reviews to a spreadsheet for sentiment analysis and charting
- 🔔 **Trustpilot Scraper → Slack/Discord** — get alerted when new 1-star reviews appear for your brand
- ⚡ **Trustpilot Scraper → Zapier/Make** — trigger CRM updates when a high-value lead is found via search mode
- 📧 **Trustpilot Scraper → Email** — receive weekly digest of competitor review summaries
- 🔗 **Webhooks** — push results directly to your API endpoint for real-time processing
- 📅 **Scheduled runs** — monitor review trends with automatic daily/weekly scraping

### API usage

#### Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/trustpilot-scraper').call({
    mode: 'reviews',
    businessUrls: ['stripe.com'],
    reviewSort: 'recency',
    publishedDateFrom: '2026-08-01',
    publishedDateTo: '2026-08-31',
    maxResults: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("automation-lab/trustpilot-scraper").call(run_input={
    "mode": "reviews",
    "businessUrls": ["stripe.com"],
    "maxResults": 100,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/automation-lab~trustpilot-scraper/runs" \
  -X POST \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "reviews", "businessUrls": ["stripe.com"], "maxResults": 100}'
```

### Use with AI agents via MCP

[Trustpilot Scraper](https://apify.com/automation-lab/trustpilot-scraper) is available as a tool for AI assistants that support the [Model Context Protocol (MCP)](https://docs.apify.com/platform/integrations/mcp).

Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:

#### Setup for Claude Code

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=automation-lab/trustpilot-scraper"
```

#### Setup for Claude Desktop, Cursor, or VS Code

Add this to your MCP config file:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com/?tools=automation-lab/trustpilot-scraper"
        }
    }
}
```

Your AI assistant will use OAuth to authenticate with your Apify account on first use.

#### Example prompts

Once connected, try asking your AI assistant:

- "Scrape the latest 50 reviews for stripe.com on Trustpilot (use automation-lab/trustpilot-scraper)"
- "Search Trustpilot for 'car insurance' companies and find the ones with the best trust scores"
- "Compare Amazon and eBay Trustpilot ratings — scrape 100 reviews from each and summarize the sentiment"

Learn more in the [Apify MCP documentation](https://docs.apify.com/platform/integrations/mcp).

### Is it legal to scrape Trustpilot?

Scraping publicly available data from Trustpilot is generally legal. This actor only accesses public pages that any visitor can see without logging in.

**Important:**

- Respect Trustpilot's Terms of Service
- Comply with GDPR, CCPA, and other data protection regulations
- Use scraped data responsibly — do not republish reviews as your own
- Consider the ethical implications of large-scale data collection

For more information, see [Apify's guidance on web scraping legality](https://blog.apify.com/is-web-scraping-legal/).

### FAQ

**How fast is this scraper?**
Runtime depends on Trustpilot response times and anti-bot checks. A recent 20-review cloud run completed in about 38 seconds. Larger runs use HTTP pagination after the initial Playwright page, so they avoid launching a browser for every page.

**How much does it cost to scrape 10,000 reviews?**
At the current per-result rates, the Actor charge is about $34.50 on the Free tier or $30.00 on the Bronze tier, plus any additional result such as the business record. Higher Apify plan tiers have lower per-result prices; check the live **Pricing** tab for the authoritative rate.

**Can I scrape reviews for any business on Trustpilot?**
Yes — any business that has a Trustpilot profile. Enter their domain name (e.g., `stripe.com`) or full Trustpilot URL.

**Does this need a Trustpilot API key or account?**
No. The scraper extracts data from Trustpilot's public pages — no authentication needed.

**Why are some reviews missing the `authorLocation` field?**
Not all Trustpilot reviewers share their location. When the reviewer hasn't set a location, this field returns `null`. The `authorCountry` field is more commonly available.

**Why do I get fewer results than expected?**
Trustpilot may have fewer total reviews for that business than your `maxResults`. The scraper stops when it reaches either your limit or the last available page. Check the `numberOfReviews` field on the business profile to see the total.

### Related actors

- [Google Maps Reviews Scraper](https://apify.com/automation-lab/google-maps-reviews) — extract reviews and ratings from Google Maps business listings
- [TripAdvisor Scraper](https://apify.com/automation-lab/tripadvisor-scraper) — scrape reviews, ratings, and business details from TripAdvisor
- [Google Maps Lead Finder](https://apify.com/automation-lab/google-maps-lead-finder) — find businesses with reviews and contact details on Google Maps
- [Apple App Store Scraper](https://apify.com/automation-lab/apple-app-store-scraper) — scrape app reviews and ratings from the App Store
- [Amazon Scraper](https://apify.com/automation-lab/amazon-scraper) — extract product data and reviews from Amazon

# Actor input Schema

## `mode` (type: `string`):

Choose what to scrape from Trustpilot.

## `businessUrls` (type: `array`):

Add Trustpilot business URLs or domain names. Examples: 'www.amazon.com', 'stripe.com', or full URL 'https://www.trustpilot.com/review/www.amazon.com'.

## `reviewSort` (type: `string`):

How to sort the reviews.

## `reviewStars` (type: `integer`):

Only get reviews with this star rating (1-5). Leave empty for all ratings.

## `publishedDateFrom` (type: `string`):

Optional inclusive lower bound for review publication dates in Reviews mode. Use YYYY-MM-DD or an ISO date-time with a timezone.

## `publishedDateTo` (type: `string`):

Optional inclusive upper bound for review publication dates in Reviews mode. A YYYY-MM-DD value includes that entire UTC day.

## `searchQueries` (type: `array`):

Enter business names or industry keywords to search on Trustpilot. Examples: 'web hosting', 'car insurance', 'stripe'.

## `maxResults` (type: `integer`):

Maximum number of reviews or businesses to return per query/URL.

## Actor input object example

```json
{
  "mode": "reviews",
  "businessUrls": [
    "www.amazon.com"
  ],
  "reviewSort": "recency",
  "searchQueries": [
    "web hosting"
  ],
  "maxResults": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Combined overview of scraped business and review records.

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

Dataset view containing customer review records.

## `businesses` (type: `string`):

Dataset view containing Trustpilot business profile records.

# 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 = {
    "mode": "reviews",
    "businessUrls": [
        "www.amazon.com"
    ],
    "reviewSort": "recency",
    "searchQueries": [
        "web hosting"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/trustpilot-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 = {
    "mode": "reviews",
    "businessUrls": ["www.amazon.com"],
    "reviewSort": "recency",
    "searchQueries": ["web hosting"],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/trustpilot-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 '{
  "mode": "reviews",
  "businessUrls": [
    "www.amazon.com"
  ],
  "reviewSort": "recency",
  "searchQueries": [
    "web hosting"
  ],
  "maxResults": 20
}' |
apify call automation-lab/trustpilot-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/trustpilot-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/rtpptasDxTAqexxdi/builds/lbDPI4gDw6ozebNaz/openapi.json
