# Trustpilot Reviews & Company Data Scraper (`sian.agency/trustpilot-reviews-scraper`) Actor

Scrape Trustpilot at full depth: company search & details, paginated reviews, best/newest/recently-reviewed companies by category, category taxonomy, and consumer review history. 10 operations, one clean JSON dataset. Built for review monitoring, lead-gen, and review-integrity analysis.

- **URL**: https://apify.com/sian.agency/trustpilot-reviews-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 company reviews

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/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 & Company Data Scraper — 10 Operations ⭐

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Store-Taobao & Tmall](https://img.shields.io/badge/Store-Taobao%20%26%20Tmall-FF4F00)](https://apify.com/sian.agency/taobao-tmall-product-scraper?fpr=sian) [![Store-Xiaohongshu RedNote](https://img.shields.io/badge/Store-Xiaohongshu%20RedNote-FF2442)](https://apify.com/sian.agency/xiaohongshu-rednote-scraper?fpr=sian) [![Store-Sephora Reviews](https://img.shields.io/badge/Store-Sephora%20Reviews-E4405F)](https://apify.com/sian.agency/best-sephora-product-information-extractor?fpr=sian)

#### ⭐ The only Trustpilot scraper that covers the FULL data model — companies, reviews, category rankings AND consumer review history in one actor.
##### Built for review monitoring, category lead-gen, competitive benchmarking, and review-integrity / fraud investigation.

---

### 📋 Overview

**Most "Trustpilot scrapers" just dump a company's reviews.** This one scrapes the entire Trustpilot data model — companies, reviews, the full category taxonomy, and individual consumer review histories — across **10 operations** in a single actor, with clean structured JSON out and no login required.

**Why teams choose this scraper:**
- ✅ **10 operations, not 1**: company search & details, paginated reviews, best/newest/recently-reviewed companies by category, category search & details, plus consumer profiles and review history.
- 🗂️ **Category intelligence others don't have**: rank the best companies in any category and track recently-reviewed companies (plus a newest-companies feed) — exclusive to this actor.
- 👤 **Consumer-level review history**: pull every review a single reviewer ever wrote — purpose-built for fake-review and reputation-fraud analysis.
- 💎 **Authenticity signals on every row**: Trust Score, verified-by-Google, paid-plan flag, same-domain review count, verified-review flag.
- 💰 **Pay-per-result pricing**: charged only for successful rows. Competitive per-review rate with a generous free tier to test.
- 🌍 **23 locales**: en-US, en-GB, de-DE, fr-FR, es-ES, it-IT, and more — scrape the regional Trustpilot listings your market cares about.

---

### 🆚 Why This Scraper vs. Review-Only Tools

Most Trustpilot actors stop at "give me a company's reviews." This one models the whole platform:

| Capability | Typical review-only scraper | This scraper |
|---|---|---|
| Company reviews (paginated) | ✅ | ✅ |
| Company search & details | ⚠️ sometimes | ✅ |
| **Best companies by category** | ❌ | ✅ |
| **Newest companies by category (lead-gen)** | ❌ | ✅ |
| **Recently-reviewed companies** | ❌ | ✅ |
| **Category taxonomy (parent/sibling/sub)** | ❌ | ✅ |
| **Consumer profile + full review history** | ❌ | ✅ |
| Reviewer-trust signals on each row | ❌ | ✅ |

If your workflow is "monitor one company's reviews," any scraper works. If you need **category intelligence**, **lead generation**, or **review-integrity investigation**, this is the only Trustpilot actor that covers it.

---

### ✨ Features

- ⭐ **Company Reviews**: paginate every review with rating, verified flag, review source, experienced date, language, and company reply.
- 🔍 **Company Search**: find companies by keyword with rating and review-count filters.
- 🏢 **Company Details**: full profile by domain — Trust Score, rating distribution, verified-by-Google, claimed/paid status, about text.
- 🏆 **Companies by Category**: list the best companies in a category, sorted by relevance, review count, or latest review.
- 🆕 **Newest Companies in Category**: a feed of businesses that recently joined a vertical (availability depends on category activity).
- ⚡ **Recently Reviewed in Category**: monitor review velocity and reputation movement across a category.
- 🗂️ **Category Search & Details**: resolve category IDs and walk the full parent / sibling / sub-category taxonomy.
- 👤 **Consumer Details & Reviews**: a reviewer's profile plus their complete review history across all companies.
- 📄 **Smart pagination**: pull up to 100 pages per run; the actor stops automatically at the last page.
- 🧾 **HTML run report**: success/error counts, success rate, pages fetched, and duration — saved every run, even on failure.

---

### 🎬 Quick Start

Pick an operation, fill the field it needs, and run. Below: scrape Best Buy's reviews.

```bash
curl -X POST "https://api.apify.com/v2/acts/sian.agency~trustpilot-reviews-scraper/runs?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"operation": "companyReviews", "companyDomain": "www.bestbuy.com", "maxPages": 5}'
````

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Choose an operation

Select one of the 10 operations (e.g. `companyReviews`, `companySearch`, `categoryNewest`).

#### Step 2: Provide the required field

Each operation needs one input — a **Query**, a **Company Domain**, a **Category ID**, or a **Consumer ID**. Discover them with the search operations (Company Search gives you a domain; Category Search gives you a category ID; any review row gives you a consumer ID).

#### Step 3: Run and export

Run the actor and download your data as JSON, CSV, or Excel from the Apify dataset.

**That's it! In under a minute, you'll have:**

- Clean, structured rows with curated camelCase fields
- Raw upstream fields spread alongside for power users
- An HTML run report in the key-value store

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | string | **Yes** | One of 10 operations (see table below) |
| query | string | for search ops | Keyword for Company Search / Category Search |
| companyDomain | string | for company detail/review ops | Domain, e.g. `www.bestbuy.com` |
| categoryId | string | for category ops | Category slug, e.g. `electronics_company` |
| consumerId | string | for consumer ops | Reviewer ID from any review row |
| locale | string | No | Trustpilot locale (default `en-US`) |
| maxPages | integer | No | Max pages for paginated ops (default 5, max 100) |
| reviewSort | string | No | `most_relevant` or `recency` (Company Reviews) |
| datePosted | string | No | Recency window for Company Reviews |
| reviewRating | string | No | Filter reviews by star rating 1–5 |
| minRating / minReviewCount | string | No | Filter companies in search/category |
| categorySort | string | No | Sort Companies by Category |

#### Operations

| Operation | Needs | Returns |
|-----------|-------|---------|
| `companySearch` | query | Companies matching a keyword |
| `companyDetails` | companyDomain | Full company profile + Trust Score |
| `companyReviews` | companyDomain | Paginated reviews (PRIMARY) |
| `categoryCompanyList` | categoryId | Best companies in a category |
| `categoryRecentlyReviewed` | categoryId | Recently-reviewed companies |
| `categoryNewest` | categoryId | Newest companies (lead-gen) |
| `categorySearch` | query | Category IDs by keyword |
| `categoryDetails` | categoryId | Category taxonomy |
| `consumerDetails` | consumerId | Reviewer profile |
| `consumerReviews` | consumerId | A reviewer's full review history |

**Example:**

```json
{
  "operation": "categoryNewest",
  "categoryId": "software_company",
  "locale": "en-US"
}
```

***

### 📤 Output

Results are saved to the Apify dataset with **60+ fields**. Each row carries curated camelCase aliases plus the raw upstream fields spread alongside. Key fields:

| Field | Type | Description |
|-------|------|-------------|
| companyName | string | Company name |
| domain | string | Company domain |
| trustScore | number | Trustpilot Trust Score |
| rating | number | Star rating |
| reviewCount | integer | Total reviews |
| reviewTitle | string | Review headline |
| reviewText | string | Full review body |
| reviewRating | integer | Review star rating |
| reviewIsVerified | boolean | Verified review flag |
| reviewSource | string | Where the review originated |
| consumerId | string | Reviewer ID (chains to consumer ops) |
| consumerReviewCountSameDomain | integer | Reviewer's reviews of the same company |
| categoryId / categoryName | string | Category identity |
| isVerifiedByGoogle / isPaid | boolean | Company authenticity / plan signals |

**Example review row:**

```json
{
  "_operation": "companyReviews",
  "reviewId": "...",
  "reviewTitle": "Great support team",
  "reviewText": "...",
  "reviewRating": 5,
  "reviewIsVerified": true,
  "reviewSource": "Organic",
  "consumerId": "66abfdbd068a7d7fb565c516",
  "consumerName": "Debra F.",
  "consumerCountry": "US",
  "consumerReviewCountSameDomain": 1,
  "companyDomain": "www.bestbuy.com",
  "status": "success"
}
```

Filter the dataset by `_operation` to split modes, or by `status` to isolate any error rows.

#### Field groups by operation

- **Company rows** (`companySearch`, `companyDetails`, `categoryCompanyList`, category listings): `companyId`, `companyName`, `domain`, `website`, `logo`, `trustScore`, `rating`, `reviewCount`, `categories`, plus (details) `aboutCompany`, `negativeReviewCount`, `isVerifiedByGoogle`, `isClaimed`, `isPaid`, `isAskingForReviews`, `ratingDistribution`.
- **Review rows** (`companyReviews`, `consumerReviews`): `reviewId`, `reviewTitle`, `reviewText`, `reviewRating`, `reviewIsVerified`, `reviewSource`, `reviewExperiencedTime`, `reviewLanguage`, `replyText`, plus reviewer fields `consumerId`, `consumerName`, `consumerCountry`, `consumerReviewCount`, `consumerReviewCountSameDomain`.
- **Category rows** (`categorySearch`, `categoryDetails`): `categoryId`, `categoryName`, `parentId`, `companyCount`, `level`, `subcategories`, `parentCategory`, `siblingCategories`.
- **Consumer rows** (`consumerDetails`): `consumerId`, `consumerName`, `country`, `photo`, `verified`, `reviewCount`, `likeCount`, `readCount`.
- **Metadata on every row**: `_operation`, `_fetchedAt`, `_page`, `status`, plus the source field you queried (`_sourceQuery`, `_sourceCompanyDomain`, `_sourceCategoryId`, or `_sourceConsumerId`).

Every row also spreads the raw upstream fields (snake\_case) alongside the curated camelCase aliases, so power users lose nothing.

***

### 💼 Use Cases & Examples

#### 1. Review Monitoring & Voice-of-Customer

**Brand and CX teams tracking what customers actually say.**
**Input:** `companyReviews` with your company domain. **Output:** every review with rating, verified flag, and full text. **Use:** feed sentiment models to surface complaints, feature requests, and competitor weaknesses at scale.

#### 2. Category Lead Generation

**Sales teams prospecting businesses in a vertical.**
**Input:** `categoryRecentlyReviewed` (or `categoryNewest`) with a category ID. **Output:** companies actively gathering reviews in that Trustpilot category. **Use:** a fresh, intent-rich prospecting list no other Trustpilot actor exposes.

#### 3. Competitive Benchmarking

**Marketers quantifying brand standing.**
**Input:** `categoryCompanyList` with sort and rating filters. **Output:** the best companies in your category by Trust Score and review count. **Use:** measure where you rank and track movement over time.

#### 4. Review-Integrity & Fraud Investigation

**Trust & safety analysts hunting fake reviews.**
**Input:** `consumerReviews` with a suspicious reviewer's ID. **Output:** every review that consumer ever posted, plus same-domain clustering and verification signals. **Use:** purpose-built for fake-review and reputation-fraud analysis.

#### 5. Brand Reputation Dashboards

**Agencies building live reputation monitors.**
**Input:** `companyDetails` + `companyReviews` on a schedule. **Output:** Trust Score, rating distribution, and review velocity. **Use:** combine into dashboards across your brand and its competitors.

#### 6. Market Research by Vertical

**Researchers mapping an industry.**
**Input:** `categorySearch` then `categoryDetails`. **Output:** the full Trustpilot taxonomy with parent/sibling/sub categories and company counts. **Use:** size verticals and discover adjacent categories.

***

### 🔗 Integration Examples

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/trustpilot-reviews-scraper').call({
  operation: 'companyReviews',
  companyDomain: 'www.bestbuy.com',
  maxPages: 5
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/trustpilot-reviews-scraper').call(
    run_input={'operation': 'categoryNewest', 'categoryId': 'software_company'}
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~trustpilot-reviews-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"operation": "companySearch", "query": "nike"}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: Schedule (e.g. daily review pull) or webhook
2. **HTTP Request**: Call the actor API with your operation
3. **Process**: Handle the JSON dataset rows
4. **Action**: Save to a sheet, alert on a 1-star spike, or update a dashboard

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- Test every operation with full feature access — same data quality
- No credit card required
- Perfect for evaluating fit and small projects

#### PAID Tier (Production Ready)

- Scale to thousands of reviews and companies per run
- Pay-per-result: only charged for successful rows
- Smart auto-retry on transient upstream hiccups, so you don't pay for failed pages

💰 **Competitive per-review pricing** with a richer field set than typical review-only scrapers.

🔗 [View current pricing](https://apify.com/sian.agency/trustpilot-reviews-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: How many reviews can I scrape?**
A: FREE tier lets you test every operation. PAID tier scales to thousands of rows per run via pagination (up to 100 pages).

**Q: Does it scrape consumer (reviewer) review history?**
A: Yes — `consumerReviews` returns every review a specific reviewer posted across all companies, plus their profile via `consumerDetails`. Most Trustpilot scrapers can't do this.

**Q: Can I get the best or newest companies in a category?**
A: Yes — `categoryCompanyList`, `categoryNewest`, and `categoryRecentlyReviewed` cover category rankings. This is exclusive to this actor.

**Q: What output formats are available?**
A: JSON, CSV, and Excel — export directly from the Apify dataset.

**Q: Which countries/locales are supported?**
A: 23 locales including en-US, en-GB, de-DE, fr-FR, es-ES, it-IT, nl-NL, sv-SE, pt-BR, ja-JP, and more.

**Q: Is this legal?**
A: It only extracts publicly available data. See the legal section below.

**Q: How do I find a company domain or category ID?**
A: Use `companySearch` to get a `domain`, and `categorySearch` to get a `categoryId`. Any review row gives you a `consumerId`.

**Q: Can I filter reviews by rating, date, or keyword?**
A: Yes — Company Reviews supports `reviewRating` (1–5), `datePosted` (last 30 days through last 12 months), `reviewQuery` (keyword in the review text), verified-only, and replies-only filters, plus sort by relevance or recency.

**Q: How does pagination work?**
A: Set `maxPages` (up to 100). The actor fetches one page per upstream call and stops automatically when it reaches the last page — it derives the last page from the total count, so you never over-fetch.

**Q: What happens if a page fails?**
A: The actor auto-retries transient upstream hiccups with backoff. If a page still fails, it writes a `status: "error"` row instead of crashing, so your run always completes and you can see exactly which page failed.

***

### 🐛 Troubleshooting

**An operation returns 0 rows**

- The "Newest Companies in Category" feed is sparse on Trustpilot and is often empty — use **Recently Reviewed in Category** or **Companies by Category** for reliable category lead lists.
- Confirm the `categoryId` / `companyDomain` is exactly as returned by the search operations.

**"Missing required input" error**

- Each operation needs its specific field (e.g. `companyReviews` needs `companyDomain`). Check the operations table above.

**A page failed but others succeeded**

- The actor auto-retries transient upstream hiccups. Occasional single-page failures are written as `status: "error"` rows; just re-run or increase `maxPages`.

***

### ⚠️ Trademark Disclaimer

This actor is an independent tool and is **not affiliated with, endorsed by, or sponsored by Trustpilot A/S.** "Trustpilot" and related marks are trademarks of their respective owners and are used here only to describe the public data this tool helps you collect. Use this actor responsibly and in compliance with applicable laws, Trustpilot's terms of service, and data-protection regulations (including GDPR and CCPA where applicable). You are responsible for how you use the data you extract.

### ⚖️ Is it legal to scrape data?

Our actors are ethical and only extract data that companies and reviewers have chosen to share publicly on Trustpilot. We therefore believe that this actor, when used for ethical purposes by Apify users, is safe.

However, your results could contain personal data (e.g. reviewer names and countries). Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 🤝 Support

[![Telegram Support](https://img.shields.io/badge/Telegram-Support%20Group-0088cc?logo=telegram)](https://t.me/+vyh1sRE08sAxMGRi)

**Join our active support community**

- For issues or questions, open an issue in the Apify Console Issues tab
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Actor input Schema

## `operation` (type: `string`):

Pick ONE operation per run. Each maps to a Trustpilot data endpoint and fills the fields it needs below.

• **Company Search** — find companies by keyword (needs Query)
• **Company Details** — full profile + Trust Score by domain (needs Company Domain)
• **Company Reviews** — paginate every review for a company (needs Company Domain)
• **Companies by Category** — best companies in a category (needs Category ID)
• **Recently Reviewed in Category** — companies with fresh reviews (needs Category ID)
• **Newest in Category** — newest companies in a category, great for lead-gen (needs Category ID)
• **Category Search** — find category IDs by keyword (needs Query)
• **Category Details** — taxonomy: parent / sibling / sub categories (needs Category ID)
• **Consumer Details** — a reviewer's profile (needs Consumer ID)
• **Consumer Reviews** — every review a reviewer wrote (needs Consumer ID)

💡 Get a Company Domain from Company Search, a Category ID from Category Search, and a Consumer ID from any review row.

## `query` (type: `string`):

Search keyword. Used by **Company Search** (e.g. `bestbuy`, `nike`) and **Category Search** (e.g. `electronics`, `software`).

## `companyDomain` (type: `string`):

The company's domain on Trustpilot. Used by **Company Details** and **Company Reviews**. Get it from a Company Search row (the `domain` field, e.g. `www.bestbuy.com` or `gossby.com`).

## `categoryId` (type: `string`):

A Trustpilot category ID (slug). Used by **Companies by Category**, **Recently Reviewed**, **Newest**, and **Category Details**. Get it from a Category Search row (e.g. `electronics_company`, `software_company`).

## `consumerId` (type: `string`):

A Trustpilot consumer (reviewer) ID. Used by **Consumer Details** and **Consumer Reviews**. Get it from the `consumerId` field on any review row.

## `locale` (type: `string`):

Trustpilot locale / market. Affects which regional listings and reviews are returned. Defaults to `en-US`.

## `maxPages` (type: `integer`):

Maximum number of pages to fetch for paginated operations (Company Search, Company Reviews, Companies by Category, Consumer Reviews). Each upstream call is one page. Ignored for single-shot operations.

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

Sort order for **Company Reviews**.

## `datePosted` (type: `string`):

Restrict **Company Reviews** to a recency window.

## `reviewRating` (type: `string`):

Only return reviews with a specific star rating. Accepts a single value `1`–`5` (e.g. `5` for only 5-star, `1` for only 1-star). Leave blank for all ratings.

## `reviewQuery` (type: `string`):

Only return company reviews whose text contains this keyword. Leave blank to return all reviews.

## `verifiedOnly` (type: `boolean`):

**Company Reviews:** only verified reviews. **Companies by Category:** only verified companies.

## `withReplies` (type: `boolean`):

Only return reviews that have a company reply.

## `minRating` (type: `string`):

Filter results to companies with at least this rating. Used by **Company Search** and **Companies by Category**.

## `minReviewCount` (type: `string`):

Only return companies with at least this many reviews.

## `categorySort` (type: `string`):

Sort order for **Companies by Category**.

## `claimedOnly` (type: `boolean`):

Only return companies that have claimed their Trustpilot profile.

## `country` (type: `string`):

Restrict category companies to a country (ISO code, e.g. `US`, `GB`). Leave blank for all.

## `cityOrZip` (type: `string`):

Restrict category companies to a city name or ZIP/postal code. Leave blank for all.

## Actor input object example

```json
{
  "operation": "companyReviews",
  "query": "bestbuy",
  "companyDomain": "www.bestbuy.com",
  "categoryId": "electronics_company",
  "consumerId": "66abfdbd068a7d7fb565c516",
  "locale": "en-US",
  "maxPages": 5,
  "reviewSort": "most_relevant",
  "datePosted": "any",
  "reviewRating": "5",
  "reviewQuery": "",
  "verifiedOnly": false,
  "withReplies": false,
  "minRating": "any",
  "minReviewCount": "any",
  "categorySort": "most_relevant",
  "claimedOnly": false,
  "country": "",
  "cityOrZip": ""
}
```

# Actor output Schema

## `output` (type: `string`):

Per-row results — one flat row per upstream item with curated camelCase aliases (companyId, companyName, domain, trustScore, rating, reviewId, reviewTitle, reviewText, reviewRating, consumerId, categoryId, …) plus the raw upstream fields spread alongside.

## `report` (type: `string`):

HTML report with run status, success/error row counts, success rate, pages fetched, duration, and the inputs used — written even on fatal crash.

# 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 = {
    "query": "bestbuy",
    "companyDomain": "www.bestbuy.com",
    "categoryId": "electronics_company",
    "consumerId": "66abfdbd068a7d7fb565c516"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/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 = {
    "query": "bestbuy",
    "companyDomain": "www.bestbuy.com",
    "categoryId": "electronics_company",
    "consumerId": "66abfdbd068a7d7fb565c516",
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/trustpilot-reviews-scraper").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 '{
  "query": "bestbuy",
  "companyDomain": "www.bestbuy.com",
  "categoryId": "electronics_company",
  "consumerId": "66abfdbd068a7d7fb565c516"
}' |
apify call sian.agency/trustpilot-reviews-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Trustpilot Reviews & Company Data Scraper",
        "description": "Scrape Trustpilot at full depth: company search & details, paginated reviews, best/newest/recently-reviewed companies by category, category taxonomy, and consumer review history. 10 operations, one clean JSON dataset. Built for review monitoring, lead-gen, and review-integrity analysis.",
        "version": "1.0",
        "x-build-id": "M7H6JFhwTdtCgmqii"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sian.agency~trustpilot-reviews-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sian.agency-trustpilot-reviews-scraper",
                "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/sian.agency~trustpilot-reviews-scraper/runs": {
            "post": {
                "operationId": "runs-sync-sian.agency-trustpilot-reviews-scraper",
                "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/sian.agency~trustpilot-reviews-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-sian.agency-trustpilot-reviews-scraper",
                "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": [
                    "operation"
                ],
                "properties": {
                    "operation": {
                        "title": "🎛️ Operation",
                        "enum": [
                            "companySearch",
                            "companyDetails",
                            "companyReviews",
                            "categoryCompanyList",
                            "categoryRecentlyReviewed",
                            "categoryNewest",
                            "categorySearch",
                            "categoryDetails",
                            "consumerDetails",
                            "consumerReviews"
                        ],
                        "type": "string",
                        "description": "Pick ONE operation per run. Each maps to a Trustpilot data endpoint and fills the fields it needs below.\n\n• **Company Search** — find companies by keyword (needs Query)\n• **Company Details** — full profile + Trust Score by domain (needs Company Domain)\n• **Company Reviews** — paginate every review for a company (needs Company Domain)\n• **Companies by Category** — best companies in a category (needs Category ID)\n• **Recently Reviewed in Category** — companies with fresh reviews (needs Category ID)\n• **Newest in Category** — newest companies in a category, great for lead-gen (needs Category ID)\n• **Category Search** — find category IDs by keyword (needs Query)\n• **Category Details** — taxonomy: parent / sibling / sub categories (needs Category ID)\n• **Consumer Details** — a reviewer's profile (needs Consumer ID)\n• **Consumer Reviews** — every review a reviewer wrote (needs Consumer ID)\n\n💡 Get a Company Domain from Company Search, a Category ID from Category Search, and a Consumer ID from any review row.",
                        "default": "companyReviews"
                    },
                    "query": {
                        "title": "🔍 Query",
                        "type": "string",
                        "description": "Search keyword. Used by **Company Search** (e.g. `bestbuy`, `nike`) and **Category Search** (e.g. `electronics`, `software`)."
                    },
                    "companyDomain": {
                        "title": "🌐 Company Domain",
                        "type": "string",
                        "description": "The company's domain on Trustpilot. Used by **Company Details** and **Company Reviews**. Get it from a Company Search row (the `domain` field, e.g. `www.bestbuy.com` or `gossby.com`)."
                    },
                    "categoryId": {
                        "title": "🗂️ Category ID",
                        "type": "string",
                        "description": "A Trustpilot category ID (slug). Used by **Companies by Category**, **Recently Reviewed**, **Newest**, and **Category Details**. Get it from a Category Search row (e.g. `electronics_company`, `software_company`)."
                    },
                    "consumerId": {
                        "title": "👤 Consumer ID",
                        "type": "string",
                        "description": "A Trustpilot consumer (reviewer) ID. Used by **Consumer Details** and **Consumer Reviews**. Get it from the `consumerId` field on any review row."
                    },
                    "locale": {
                        "title": "🌍 Locale",
                        "enum": [
                            "en-US",
                            "en-GB",
                            "en-AU",
                            "en-CA",
                            "en-IE",
                            "en-NZ",
                            "de-DE",
                            "de-AT",
                            "de-CH",
                            "es-ES",
                            "fr-FR",
                            "fr-BE",
                            "it-IT",
                            "nl-NL",
                            "nl-BE",
                            "da-DK",
                            "fi-FI",
                            "nb-NO",
                            "pl-PL",
                            "pt-BR",
                            "pt-PT",
                            "sv-SE",
                            "ja-JP"
                        ],
                        "type": "string",
                        "description": "Trustpilot locale / market. Affects which regional listings and reviews are returned. Defaults to `en-US`.",
                        "default": "en-US"
                    },
                    "maxPages": {
                        "title": "📄 Max Pages",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of pages to fetch for paginated operations (Company Search, Company Reviews, Companies by Category, Consumer Reviews). Each upstream call is one page. Ignored for single-shot operations.",
                        "default": 5
                    },
                    "reviewSort": {
                        "title": "↕️ Review Sort (Company Reviews)",
                        "enum": [
                            "most_relevant",
                            "recency"
                        ],
                        "type": "string",
                        "description": "Sort order for **Company Reviews**.",
                        "default": "most_relevant"
                    },
                    "datePosted": {
                        "title": "📅 Date Posted (Company Reviews)",
                        "enum": [
                            "any",
                            "last_12_months",
                            "last_6_months",
                            "last_3_months",
                            "last_30_days"
                        ],
                        "type": "string",
                        "description": "Restrict **Company Reviews** to a recency window.",
                        "default": "any"
                    },
                    "reviewRating": {
                        "title": "⭐ Review Rating Filter (Company Reviews)",
                        "type": "string",
                        "description": "Only return reviews with a specific star rating. Accepts a single value `1`–`5` (e.g. `5` for only 5-star, `1` for only 1-star). Leave blank for all ratings.",
                        "default": ""
                    },
                    "reviewQuery": {
                        "title": "🔎 Review Keyword (Company Reviews)",
                        "type": "string",
                        "description": "Only return company reviews whose text contains this keyword. Leave blank to return all reviews.",
                        "default": ""
                    },
                    "verifiedOnly": {
                        "title": "✅ Verified Only",
                        "type": "boolean",
                        "description": "**Company Reviews:** only verified reviews. **Companies by Category:** only verified companies.",
                        "default": false
                    },
                    "withReplies": {
                        "title": "💬 Only Reviews With Replies (Company Reviews)",
                        "type": "boolean",
                        "description": "Only return reviews that have a company reply.",
                        "default": false
                    },
                    "minRating": {
                        "title": "⭐ Minimum Rating",
                        "enum": [
                            "any",
                            "3",
                            "4",
                            "4.5"
                        ],
                        "type": "string",
                        "description": "Filter results to companies with at least this rating. Used by **Company Search** and **Companies by Category**.",
                        "default": "any"
                    },
                    "minReviewCount": {
                        "title": "🔢 Minimum Review Count (Company Search)",
                        "enum": [
                            "any",
                            "25",
                            "50",
                            "100",
                            "250",
                            "500"
                        ],
                        "type": "string",
                        "description": "Only return companies with at least this many reviews.",
                        "default": "any"
                    },
                    "categorySort": {
                        "title": "↕️ Category Sort (Companies by Category)",
                        "enum": [
                            "most_relevant",
                            "reviews_count",
                            "latest_review"
                        ],
                        "type": "string",
                        "description": "Sort order for **Companies by Category**.",
                        "default": "most_relevant"
                    },
                    "claimedOnly": {
                        "title": "🏷️ Claimed Companies Only (Companies by Category)",
                        "type": "boolean",
                        "description": "Only return companies that have claimed their Trustpilot profile.",
                        "default": false
                    },
                    "country": {
                        "title": "🏳️ Country Filter (Companies by Category)",
                        "type": "string",
                        "description": "Restrict category companies to a country (ISO code, e.g. `US`, `GB`). Leave blank for all.",
                        "default": ""
                    },
                    "cityOrZip": {
                        "title": "📍 City or ZIP (Companies by Category)",
                        "type": "string",
                        "description": "Restrict category companies to a city name or ZIP/postal code. Leave blank for all.",
                        "default": ""
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
