# Trustpilot Company Categories (`njoylab/trustpilot-company-categories`) Actor

Scrape Trustpilot businesses using 3 modes: category, keyword, or detailed business. Filter by location, country, trust score, verification status. Extract company data, ratings, reviews, contact info, and more making it perfect for market research, reputation tracking, or business insights.

- **URL**: https://apify.com/njoylab/trustpilot-company-categories.md
- **Developed by:** [njoylab](https://apify.com/njoylab) (community)
- **Categories:** Automation, Developer tools, Lead generation
- **Stats:** 188 total users, 1 monthly users, 92.3% runs succeeded, 15 bookmarks
- **User rating**: 4.07 out of 5 stars

## Pricing

Pay per usage

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Trustpilot Scraper

This Apify actor scrapes business data from Trustpilot using three different modes: category filtering, keyword search, or detailed business scraping. You can filter the results based on location, verification status, trustscore, and more.

### Table of Contents

- [Input Parameters](#input-parameters)
- [Output Structure](#output-structure)
- [Usage](#usage)
- [Example](#example)

### Input Parameters

The input parameters are defined as a JSON object with the following fields:

```json
{
  "category": "gaming",
  "page": "1",
  "country": "US",
  "location": "New York, NY",
  "claimed": false,
  "verified": false,
  "trustscore": "3.0",
  "allPages": false,
  "sortBy": "recommended",
  "withLastReviews": false
}
```

For search mode:

```json
{
  "searchType": "search",
  "search": "gaming",
  "page": "1",
  "claimed": false,
  "verified": false,
  "trustscore": "3.0",
  "allPages": false,
  "numberOfReviews": "any",
  "withLastReviews": false
}
```

Or for detail mode:

```json
{
  "searchType": "detail",
  "domain": "www.microsoft.com",
  "page": "1",
  "date": "last30days",
  "language": "en",
  "stars": "5",
  "allPages": false
}
```

#### Parameters Breakdown

- **searchType** *(string, required)*: Select how you want to search Trustpilot. Options:
  - `category`: Category Filter - Browse businesses by Trustpilot categories
  - `search`: Keyword Search - Search businesses using keywords
  - `detail`: Detail - Scrape detailed information and reviews from a specific business domain

- **withLastReviews** *(boolean)*: If set to `true`, the actor will fetch the last reviews for each company. Note that this will increase the scraping time. Defaults to `false`.

##### Category Options

These settings apply when using `searchType: "category"`:

- **category** *(string)*: The Trustpilot category you want to scrape. Examples: `bank`, `gaming`, `tech`. These correspond to URLs like `https://www.trustpilot.com/categories/bank`.

- **country** *(string)*: Country code for filtering results by a specific country. Example values: `US`, `IT`, `GB`.

- **location** *(string)*: City or Zip Code to filter results. Example: `"New York, NY"`.

##### Detail Options

These settings apply when using `searchType: "detail"`:

- **domain** *(string)*: The domain of the business you want to scrape detailed information from. Example: `www.microsoft.com` for `https://www.trustpilot.com/review/www.microsoft.com`.

- **date** *(string)*: Date range for reviews. Options:
  - `""`: All time (default)
  - `last30days`: Last 30 days
  - `last3months`: Last 3 months
  - `last6months`: Last 6 months
  - `last12months`: Last 12 months

- **language** *(string)*: Language of the reviews. Examples: `en`, `de`, `fr`, `es`, `it`, `pt`, `ru`, `zh`, `ja`, `ko`, `ar`, or `all`. Defaults to `en`.

- **stars** *(string)*: Filter reviews by star rating. Options: `1`, `2`, `3`, `4`, `5`, or `""` for all ratings.

##### Category Sorting Options

These sorting options only apply when using Category Filter:

- **sortBy** *(string)*: Sort results by relevance, number of reviews, or recency. Options:
  - `recommended`: Most Relevant (default)
  - `reviews_count`: Highest number of reviews
  - `latest_review`: Most recent reviews

##### Search Query Settings

These settings apply when using `searchType: "search"`:

- **search** *(string)*: Specify the search query you want to scrape. Example: `bank` for `https://www.trustpilot.com/search?q=bank`.

##### Search Filtering Options

These filtering options only apply when using Keyword Search:

- **numberOfReviews** *(string)*: Only companies with a number of reviews greater than or equal to the specified value. Options:
  - `any`: Any number of reviews (default)
  - `25`: 25+ reviews
  - `50`: 50+ reviews
  - `100`: 100+ reviews
  - `250`: 250+ reviews
  - `500`: 500+ reviews

##### Filtering Options

Filter results by various criteria:

- **trustscore** *(string)*: Only companies with a trustscore greater than or equal to the specified value. Options:
  - `""`: All ratings
  - `"3.0"`: >= 3 Stars
  - `"4.0"`: >= 4 Stars
  - `"4.5"`: >= 4.5 Stars

- **claimed** *(boolean)*: If set to `true`, only scrapes businesses that have claimed their profiles.

- **verified** *(boolean)*: If set to `true`, only scrapes businesses that have verified their profiles.

##### Pagination Settings

- **page** *(string)*: The page number you want to scrape or start from. Defaults to `1`.

- **allPages** *(boolean)*: If true, the actor will scrape all pages of the category. Please note that timeouts may occur if the category has a lot of pages. Defaults to `false`.

### Output Structure

The output is an array of objects representing businesses. Here's the structure of the scraped data:

- **businesses**: An array of businesses that match the specified input criteria.
  - **ID**: Unique ID of the business.
  - **domain**: Domain name of the business.
  - **ratingValue**: Trustpilot rating of the business.
  - **reviewCount**: Number of reviews the business has received.
  - **name**: Name of the business.
  - **description** : Short description of the business.
  - **image** : Image URL of the business logo or profile.
  - **country** : Country where the business is based.
  - **address** : Physical address of the business.
  - **city** : City where the business is located.
  - **zipCode** : Zip code of the business location.
  - **website** : Business website URL.
  - **email** : Email contact of the business.
  - **phone** : Business phone number.
  - **categories** : Categories the business belongs to.
  - **categoriesID** : Category IDs the business is associated with.
  - **lastReviews** : (When withLastReviews is enabled) Array of recent review objects.
  - **reviews** : (Detail mode only) Array of detailed review objects with full review data.
  - **rating** : (Detail mode only) Aggregate rating object with best, worst, value, and review count.
  - **data** : (Detail mode only) Ratings distribution dataset (number of 1-5 star reviews and total).
  - **similarBusinessUnits** : (Detail mode only) Array of similar business units on Trustpilot, each with businessUnitId, businessUnitDisplayName, businessUnitIdentifyingName, businessUnitLogo, numberOfReviews, stars, and trustScore.
  - **aiSummary** : (Detail mode only) AI-generated summary object for the business, containing:
    - **summary**: The AI-generated summary text.
    - **status**: Status of the summary generation (e.g., 'success', 'pending', 'error').
    - **lang**: Language code of the summary (e.g., 'en').
    - **updatedAt**: ISO timestamp of when the summary was last updated.

- **total**: The total number of businesses found for the query.

- **pages**: Total number of pages for the results.

### Usage

1. **Define your inputs**: Create a JSON file with your desired input parameters (see Input Parameters section).
2. **Run the actor**: Trigger the Apify actor with your JSON input.
3. **Download the output**: The scraped data will be saved in the output storage. You can access it via Apify's storage API or directly through the Apify interface.

#### Proxy Support

Trustpilot recently introduced AWS WAF anti-bot protections that may block datacenter or low-quality proxy traffic. To use this actor reliably, residential proxies are recommended. The actor defaults to Apify's `RESIDENTIAL` proxy group and retries blocked requests with fresh proxy sessions.

### Example

#### Category Filter Example

```json
{
  "searchType": "category",
  "category": "gaming",
  "page": "2",
  "country": "US",
  "location": "San Francisco, CA",
  "claimed": true,
  "verified": false,
  "trustscore": "4.0",
  "sortBy": "reviews_count"
}
```

#### Keyword Search Example

```json
{
  "searchType": "search",
  "search": "online gaming",
  "page": "1"
}
```

#### Detail Mode Example

```json
{
  "searchType": "detail",
  "domain": "www.microsoft.com",
  "page": "1",
  "date": "last30days",
  "language": "en",
  "stars": "",
  "allPages": true
}
```

#### Output Example

```json
{
  "businesses": [
    {
      "ID": "12345",
      "domain": "example.com",
      "ratingValue": "4.5",
      "reviewCount": "1500",
      "name": "Example Gaming Company",
      "description": "The best gaming company.",
      "image": "https://example.com/logo.png",
      "country": "US",
      "address": "123 Main St",
      "city": "San Francisco",
      "zipCode": "94103",
      "website": "https://example.com",
      "email": "info@example.com",
      "phone": "+1-800-123-4567",
      "categories": ["Gaming", "Entertainment"],
      "categoriesID": ["gaming", "entertainment"],
      "reviews": [
        {
          "id": "abc123xyz",
          "text": "Great experience with this company!",
          "title": "Excellent Service and Products",
          "rating": 5,
          "date": {
            "createdAt": "2024-01-15T10:30:00.000Z"
          },
          "consumer": {
            "id": "user123",
            "displayName": "JohnDoe",
            "imageUrl": "https://example.com/avatar.jpg",
            "isVerified": true,
            "numberOfReviews": 10,
            "countryCode": "US"
          }
        }
      ],
      "lastReviews": [
        {
          "id": "abc123xyz",
          "text": "Great experience with this company!",
          "title": "Excellent Service and Products",
          "rating": 5,
          "date": {
            "createdAt": "2024-01-15T10:30:00.000Z"
          },
          "consumer": {
            "id": "user123",
            "displayName": "JohnDoe",
            "imageUrl": "https://example.com/avatar.jpg",
            "isVerified": true,
            "numberOfReviews": 10,
            "countryCode": "US"
          }
        }
      ],
      "rating": {
        "bestRating": "5",
        "worstRating": "1",
        "ratingValue": "4.5",
        "reviewCount": "1500"
      },
      "data": {
        "one": 10,
        "two": 5,
        "three": 15,
        "four": 30,
        "five": 1440,
        "total": 1500
      },
      "similarBusinessUnits": [
        {
          "businessUnitId": "67890",
          "businessUnitDisplayName": "Another Gaming Company",
          "businessUnitIdentifyingName": "another-gaming-company",
          "businessUnitLogo": "https://example.com/another-logo.png",
          "numberOfReviews": 800,
          "stars": 4.2,
          "statusCode": 1,
          "tier": "standard",
          "trustScore": 85
        }
      ],
      "aiSummary": {
        "summary": "Example Gaming Company is a leading provider of online gaming experiences, known for excellent customer service and a wide variety of games.",
        "status": "success",
        "lang": "en",
        "updatedAt": "2024-06-01T12:00:00.000Z"
      }
    }
  ],
  "total": 100,
  "pages": 5
}
```

### Disclaimer

This actor is intended to help you get structured data from Trustpilot. It is not intended to be used against Trustpilot's Terms of Service.

# Actor input Schema

## `searchType` (type: `string`):

Select how you want to search Trustpilot: Category, Keyword or Detail Page

## `withLastReviews` (type: `boolean`):

Fetch the last reviews for each company, this will take longer to scrape.

## `category` (type: `string`):

The Trustpilot category you want to scrape (only used with Category Browse). Example: 'gaming' for https://www.trustpilot.com/categories/gaming

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

Select country (used with Category Browse)

## `verified` (type: `boolean`):

Only companies that are verified

## `search` (type: `string`):

Specify the search query you want to scrape (only used with Keyword Search). Example: 'bank' for https://www.trustpilot.com/search?q=bank

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

Sort results by relevance, number of reviews, or recency (only used with Category Browse)

## `numberOfReviews` (type: `string`):

Only companies with a number of reviews greater than or equal to the specified value (used with Keyword Search)

## `trustscore` (type: `string`):

Only companies with a trustscore greater than or equal to the specified value

## `location` (type: `string`):

City or Zip Code (used with Category Browse)

## `claimed` (type: `boolean`):

Only companies that are claimed

## `domain` (type: `string`):

Specify the domain you want to scrape (only used with Detail). Example: www.microsoft.com

## `date` (type: `string`):

Date range for reviews (used with Detail)

## `stars` (type: `string`):

Stars of the reviews (used with Detail)

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

Language of the reviews (used with Detail)

## `page` (type: `string`):

The page number you want to scrape or start from

## `allPages` (type: `boolean`):

If true, the actor will scrape all pages of the category. Please note that timeouts may occur if the category has a lot of pages.

## `proxyGroups` (type: `array`):

Apify Proxy groups to use. Trustpilot currently requires residential-quality IPs in most runs.

## `proxyCountryCode` (type: `string`):

Optional two-letter country code for Apify Proxy, for example US or GB.

## `proxyMaxRetries` (type: `integer`):

How many proxy sessions to try before failing when Trustpilot returns an anti-bot verification page.

## Actor input object example

```json
{
  "searchType": "category",
  "category": "gaming",
  "country": "US",
  "search": "bank",
  "sortBy": "recommended",
  "numberOfReviews": "any",
  "trustscore": "3.0",
  "location": "New York, NY",
  "domain": "www.microsoft.com",
  "date": "",
  "stars": "",
  "language": "all,en,de,fr,es,it,pt,ru,zh,ja,ko,ar",
  "page": "1",
  "proxyGroups": [
    "RESIDENTIAL"
  ],
  "proxyCountryCode": "US",
  "proxyMaxRetries": 10
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "withLastReviews": false,
    "category": "gaming",
    "country": "US",
    "verified": false,
    "search": "",
    "location": "",
    "claimed": false,
    "domain": "",
    "date": "",
    "stars": "",
    "language": "en",
    "page": "1",
    "allPages": false,
    "proxyGroups": [
        "RESIDENTIAL"
    ],
    "proxyCountryCode": "",
    "proxyMaxRetries": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("njoylab/trustpilot-company-categories").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 = {
    "withLastReviews": False,
    "category": "gaming",
    "country": "US",
    "verified": False,
    "search": "",
    "location": "",
    "claimed": False,
    "domain": "",
    "date": "",
    "stars": "",
    "language": "en",
    "page": "1",
    "allPages": False,
    "proxyGroups": ["RESIDENTIAL"],
    "proxyCountryCode": "",
    "proxyMaxRetries": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("njoylab/trustpilot-company-categories").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 '{
  "withLastReviews": false,
  "category": "gaming",
  "country": "US",
  "verified": false,
  "search": "",
  "location": "",
  "claimed": false,
  "domain": "",
  "date": "",
  "stars": "",
  "language": "en",
  "page": "1",
  "allPages": false,
  "proxyGroups": [
    "RESIDENTIAL"
  ],
  "proxyCountryCode": "",
  "proxyMaxRetries": 10
}' |
apify call njoylab/trustpilot-company-categories --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,njoylab/trustpilot-company-categories"
        }
    }
}
```

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/54gWbfO00z4tFrs4x/builds/eQUXNjgxB0jhDcEL9/openapi.json
