# Douban Scraper - Movies, TV, Books & Music Metadata (`poetsc/douban-scraper`) Actor

Scrape Douban (豆瓣) movie, TV, book and music data: ratings, star distribution, genres, directors, cast, authors, publishers, tags and Top 250 rankings. No login needed. Clean English JSON.

- **URL**: https://apify.com/poetsc/douban-scraper.md
- **Developed by:** [Poetsc Data](https://apify.com/poetsc) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

### What does Douban Scraper do?

Douban Scraper extracts structured metadata from [Douban (豆瓣)](https://www.douban.com), China's largest rating site for movies, TV series, books and music. It returns clean JSON with English field names: rating, vote count, **1–5 star distribution**, genres, directors, cast, authors, publisher, page count, tags, Top 250 rank and more.

No login, cookies or proxies needed. It uses the same public endpoints as Douban's mobile site and paces requests politely.

### What can you scrape?

- **Rankings and charts**: Movie Top 250, Book Top 250, now showing, coming soon, weekly best movies, weekly best Chinese and global TV, popular TV by region (Chinese, American, Japanese, Korean, animation, variety), popular fiction and non-fiction, bestsellers, new books
- **Any subject by URL or ID**: `https://movie.douban.com/subject/1292052/`, `https://book.douban.com/subject/1007305/`, mobile links, or `movie:1292052` / `book:1007305` / `music:1394539`
- **Search by title**: look up movies, TV or books by Chinese or original title

This Actor collects **title-level metadata only**. It does not scrape user reviews, comments, user profiles or any personal data.

### Use cases

- Chinese box office and streaming market research: what's rated well, what's trending, by region and genre
- Book market and publishing analysis: ratings, publishers, prices, page counts for Chinese editions
- Enrich a movie or book catalog with Douban ratings next to IMDb or Goodreads scores
- Recommendation systems and datasets built on Douban Top 250 and genre percentiles
- Track weekly charts over time with a scheduled run

### How to use it

1. Pick one or more **Rankings & lists**, paste **Subject URLs**, or type titles into **Search by title**.
2. Set **Max items per list / search** (Top 250 lists go up to 250).
3. Click **Start** and download the results as JSON, CSV, Excel or via API.

### Input example

```json
{
  "collections": ["movie_top250", "book_top250"],
  "subjects": ["https://movie.douban.com/subject/1291546/"],
  "searchQueries": ["活着"],
  "searchType": "movie",
  "maxItemsPerSource": 250,
  "includeRatingDistribution": true
}
```

### Output example

```json
{
  "id": "1292052",
  "type": "movie",
  "url": "https://movie.douban.com/subject/1292052/",
  "title": "肖申克的救赎",
  "originalTitle": "The Shawshank Redemption",
  "subtitle": "1994 / 美国 / 剧情 犯罪 / 弗兰克·德拉邦特 / 蒂姆·罗宾斯 摩根·弗里曼",
  "year": 1994,
  "rating": 9.7,
  "ratingCount": 3344343,
  "ratingDistribution": { "star5": 85.42, "star4": 13.01, "star3": 1.36, "star2": 0.1, "star1": 0.11 },
  "genreRanks": [{ "genre": "犯罪片", "betterThanPercent": 99 }, { "genre": "剧情片", "betterThanPercent": 99 }],
  "genres": ["剧情", "犯罪"],
  "tags": ["犯罪", "越狱", "励志"],
  "honors": [{ "title": "豆瓣电影Top250", "rank": 1 }],
  "directors": ["弗兰克·德拉邦特"],
  "actors": ["蒂姆·罗宾斯", "摩根·弗里曼", "鲍勃·冈顿"],
  "countries": ["美国"],
  "languages": ["英语"],
  "durations": ["142分钟"],
  "collection": "movie_top250",
  "collectionRank": 1
}
```

Books add `authors`, `translators`, `publisher`, `pubDate`, `pages`, `price`, `series`, `authorIntro` and `tableOfContents`. TV adds `episodes`. Music adds `artists`, `media` and `tracks`.

### How much does it cost?

You pay per subject saved (see the Pricing tab). Scraping the full Movie Top 250 with star distributions costs well under a dollar, and it runs on the smallest memory setting.

### Tips

- Keep **Delay between requests** at 800 ms or more for runs of several hundred items. Douban may temporarily throttle very fast clients; the Actor retries with backoff.
- Use **Max total items** as a budget cap.
- Schedule the weekly charts to build a time series.

### Is it legal to scrape Douban?

This Actor only reads publicly available, non-personal title information that anyone can see without logging in. Make sure your use of the data complies with Douban's terms and the laws that apply to you.

### Feedback

Found a bug or need another field or chart? Open an issue on the Issues tab.

# Actor input Schema

## `collections` (type: `array`):

Douban charts to scrape, e.g. Movie Top 250, Book Top 250, now showing, popular TV by region.

## `subjects` (type: `array`):

Douban subject URLs (movie.douban.com/subject/1292052/, book.douban.com/subject/1007305/, m.douban.com links) or type:id strings like movie:1292052, book:1007305, music:1394539.

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

Titles to look up (Chinese or original title). Uses Douban's public autocomplete, returns the top matches.

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

Whether search queries look up movies & TV or books.

## `maxItemsPerSource` (type: `integer`):

How many subjects to take from each ranking or search query.

## `maxItems` (type: `integer`):

Hard cap on subjects saved in one run.

## `includeRatingDistribution` (type: `boolean`):

Adds the 1-5 star percentage split, genre percentile ranks and wish/watched counts (one extra request per subject).

## `requestDelayMs` (type: `integer`):

Politeness delay between requests to Douban. Keep it at 800+ for large runs.

## Actor input object example

```json
{
  "collections": [
    "movie_top250"
  ],
  "searchType": "movie",
  "maxItemsPerSource": 50,
  "maxItems": 500,
  "includeRatingDistribution": true,
  "requestDelayMs": 800
}
```

# Actor output Schema

## `results` (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 = {
    "collections": [
        "movie_top250"
    ]
};

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

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

```

## MCP server setup

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