# Trustpilot Scraper - Reviews, Ratings & Companies (`viralanalyzer/trustpilot-scraper`) Actor

Extract Trustpilot reviews, ratings, and company data at scale.

- **URL**: https://apify.com/viralanalyzer/trustpilot-scraper.md
- **Developed by:** [viralanalyzer](https://apify.com/viralanalyzer) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 15 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 review scrapeds

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

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

## What's an Apify Actor?

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 — Reviews, Ratings, Company Replies & Reputation Stats

> 🔗 [View on Apify Store](https://apify.com/viralanalyzer/trustpilot-scraper) | 🇺🇸 English | [🇧🇷 Português](#português)

Extract **company reviews and reputation data from Trustpilot** — full review text, star ratings, verified-purchase status, reviewer info, company replies, and company-level stats (TrustScore, total reviews, rating breakdown, categories). Just pass a company domain (e.g. `amazon.com`) or a Trustpilot review URL. Pure HTTP via CheerioCrawler — no browser and no API key needed.

### ✨ Features

- 📝 **Full review extraction** — Title, body text, star rating, language, dates (published, experienced, updated)
- ✅ **Verified status** — Flags reviews backed by a verification source
- 👤 **Reviewer info** — Display name, country code, total reviews written by the author
- 💬 **Company replies** — Captures the business's reply text, date, and author (toggleable)
- 🏢 **Company stats** — TrustScore, star rating, total review count, categories, and per-star rating breakdown
- ⭐ **Star filtering** — Scrape only 1, 2, 3, 4, or 5-star reviews (or all)
- 🔀 **Sorting** — By most recent (`recency`) or `relevance`
- 🌍 **Language filter** — Restrict to a single review language by ISO code
- 📅 **Date filter** — Keep only reviews published on or after a given date
- 📄 **Auto-pagination** — Walks through review pages until `maxReviews` is reached (up to 25 pages)
- 🧩 **Robust parsing** — Reads Trustpilot's `__NEXT_DATA__` JSON first, with a CSS-selector fallback
- 🚫 **De-duplication** — Skips reviews already collected within the run

### 📥 Input

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `companies` | string\[] | ❌ | `["amazon.com"]` | Company domains or Trustpilot review URLs (e.g. `"apple.com"`, `"https://www.trustpilot.com/review/apple.com"`). Domains are auto-extracted from URLs. |
| `maxReviews` | integer | ❌ | `50` | Max reviews per company (1–500). Each Trustpilot page holds ~20 reviews. |
| `starFilter` | string | ❌ | `"all"` | Filter by star rating: `all`, `1`, `2`, `3`, `4`, `5`. |
| `sortBy` | string | ❌ | `"recency"` | Sort reviews by `recency` or `relevance`. |
| `includeCompanyInfo` | boolean | ❌ | `true` | Emit a company-profile record (TrustScore, totals, breakdown, categories). |
| `includeReplies` | boolean | ❌ | `true` | Include the company's reply text for each review when available. |
| `language` | string | ❌ | `""` | Filter reviews by language ISO code. Empty = all languages. |
| `dateFrom` | string | ❌ | — | Keep only reviews on or after this date (`YYYY-MM-DD`). |
| `proxyConfig` | object | ❌ | `{ useApifyProxy: true }` | Proxy settings. Apify proxy by default. |

#### Input Example

```json
{
  "companies": [
    "amazon.com",
    "https://www.trustpilot.com/review/apple.com"
  ],
  "maxReviews": 100,
  "starFilter": "all",
  "sortBy": "recency",
  "includeCompanyInfo": true,
  "includeReplies": true,
  "language": "en",
  "dateFrom": "2025-01-01"
}
```

### 📤 Output

The dataset contains two record types, distinguished by the `type` field.

#### Review records (`type: "review"`)

| Field | Type | Description |
|---|---|---|
| `type` | string | Always `"review"` |
| `id` | string | Trustpilot review ID |
| `source` | string | Always `"Trustpilot"` |
| `company` | string | Company domain scraped |
| `author` | string | Reviewer display name |
| `authorCountry` | string | Reviewer country code |
| `authorReviewCount` | number | Number of reviews written by the author |
| `rating` | number | Star rating (1–5) |
| `title` | string | Review title |
| `text` | string | Review body text |
| `language` | string | Review language (ISO code) |
| `date` | string | Published date (falls back to experienced date) |
| `experienceDate` | string | Date of the experience |
| `updatedDate` | string | Date the review was last updated |
| `verified` | boolean | Whether the review is verified |
| `verificationSource` | string | Verification source / level |
| `likes` | number | Number of likes on the review |
| `url` | string | Direct URL to the review |
| `companyReply` | string | Company reply text (when `includeReplies` and a reply exists) |
| `companyReplyDate` | string | Date of the company reply |
| `companyReplyAuthor` | string | Display name of the replying business user |

#### Company info record (`type: "company_info"`, emitted once per company when `includeCompanyInfo` is true)

| Field | Type | Description |
|---|---|---|
| `type` | string | Always `"company_info"` |
| `name` | string | Company display name |
| `domain` | string | Company domain |
| `trustScore` | number | Trustpilot TrustScore |
| `stars` | number | Star rating |
| `totalReviews` | number | Total number of reviews |
| `categories` | string\[] | Trustpilot category names |
| `websiteUrl` | string | Company website URL |
| `profileUrl` | string | Trustpilot profile URL |
| `ratingBreakdown` | object | Per-star counts, e.g. `{ "5star": 1200, "4star": 300, ... }` (when available) |

#### Output Example (review record)

```json
{
  "type": "review",
  "id": "6612a1b3f0a8c20012ab34cd",
  "source": "Trustpilot",
  "company": "amazon.com",
  "author": "Jane D.",
  "authorCountry": "US",
  "authorReviewCount": 7,
  "rating": 5,
  "title": "Fast delivery, great service",
  "text": "Ordered on Monday, arrived Tuesday.",
  "language": "en",
  "date": "2026-02-14T09:32:11.000Z",
  "experienceDate": "2026-02-13T00:00:00.000Z",
  "verified": true,
  "verificationSource": "invitation",
  "likes": 3,
  "url": "https://www.trustpilot.com/reviews/6612a1b3f0a8c20012ab34cd",
  "companyReply": "Thank you for the kind words, Jane!",
  "companyReplyDate": "2026-02-15T10:00:00.000Z",
  "companyReplyAuthor": "Amazon Support"
}
```

A `company_info` record carries `name`, `domain`, `trustScore`, `stars`, `totalReviews`, `categories`, `websiteUrl`, `profileUrl`, and `ratingBreakdown` (e.g. `{ "5star": 4210, "1star": 11732 }`).

### 📋 Use Cases

- **Reputation Monitoring** — Track TrustScore, rating trends, and incoming reviews for your brand
- **Competitive Analysis** — Compare review volume, ratings, and customer sentiment across competitors
- **Voice of Customer** — Mine review text for recurring complaints, feature requests, and praise
- **Support Quality** — Audit how (and how fast) companies reply to reviews
- **Lead & Vendor Vetting** — Assess a supplier's reputation before doing business
- **Review Aggregation** — Feed Trustpilot reviews into dashboards, CRMs, or BI pipelines
- **Sentiment & NLP** — Build datasets for sentiment classification on rated, dated review text

### ✅ Capabilities & Limits

Stated up front, so you do not pay a run to find out.

**Built here:** the page budget is fixed once, on page 1, from an assumed 20 reviews per page - `Math.ceil(maxReviews / 20)` - and never recalculated. Star, language and `dateFrom` filters run after the page is fetched, so a filtered query burns its budget and stops below `maxReviews`. Set `maxReviews` well above the count you actually need.

| Input / feature | Supported | Notes |
|---|---|---|
| Company domain (`amazon.com`) | ✅ | `companies` accepts bare domains |
| Trustpilot URL | ✅ | full profile URLs also work |
| Review volume | ⚠️ | `maxReviews` per company; Trustpilot paginates at ~20 reviews per page |
| Filter by star rating | ✅ | `starFilter` |
| Filter by language | ✅ | `language` as ISO code |
| Filter by date | ✅ | `dateFrom` (`YYYY-MM-DD`) |
| Company replies | ✅ | `includeReplies` when the company answered |
| Company profile / TrustScore | ✅ | `includeCompanyInfo` |
| Reviewer contact details | ❌ | Trustpilot does not expose them and neither do we |

### ❓ FAQ

**Q: How do I specify a company?**
A: Use the company domain exactly as it appears on its Trustpilot page (e.g. `amazon.com`, `apple.com`) or paste the full review URL (`https://www.trustpilot.com/review/apple.com`). The actor extracts the domain automatically.

**Q: Does this need a Trustpilot API key or login?**
A: No. The actor reads public review pages over plain HTTP (CheerioCrawler) and parses the embedded `__NEXT_DATA__` JSON. No API key or account is required.

**Q: How many reviews can I get per company?**
A: Up to 500 per company (`maxReviews`), paginating ~20 reviews per page and capped at 25 pages per company.

**Q: Can I scrape only negative (or only positive) reviews?**
A: Yes. Set `starFilter` to `1`, `2`, `3`, `4`, or `5` to keep only reviews with that star rating, or `all` for everything.

**Q: Does it capture company responses to reviews?**
A: Yes, when `includeReplies` is true (default), each review can include `companyReply`, `companyReplyDate`, and `companyReplyAuthor`.

**Q: What's the difference between the two record types?**
A: Records with `type: "review"` are individual reviews. One record with `type: "company_info"` per company carries the profile-level stats (TrustScore, totals, rating breakdown, categories). Filter on the `type` field to separate them.

### 💰 Pricing

**$0.005 per review scraped**, Apify platform usage of the run is included — compute and proxy are not billed to you separately.

This actor uses **Pay Per Event (PPE)** — you are charged per item collected (`review-scraped`), covering both review records and the company-info record. There are no monthly platform fees beyond Apify usage. For current per-event pricing, see the actor page:

👉 **[apify.com/viralanalyzer/trustpilot-scraper](https://apify.com/viralanalyzer/trustpilot-scraper)**

### 🔗 Related Actors

- [ReclameAqui Scraper](https://apify.com/viralanalyzer/reclameaqui-scraper) — Brazilian consumer-complaints intelligence
- [Yahoo Finance Intelligence](https://apify.com/viralanalyzer/yahoo-finance-intelligence) — Stock quotes, fundamentals & analyst ratings
- [Google Maps BR Scraper](https://apify.com/viralanalyzer/google-maps-br-scraper) — Business listings & reviews
- [Shopify Store Intelligence](https://apify.com/viralanalyzer/shopify-store-intelligence) — E-commerce competitive analysis

### 📝 Changelog

#### v1.0 (Current)

- ✅ Trustpilot review extraction via `__NEXT_DATA__` JSON with CSS-selector fallback
- ✅ Company-level stats: TrustScore, stars, total reviews, categories, rating breakdown
- ✅ Company reply capture (text, date, author)
- ✅ Star filtering, recency/relevance sorting, language and date filters
- ✅ Auto-pagination up to 500 reviews / 25 pages per company
- ✅ Per-run de-duplication by review ID
- ✅ Apify proxy support (datacenter by default)
- ✅ PPE billing (`review-scraped`) with owner-skip for internal runs

***

<a name="português"></a>

## ⭐ Trustpilot Scraper — Avaliações, Notas, Respostas da Empresa & Estatísticas de Reputação

> [🇺🇸 English](#-trustpilot-scraper--reviews-ratings-company-replies--reputation-stats) | 🇧🇷 Português

Extraia **avaliações e dados de reputação de empresas no Trustpilot** — texto completo das avaliações, notas em estrelas, status de verificação, dados do avaliador, respostas da empresa e estatísticas do perfil (TrustScore, total de avaliações, distribuição de notas, categorias). Basta informar o domínio da empresa (ex: `amazon.com`) ou a URL da página de avaliações do Trustpilot. HTTP puro via CheerioCrawler — sem navegador e sem chave de API.

### ✨ Funcionalidades

- 📝 **Extração completa da avaliação** — Título, texto, nota em estrelas, idioma, datas (publicação, experiência, atualização)
- ✅ **Status de verificação** — Sinaliza avaliações com fonte de verificação
- 👤 **Dados do avaliador** — Nome de exibição, código do país, total de avaliações escritas pelo autor
- 💬 **Respostas da empresa** — Captura texto, data e autor da resposta do negócio (opcional)
- 🏢 **Estatísticas da empresa** — TrustScore, nota em estrelas, total de avaliações, categorias e distribuição por estrela
- ⭐ **Filtro por estrelas** — Extraia apenas avaliações de 1, 2, 3, 4 ou 5 estrelas (ou todas)
- 🔀 **Ordenação** — Por mais recentes (`recency`) ou por relevância (`relevance`)
- 🌍 **Filtro de idioma** — Restrinja a um único idioma por código ISO
- 📅 **Filtro de data** — Mantenha apenas avaliações publicadas a partir de uma data
- 📄 **Paginação automática** — Percorre as páginas até atingir `maxReviews` (até 25 páginas)
- 🧩 **Parsing robusto** — Lê primeiro o JSON `__NEXT_DATA__` do Trustpilot, com fallback por seletores CSS
- 🚫 **Deduplicação** — Ignora avaliações já coletadas na execução

### 📥 Entrada

| Parâmetro | Tipo | Obrigatório | Padrão | Descrição |
|---|---|---|---|---|
| `companies` | string\[] | ❌ | `["amazon.com"]` | Domínios de empresas ou URLs do Trustpilot (ex: `"apple.com"`, `"https://www.trustpilot.com/review/apple.com"`). O domínio é extraído automaticamente das URLs. |
| `maxReviews` | inteiro | ❌ | `50` | Máximo de avaliações por empresa (1–500). Cada página do Trustpilot tem ~20 avaliações. |
| `starFilter` | string | ❌ | `"all"` | Filtro por nota: `all`, `1`, `2`, `3`, `4`, `5`. |
| `sortBy` | string | ❌ | `"recency"` | Ordena por `recency` (recentes) ou `relevance` (relevância). |
| `includeCompanyInfo` | boolean | ❌ | `true` | Emite um registro de perfil da empresa (TrustScore, totais, distribuição, categorias). |
| `includeReplies` | boolean | ❌ | `true` | Inclui o texto da resposta da empresa em cada avaliação quando disponível. |
| `language` | string | ❌ | `""` | Filtra avaliações por código ISO de idioma. Vazio = todos os idiomas. |
| `dateFrom` | string | ❌ | — | Mantém apenas avaliações a partir desta data (`AAAA-MM-DD`). |
| `proxyConfig` | objeto | ❌ | `{ useApifyProxy: true }` | Configuração de proxy. Proxy Apify por padrão. |

#### Exemplo de Entrada

```json
{
  "companies": [
    "amazon.com",
    "https://www.trustpilot.com/review/apple.com"
  ],
  "maxReviews": 100,
  "starFilter": "all",
  "sortBy": "recency",
  "includeCompanyInfo": true,
  "includeReplies": true,
  "language": "en",
  "dateFrom": "2025-01-01"
}
```

### 📤 Saída

O dataset contém dois tipos de registro, distinguidos pelo campo `type`.

#### Registros de avaliação (`type: "review"`)

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Sempre `"review"` |
| `id` | string | ID da avaliação no Trustpilot |
| `source` | string | Sempre `"Trustpilot"` |
| `company` | string | Domínio da empresa extraída |
| `author` | string | Nome de exibição do avaliador |
| `authorCountry` | string | Código do país do avaliador |
| `authorReviewCount` | número | Quantidade de avaliações escritas pelo autor |
| `rating` | número | Nota em estrelas (1–5) |
| `title` | string | Título da avaliação |
| `text` | string | Texto da avaliação |
| `language` | string | Idioma da avaliação (código ISO) |
| `date` | string | Data de publicação (fallback para data da experiência) |
| `experienceDate` | string | Data da experiência |
| `updatedDate` | string | Data da última atualização da avaliação |
| `verified` | boolean | Se a avaliação é verificada |
| `verificationSource` | string | Fonte / nível de verificação |
| `likes` | número | Número de curtidas na avaliação |
| `url` | string | URL direta da avaliação |
| `companyReply` | string | Texto da resposta da empresa (quando `includeReplies` e houver resposta) |
| `companyReplyDate` | string | Data da resposta da empresa |
| `companyReplyAuthor` | string | Nome de exibição do usuário de negócios que respondeu |

#### Registro de info da empresa (`type: "company_info"`, emitido uma vez por empresa quando `includeCompanyInfo` é true)

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Sempre `"company_info"` |
| `name` | string | Nome de exibição da empresa |
| `domain` | string | Domínio da empresa |
| `trustScore` | número | TrustScore do Trustpilot |
| `stars` | número | Nota em estrelas |
| `totalReviews` | número | Total de avaliações |
| `categories` | string\[] | Nomes das categorias do Trustpilot |
| `websiteUrl` | string | URL do site da empresa |
| `profileUrl` | string | URL do perfil no Trustpilot |
| `ratingBreakdown` | objeto | Contagens por estrela, ex: `{ "5star": 1200, "4star": 300, ... }` (quando disponível) |

#### Exemplo de Saída (registro de avaliação)

```json
{
  "type": "review",
  "id": "6612a1b3f0a8c20012ab34cd",
  "source": "Trustpilot",
  "company": "amazon.com",
  "author": "Jane D.",
  "authorCountry": "US",
  "authorReviewCount": 7,
  "rating": 5,
  "title": "Fast delivery, great service",
  "text": "Ordered on Monday, arrived Tuesday.",
  "language": "en",
  "date": "2026-02-14T09:32:11.000Z",
  "experienceDate": "2026-02-13T00:00:00.000Z",
  "verified": true,
  "verificationSource": "invitation",
  "likes": 3,
  "url": "https://www.trustpilot.com/reviews/6612a1b3f0a8c20012ab34cd",
  "companyReply": "Thank you for the kind words, Jane!",
  "companyReplyDate": "2026-02-15T10:00:00.000Z",
  "companyReplyAuthor": "Amazon Support"
}
```

Um registro `company_info` carrega `name`, `domain`, `trustScore`, `stars`, `totalReviews`, `categories`, `websiteUrl`, `profileUrl` e `ratingBreakdown` (ex: `{ "5star": 4210, "1star": 11732 }`).

### 📋 Casos de Uso

- **Monitoramento de Reputação** — Acompanhe TrustScore, tendências de nota e novas avaliações da sua marca
- **Análise Competitiva** — Compare volume de avaliações, notas e sentimento entre concorrentes
- **Voz do Cliente** — Minere o texto das avaliações em busca de reclamações, pedidos e elogios recorrentes
- **Qualidade do Atendimento** — Audite como (e com que rapidez) as empresas respondem às avaliações
- **Triagem de Fornecedores** — Avalie a reputação de um fornecedor antes de fechar negócio
- **Agregação de Avaliações** — Alimente dashboards, CRMs ou pipelines de BI com avaliações do Trustpilot
- **Sentimento & PLN** — Construa datasets para classificação de sentimento sobre textos avaliados e datados

### ❓ Perguntas Frequentes

**P: Como informo uma empresa?**
R: Use o domínio exatamente como aparece na página do Trustpilot (ex: `amazon.com`, `apple.com`) ou cole a URL completa de avaliações (`https://www.trustpilot.com/review/apple.com`). O actor extrai o domínio automaticamente.

**P: Preciso de chave de API ou login no Trustpilot?**
R: Não. O actor lê páginas públicas de avaliações via HTTP puro (CheerioCrawler) e faz parsing do JSON `__NEXT_DATA__` embutido. Nenhuma chave de API ou conta é necessária.

**P: Quantas avaliações consigo por empresa?**
R: Até 500 por empresa (`maxReviews`), paginando ~20 avaliações por página e limitado a 25 páginas por empresa.

**P: Posso extrair apenas avaliações negativas (ou apenas positivas)?**
R: Sim. Defina `starFilter` como `1`, `2`, `3`, `4` ou `5` para manter apenas avaliações com aquela nota, ou `all` para todas.

**P: Ele captura as respostas da empresa às avaliações?**
R: Sim, quando `includeReplies` é true (padrão), cada avaliação pode incluir `companyReply`, `companyReplyDate` e `companyReplyAuthor`.

**P: Qual a diferença entre os dois tipos de registro?**
R: Registros com `type: "review"` são avaliações individuais. Um registro com `type: "company_info"` por empresa carrega as estatísticas do perfil (TrustScore, totais, distribuição de notas, categorias). Filtre pelo campo `type` para separá-los.

### 💰 Preços

**$0.005 por avaliação extraída**, o uso de plataforma da Apify está incluído — compute e proxy não são cobrados à parte.

Este actor usa **Pay Per Event (PPE)** — você é cobrado por item coletado (`review-scraped`), cobrindo tanto os registros de avaliação quanto o registro de info da empresa. Não há mensalidades de plataforma além do uso da Apify. Para o preço por evento atualizado, consulte a página do actor:

👉 **[apify.com/viralanalyzer/trustpilot-scraper](https://apify.com/viralanalyzer/trustpilot-scraper)**

### 🔗 Actors Relacionados

- [ReclameAqui Scraper](https://apify.com/viralanalyzer/reclameaqui-scraper) — Inteligência de reclamações de consumidores no Brasil
- [Yahoo Finance Intelligence](https://apify.com/viralanalyzer/yahoo-finance-intelligence) — Cotações, fundamentos & ratings de analistas
- [Google Maps BR Scraper](https://apify.com/viralanalyzer/google-maps-br-scraper) — Listagens e avaliações de empresas
- [Shopify Store Intelligence](https://apify.com/viralanalyzer/shopify-store-intelligence) — Análise competitiva de e-commerce

### 📝 Changelog

#### v1.0 (Atual)

- ✅ Extração de avaliações do Trustpilot via JSON `__NEXT_DATA__` com fallback por seletores CSS
- ✅ Estatísticas da empresa: TrustScore, estrelas, total de avaliações, categorias, distribuição de notas
- ✅ Captura da resposta da empresa (texto, data, autor)
- ✅ Filtro por estrelas, ordenação recência/relevância, filtros de idioma e data
- ✅ Paginação automática até 500 avaliações / 25 páginas por empresa
- ✅ Deduplicação por ID de avaliação na execução
- ✅ Suporte a proxy Apify (datacenter por padrão)
- ✅ Cobrança PPE (`review-scraped`) com owner-skip para execuções internas

# Actor input Schema

## `companies` (type: `array`):

List of company domains or Trustpilot URLs to scrape (e.g. \['amazon.com', 'https://www.trustpilot.com/review/apple.com']). Use the domain from the Trustpilot review page URL.

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

Maximum number of reviews to extract per company. Each Trustpilot page has ~20 reviews.

## `starFilter` (type: `string`):

Filter reviews by star rating. Use 'all' for no filter.

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

How to sort the reviews

## `includeCompanyInfo` (type: `boolean`):

Include company profile data (TrustScore, total reviews, rating breakdown, categories, etc.)

## `includeReplies` (type: `boolean`):

Include company reply text for each review when available

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

Filter reviews by language (ISO code). Leave empty for all languages.

## `dateFrom` (type: `string`):

Only reviews after this date (YYYY-MM-DD). Leave empty for no filter.

## `proxyConfig` (type: `object`):

Proxy settings. Leave default for Apify proxy.

## Actor input object example

```json
{
  "companies": [
    "amazon.com"
  ],
  "maxReviews": 50,
  "starFilter": "all",
  "sortBy": "recency",
  "includeCompanyInfo": true,
  "includeReplies": true,
  "language": "",
  "proxyConfig": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing all scraped results. Each item follows the dataset schema.

# 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 = {
    "companies": [
        "amazon.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("viralanalyzer/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 = { "companies": ["amazon.com"] }

# Run the Actor and wait for it to finish
run = client.actor("viralanalyzer/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 '{
  "companies": [
    "amazon.com"
  ]
}' |
apify call viralanalyzer/trustpilot-scraper --silent --output-dataset

```

## MCP server setup

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