# Douban Scraper: Movies, Books, Ratings, Comments & Reviews (豆瓣) (`dheerajitbhu/douban-scraper`) Actor

Scrape Douban (豆瓣) without login: movie, TV and book search, full details and ratings, short comments (短评), reviews (影评/书评) with full text, and charts. $3 per 1,000 rows.

- **URL**: https://apify.com/dheerajitbhu/douban-scraper.md
- **Developed by:** [dheeraj kumar](https://apify.com/dheerajitbhu) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 row 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?

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

## Douban Scraper: Movies, Books, Ratings, Comments & Reviews (豆瓣)

Scrape **Douban (豆瓣)**, China's biggest movie, TV and book rating site, with **no login and no cookie from you**. Search titles, get full details and ratings, export **short comments (短评)** and **reviews (影评/书评)** with full text, and pull **charts** such as "now in theaters".

**$3 per 1,000 rows.** That's 10× cheaper than the $30 per 1,000 charged for Douban reviews elsewhere.

> 中文简介：豆瓣数据采集，无需登录。支持电影/电视剧/图书搜索、条目详情（评分、评分人数、导演演员/作者出版社、简介、标签）、短评（最多约 150–200 条热门）、影评/书评（最多 40 篇热门，可选全文）、豆瓣榜单（正在热映、实时热门、热门剧集、虚构类图书等）。每 1000 条 3 美元。

### Modes

| Mode | Input | Rows |
|---|---|---|
| `search` | keywords, `searchType` movie (includes TV) or book | one row per title; `fetchDetails` adds full details |
| `subject` | Douban links or `movie:<id>` / `tv:<id>` / `book:<id>` | full details: rating and vote count, intro, directors, actors, genres, countries, release dates, durations, or authors, publisher, pages, price |
| `comments` | the same | short comments, most helpful first (up to about 150–200 per title) |
| `reviews` | the same | reviews, most helpful first (top 40 per title), `fullReviewText` for the whole review |
| `chart` | collection ids (`movie_showing`, `movie_real_time_hotest`, `tv_hot`, `book_fiction`…) | ranked titles |

### Pricing (pay per event)

| Event | Price |
|---|---|
| Run start | $0.001 |
| Row (title, comment or review) | **$0.003** ($3 per 1,000) |

Error rows are free. `maxChargeUsd` (default $5) stops the run cleanly before it goes over.

### Input examples

```json
{ "mode": "search", "searchQueries": ["三体", "活着"], "searchType": "book", "fetchDetails": true }
```

```json
{ "mode": "reviews", "subjectUrls": ["https://movie.douban.com/subject/1292052/"], "maxReviews": 40, "fullReviewText": true }
```

```json
{ "mode": "comments", "subjectUrls": ["https://movie.douban.com/subject/26647087/", "book:1007305"], "maxComments": 200 }
```

```json
{ "mode": "chart", "charts": ["movie_showing", "tv_hot"], "maxResults": 50 }
```

### Output examples (real rows, 2026-10-18, long text shortened)

Book (search + details):

```json
{ "type": "subject", "detail": "full", "subjectType": "book", "id": "2567698", "title": "三体", "rating": 8.9, "ratingCount": 518798,
  "commentCount": 125038, "reviewCount": 4801, "intro": "文化大革命如火如荼进行的同时。军方探寻外星文明的绝秘计划“红岸工程”取得了突破性进展。…",
  "url": "https://book.douban.com/subject/2567698/", "subtitle": "刘慈欣 / 2008 / 重庆出版社", "authors": ["刘慈欣"], "publisher": "重庆出版社",
  "pubdate": "2008-1", "pages": "302", "price": "23.00", "bookSubtitle": "“地球往事”三部曲之一", "searchQuery": "三体", "position": 1 }
```

Short comment:

```json
{ "type": "comment", "subjectType": "book", "subjectId": "1007305", "commentId": "532193706",
  "text": "盛衰之理，本为天命。然而人心就是如此。眼见得他起高楼，于是便不忍心见他楼塌了。…", "stars": 5, "votes": 11058, "status": "done",
  "createdAt": "2012-05-15T09:26:24+00:00", "authorName": "朱红尽颓", "authorId": "49117267" }
```

Review (with full text):

```json
{ "type": "review", "subjectType": "movie", "subjectId": "1292052", "reviewId": "1000369", "title": "十年·肖申克的救赎",
  "stars": 5, "usefulCount": 18956, "uselessCount": 735, "commentsCount": 1082, "createdAt": "2005-05-12T12:44:13+00:00",
  "url": "https://movie.douban.com/review/1000369/", "authorName": "大头绿豆", "authorId": "1000152",
  "content": "距离斯蒂芬·金（Stephen King）和德拉邦特（Frank Darabont）们缔造这部伟大的作品已经有十年了。…", "spoiler": false }
```

Chart:

```json
{ "type": "subject", "detail": "chart", "subjectType": "movie", "id": "37068446", "title": "生化危机：爆发夜", "year": "2026", "rating": 7.3,
  "ratingCount": 179182, "subtitle": "2026 / 德国 法国 美国 / 科幻 惊悚 恐怖 / 扎克·克雷格 / 奥斯汀·艾布拉姆斯 扎克·切利",
  "url": "https://movie.douban.com/subject/37068446/", "chart": "movie_showing", "rank": 1 }
```

### Compact output for AI agents

Set **Output format** to `compact` and the run still pushes the same rows to the dataset
at the same price — nothing about billing changes. It additionally writes `OUTPUT_COMPACT`
to the run's key-value store: a lossless columnar JSON encoding of the same rows (one
column-name header plus one array per row, instead of repeating every key name on every
row), which is cheaper to hand to an LLM than the plain dataset JSON.

