# Review & Rating Extractor (aggregate + individual) (`tom2turnt/review-extractor`) Actor

Extract the aggregate rating (value, count, best) AND individual reviews (author, rating, date, title, body) from public product, business, and article pages via JSON-LD Review and AggregateRating. HTML-only, fast, structured output with clean ok/error parity.

- **URL**: https://apify.com/tom2turnt/review-extractor.md
- **Developed by:** [Tommy G](https://apify.com/tom2turnt) (community)
- **Categories:** Other, Social media, Integrations
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

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

## 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

## Reviews & Ratings Extractor (Apify Actor)

Give it any public **page URL** and get back clean, normalized **review and rating** data — the
item being reviewed, its **aggregate rating** (value/best/count), and the **individual reviews**
on the page (author, rating, body, date) — pulled from schema.org `Review`, `AggregateRating`,
and review-bearing types in JSON-LD and microdata. HTML-only (no headless browser) so it's fast
and cheap. Ideal for **reputation monitoring, review datasets, and product/listing research**.

### What it extracts
For each page it returns one flat record with:

- **item_name**, **item_type** (what the reviews are about, e.g. Product / LocalBusiness / Recipe)
- **aggregate_rating**, **aggregate_best**, **aggregate_count** (the summary star rating)
- **reviews[]** — individual reviews found on the page, **reviews_extracted** (how many)

Plus control keys present on **every** row (ok and error alike, for clean buyer tables):
`status, requested_url, final_url, http_status, redirected, found, complete, page_type,
source, render_required, fields_found, error, extracted_at`.

### Input
```json
{ "startUrls": [{ "url": "https://example.com/product/123" }], "maxConcurrency": 5, "maxPages": 100 }
````

`maxPages` capped at 200, `maxConcurrency` at 20 (cost guard).

### Output — one STABLE record per URL (ok *and* error rows share the shape)

```json
{
  "status": "ok",
  "requested_url": "https://example.com/product/123",
  "final_url": "https://example.com/product/123",
  "http_status": 200,
  "found": true,
  "complete": true,
  "page_type": "review",
  "source": "json-ld",
  "item_name": "Acme Widget",
  "item_type": "Product",
  "aggregate_rating": 4.5,
  "aggregate_best": 5,
  "aggregate_count": 231,
  "reviews": [
    { "author": "Sam", "rating": 5, "body": "Works great.", "date": "2026-04-10" },
    { "author": "Lee", "rating": 4, "body": "Good value.", "date": "2026-04-02" }
  ],
  "reviews_extracted": 2,
  "fields_found": ["item_name", "aggregate_rating", "aggregate_count", "reviews"],
  "extracted_at": "2026-05-29T..."
}
```

`found:false` means no review/rating markup was present (e.g. a page with no schema.org review
data, or a JS-rendered review widget). Failed fetches return the same keys with
`status:"error"` + `error`.

### Use cases

- **Reputation monitoring** — track aggregate rating and review counts for your listings over time.
- **Review datasets** — collect individual reviews across many product/service pages for analysis.
- **Competitor / market research** — compare rating distributions and review volume across pages.

### Notes / safety

- Reads only **public** schema.org review/rating markup — facts-only, no PII beyond what the page
  itself publicly publishes; no raw page bodies stored.
- SSRF-guarded (scheme + private/metadata IP block + redirect re-check), robots-respecting,
  rate-limited, cost-capped — all via the shared `src/lib/actor_runner.js`.
- HTML-only: client-rendered review widgets that inject JSON via JS return `found:false`
  (no server-side markup to read). Core logic in `src/extract.js` (pure, unit-tested).

### Run locally / test

```bash
npm install
npm test     ## unit tests on the pure extractor (node:test)
```

### Publish to Apify (account-holder's step)

```bash
npm install -g apify-cli && apify login && apify push
```

Keep it free initially; enable pricing later via the adult account-holder once it shows repeat
organic usage and clears a margin gate.

# Actor input Schema

## `startUrls` (type: `array`):

Public page URLs (product, business, article) to extract aggregate rating + individual reviews from.

## `maxConcurrency` (type: `integer`):

Pages extracted in parallel (capped at 20).

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

Cost guard: maximum pages per run (hard ceiling 200).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://scrapeme.live/shop/Bulbasaur/"
    }
  ],
  "maxConcurrency": 5,
  "maxPages": 100
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://scrapeme.live/shop/Bulbasaur/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tom2turnt/review-extractor").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 = { "startUrls": [{ "url": "https://scrapeme.live/shop/Bulbasaur/" }] }

# Run the Actor and wait for it to finish
run = client.actor("tom2turnt/review-extractor").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 '{
  "startUrls": [
    {
      "url": "https://scrapeme.live/shop/Bulbasaur/"
    }
  ]
}' |
apify call tom2turnt/review-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Review & Rating Extractor (aggregate + individual)",
        "description": "Extract the aggregate rating (value, count, best) AND individual reviews (author, rating, date, title, body) from public product, business, and article pages via JSON-LD Review and AggregateRating. HTML-only, fast, structured output with clean ok/error parity.",
        "version": "0.1",
        "x-build-id": "3yLCY9gmOU96DLSqV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tom2turnt~review-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tom2turnt-review-extractor",
                "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/tom2turnt~review-extractor/runs": {
            "post": {
                "operationId": "runs-sync-tom2turnt-review-extractor",
                "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/tom2turnt~review-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-tom2turnt-review-extractor",
                "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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Page URLs",
                        "type": "array",
                        "description": "Public page URLs (product, business, article) to extract aggregate rating + individual reviews from.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Pages extracted in parallel (capped at 20).",
                        "default": 5
                    },
                    "maxPages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Cost guard: maximum pages per run (hard ceiling 200).",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
