# Douban Reviews Scraper (`ws_tony/douban-reviews-scraper`) Actor

Scrape Douban (豆瓣) ratings, reviews & comments with sentiment tags for movies, TV, books, music & groups. Clean JSON for NLP/LLM training & analysis.

- **URL**: https://apify.com/ws\_tony/douban-reviews-scraper.md
- **Developed by:** [Tony](https://apify.com/ws_tony) (community)
- **Categories:** AI, Social media, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 long review (full body + sentiment)s

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

## Douban Reviews Scraper

Scrape public **Douban (豆瓣)** ratings, long-form reviews and short comments — each tagged with a **positive / neutral / negative sentiment** label — for movies, TV, books, music and groups. Built for media & entertainment researchers, publishers, recommendation-engine teams and AI-training-data buyers who need structured Chinese cultural-opinion data.

### What you get

Paste one or more Douban subject URLs and get a clean dataset with three record types:

- **`subject`** — the title, year, overall rating, rating count and genres.
- **`comment`** — short user comments (high volume) with star rating + sentiment.
- **`review`** — long-form reviews with full body text, star rating + sentiment.

Group URLs produce **`group_topic`** records (discussion topics with reply counts).

Sentiment is derived from the author's own Douban star rating — no guesswork, no ML black box: 5–4★ = `positive`, 3★ = `neutral`, 2–1★ = `negative`, unrated = `null`.

### Supported URLs

| Type | Example |
|---|---|
| Movie / TV | `https://movie.douban.com/subject/1292052/` |
| Book | `https://book.douban.com/subject/1084336/` |
| Music | `https://music.douban.com/subject/1407217/` |
| Group | `https://www.douban.com/group/beethoven/` |

### Example input

```json
{
    "startUrls": [
        { "url": "https://movie.douban.com/subject/1292052/" }
    ],
    "scrapeShortComments": true,
    "scrapeLongReviews": true,
    "maxCommentsPerSubject": 200,
    "maxReviewsPerSubject": 50,
    "fetchFullReviewText": true,
    "tagSentiment": true,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
````

### Example output

A short comment record:

```json
{
    "record_type": "comment",
    "id": "comment:1234567890",
    "subject_id": "1292052",
    "subject_type": "movie",
    "subject_title": "肖申克的救赎 The Shawshank Redemption",
    "author": "影迷小王",
    "author_url": "https://www.douban.com/people/12345/",
    "rating_stars": 5,
    "rating_label": "力荐",
    "sentiment": "positive",
    "content": "希望让人自由。每看一次都有新的感动。",
    "useful_count": 1842,
    "created_at": "2021-03-14T21:05:00+08:00",
    "source_url": "https://movie.douban.com/subject/1292052/comments?status=P&start=0&limit=20&sort=new_score",
    "scraped_at": "2026-06-15T09:12:00.000Z"
}
```

Field notes:

- `id` is stable across runs (built from Douban's comment/review id) — use it to deduplicate on your side.
- `rating_stars` / `sentiment` are `null` when the user left a comment without a rating.
- `created_at` is the original Douban timestamp in China Standard Time (UTC+8); `scraped_at` is ISO-8601 UTC.
- For long reviews, `content_truncated: false` means the full essay body was captured (`fetchFullReviewText` enabled).

### Pricing

Pay-per-event — you pay per item actually extracted, so cost scales with value:

| Event | Price |
|---|---|
| Long review (full body + sentiment) | $0.025 |
| Short comment | $0.005 |
| Subject info | $0.006 |
| Group topic | $0.012 |
| Actor start | $0.00005 |

(Final prices are shown on the Apify Store listing.)

### Limitations

- Douban serves a JavaScript proof-of-work anti-bot challenge, so this actor runs a **real headless browser** (Playwright + Chromium) to clear it. Recommended run settings: **4 GB memory** and **residential Apify Proxy**. The browser solves the challenge automatically and retries on a fresh session if it doesn't clear.
- Douban limits how deep short-comment pagination goes for logged-out access (typically the first few hundred). Set `maxCommentsPerSubject` realistically.
- A minority of titles (often sensitive ones) gate their **short comments** behind login entirely for logged-out visitors; for those, the actor still returns the subject info and long reviews, but short comments come back empty. Long reviews and ratings are not gated.
- Keep `maxConcurrency` modest (default 3). Under heavy concurrency Douban occasionally soft-throttles a page, which can make a single comment page come back empty; lower concurrency avoids this.
- Some music/book subject pages expose fewer fields (e.g. no genres); those come back `null`.
- Public data only — the actor never logs in or scrapes login-walled content.

### FAQ

**Which content should I scrape?** Toggle `scrapeShortComments`, `scrapeLongReviews` and `scrapeSubjectInfo` independently. Short comments are cheapest and highest-volume; long reviews are richer for sentiment / NLP work.

**Can I run this on a schedule?** Yes — use Apify Schedules. Reviews are evergreen, so weekly is usually plenty.

**How do I export to my DB / Google Sheets?** Use Apify Integrations or the Dataset API — every field above is available via `/items?format=json|csv|xlsx`. The dataset also ships pre-built **Short comments** and **Long reviews** table views.

**Why is sentiment sometimes null?** The user rated nothing, so there's no star signal to map. The raw `content` is still captured.

# Actor input Schema

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

One or more Douban URLs. Supported: movie & TV (movie.douban.com/subject/ID/), book (book.douban.com/subject/ID/), music (music.douban.com/subject/ID/) and group (douban.com/group/ID/). Paste the main subject page — the actor finds its reviews and comments automatically.

## `scrapeSubjectInfo` (type: `boolean`):

Output one record per subject with its title, year, overall rating, rating count and genres.

## `scrapeShortComments` (type: `boolean`):

Scrape short user comments (the high-volume rating + one-liner stream). Cheapest, highest-volume content.

## `scrapeLongReviews` (type: `boolean`):

Scrape long-form reviews (full essays). Higher value, richer text for sentiment / AI-training use.

## `maxCommentsPerSubject` (type: `integer`):

Hard cap on short comments scraped per subject. Douban paginates 20 per page.

## `maxReviewsPerSubject` (type: `integer`):

Hard cap on long reviews scraped per subject. Douban paginates 20 per page.

## `fetchFullReviewText` (type: `boolean`):

Long-review list pages only show a preview. When enabled, the actor opens each review to capture the full body. Costs one extra request per review.

## `tagSentiment` (type: `boolean`):

Derive a positive / neutral / negative sentiment label from the author's Douban star rating (5–4 = positive, 3 = neutral, 2–1 = negative, no rating = null).

## `proxyConfiguration` (type: `object`):

Douban blocks datacenter IPs. Residential Apify Proxy is strongly recommended for reliable runs.

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

Parallel headless-browser slots. Keep low — each uses a real Chromium instance and Douban rate-limits aggressively. Raise actor memory if you increase this.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://movie.douban.com/subject/1292052/"
    }
  ],
  "scrapeSubjectInfo": true,
  "scrapeShortComments": true,
  "scrapeLongReviews": true,
  "maxCommentsPerSubject": 200,
  "maxReviewsPerSubject": 50,
  "fetchFullReviewText": true,
  "tagSentiment": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 3
}
```

# 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://movie.douban.com/subject/1292052/"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ws_tony/douban-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 = {
    "startUrls": [{ "url": "https://movie.douban.com/subject/1292052/" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ws_tony/douban-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 '{
  "startUrls": [
    {
      "url": "https://movie.douban.com/subject/1292052/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call ws_tony/douban-reviews-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Douban Reviews Scraper",
        "description": "Scrape Douban (豆瓣) ratings, reviews & comments with sentiment tags for movies, TV, books, music & groups. Clean JSON for NLP/LLM training & analysis.",
        "version": "0.1",
        "x-build-id": "GcxrCMc7Weo2xJTsN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ws_tony~douban-reviews-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ws_tony-douban-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/ws_tony~douban-reviews-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ws_tony-douban-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/ws_tony~douban-reviews-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ws_tony-douban-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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Douban subject / group URLs",
                        "type": "array",
                        "description": "One or more Douban URLs. Supported: movie & TV (movie.douban.com/subject/ID/), book (book.douban.com/subject/ID/), music (music.douban.com/subject/ID/) and group (douban.com/group/ID/). Paste the main subject page — the actor finds its reviews and comments automatically.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "scrapeSubjectInfo": {
                        "title": "Scrape subject info",
                        "type": "boolean",
                        "description": "Output one record per subject with its title, year, overall rating, rating count and genres.",
                        "default": true
                    },
                    "scrapeShortComments": {
                        "title": "Scrape short comments",
                        "type": "boolean",
                        "description": "Scrape short user comments (the high-volume rating + one-liner stream). Cheapest, highest-volume content.",
                        "default": true
                    },
                    "scrapeLongReviews": {
                        "title": "Scrape long reviews",
                        "type": "boolean",
                        "description": "Scrape long-form reviews (full essays). Higher value, richer text for sentiment / AI-training use.",
                        "default": true
                    },
                    "maxCommentsPerSubject": {
                        "title": "Max short comments per subject",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Hard cap on short comments scraped per subject. Douban paginates 20 per page.",
                        "default": 200
                    },
                    "maxReviewsPerSubject": {
                        "title": "Max long reviews per subject",
                        "minimum": 0,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Hard cap on long reviews scraped per subject. Douban paginates 20 per page.",
                        "default": 50
                    },
                    "fetchFullReviewText": {
                        "title": "Fetch full review text",
                        "type": "boolean",
                        "description": "Long-review list pages only show a preview. When enabled, the actor opens each review to capture the full body. Costs one extra request per review.",
                        "default": true
                    },
                    "tagSentiment": {
                        "title": "Tag sentiment",
                        "type": "boolean",
                        "description": "Derive a positive / neutral / negative sentiment label from the author's Douban star rating (5–4 = positive, 3 = neutral, 2–1 = negative, no rating = null).",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Douban blocks datacenter IPs. Residential Apify Proxy is strongly recommended for reliable runs.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Parallel headless-browser slots. Keep low — each uses a real Chromium instance and Douban rate-limits aggressively. Raise actor memory if you increase this.",
                        "default": 3
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