Measured on a real 150-row export of this actor's short-comment rows (see
`benchmarks/compact-output/` in this repo for methodology and all 5 actors' numbers):

| Tokenizer | Pretty JSON | Minified JSON | Compact | vs Pretty | vs Minified |
|---|---:|---:|---:|---:|---:|
| cl100k_base (GPT-4/3.5) | 30,258 | 24,324 | 19,560 | 35.4% smaller | 19.6% smaller |
| o200k_base (GPT-4o) | 26,632 | 20,696 | 16,091 | 39.6% smaller | 22.3% smaller |

Decoding it back to the normal row objects is five lines of Python:

```python
def decode_columnar(payload):
    cols, marker = payload["columns"], payload["missing"]
    return [{c: v for c, v in zip(cols, row) if v != marker}
            for row in payload["rows"]]
```

### Good to know

- **No-login limits:** about the top 150–200 short comments and the top 40 reviews per title, sorted by helpfulness. "Latest first" ordering needs login.
- TV series links on movie.douban.com work; the actor detects TV automatically.
- Times are converted from Beijing time to UTC.
- **Privacy:** comment and review rows include only the author's public nickname and id. This actor does not collect avatars, locations or registration dates.

### Reliability

A self-test runs every day against all endpoints. If Douban blocks every request, the run **fails** instead of ending green with 0 rows.

**关键词：** 豆瓣爬虫, 豆瓣电影数据, 豆瓣读书, 豆瓣评分, 豆瓣短评采集, 豆瓣影评, Douban scraper, Douban API, Douban movie ratings, Douban book reviews.

# Actor input Schema

## `mode` (type: `string`):

What to scrape. No login or cookie is needed.

## `searchQueries` (type: `array`):

Used in 'search' mode. If left empty, the run uses 活着 as a sample keyword.

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

Douban's movie search also returns TV series.

## `fetchDetails` (type: `boolean`):

Open each search result for its full details (intro, directors/actors or authors/publisher, genres, tags…). Same price per row, one extra request each.

## `subjectUrls` (type: `array`):

Used in 'subject', 'comments' and 'reviews'. Examples: https://movie.douban.com/subject/1292052/, https://book.douban.com/subject/1007305/, or movie:1292052 / tv:26647087 / book:1007305.

## `maxResults` (type: `integer`):

Upper bound for search and chart modes.

## `maxComments` (type: `integer`):

Most-helpful first. Douban shows about the top 150–200 without login.

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

Most-helpful first. Douban shows the top 40 without login.

## `fullReviewText` (type: `boolean`):

Fetch each review's full text (one extra request per review, no extra charge). Off: you get the abstract.

## `charts` (type: `array`):

Douban collection ids, e.g. movie_showing (in theaters), movie_real_time_hotest, tv_hot, book_fiction. Used in 'chart' mode.

## `outputFormat` (type: `string`):

Dataset rows are always pushed and charged the same either way. 'compact' additionally writes OUTPUT_COMPACT to the run's key-value store: a lossless columnar JSON encoding of the same rows that is far cheaper to feed to an LLM and decodes back to the exact same rows.

## `maxChargeUsd` (type: `number`):

Hard spending cap. The run stops cleanly before going over it; rows already delivered are kept.

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

Default: Apify datacenter proxy. If Douban blocks it (HTTP 403/418/429), the run switches once to the RESIDENTIAL group automatically. Pick RESIDENTIAL to use it from the start.

## `requestIntervalSecs` (type: `number`):

Polite pacing between requests.

## Actor input object example

```json
{
  "mode": "search",
  "searchQueries": [
    "活着"
  ],
  "searchType": "movie",
  "fetchDetails": false,
  "maxResults": 20,
  "maxComments": 50,
  "maxReviews": 20,
  "fullReviewText": false,
  "charts": [
    "movie_showing"
  ],
  "outputFormat": "standard",
  "maxChargeUsd": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "requestIntervalSecs": 1.2
}
```

# Actor output Schema

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

Subjects, comments and reviews (field 'type').

# 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 = {
    "searchQueries": [
        "活着"
    ],
    "charts": [
        "movie_showing"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dheerajitbhu/douban-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 = {
    "searchQueries": ["活着"],
    "charts": ["movie_showing"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dheerajitbhu/douban-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 '{
  "searchQueries": [
    "活着"
  ],
  "charts": [
    "movie_showing"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call dheerajitbhu/douban-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dheerajitbhu/douban-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/evPablRYeDPPUp5vC/builds/8IG4HxbmW2Kc48ha2/openapi.json
