CLI
Every command and subcommand, with the flags that matter.
douban <command> [subcommand] [flags]
Run douban <command> --help for the full flag list on any command. This
page is the map of the command tree.
Lookup commands
| Command | What it does |
|---|---|
search |
Cross-category search results (books, movies, music, more) |
suggest |
Fast autocomplete suggestions for a book or movie query |
book |
The full record for one book subject (bare id or pasted URL) |
top250 |
The movie Top 250 chart |
chart |
The weekly new-movies chart |
nowplaying |
Movies now in theaters (--coming for upcoming) |
doulist |
The subjects in a curated list (豆列), in list order |
version |
Print the version and exit |
Mirror commands
These build and query a local copy of the catalog. See the mirror guide for the full workflow.
| Command | What it does |
|---|---|
seed sitemap |
Seed the frontier from the sitemap, banded by entity type |
seed ids |
Seed a contiguous id range for one entity type |
seed url |
Seed one or more explicit URLs |
seed list |
Seed URLs from a file, one per line |
crawl |
Drain pending frontier URLs into the mirror; resumable |
export |
Stream normalized records as JSONL |
info |
Show the data dir, record/frontier counts, and disk usage |
queue |
Inspect frontier rows by status and type |
reset-failed |
Requeue failed rows for another crawl |
Mirror flags
The mirror commands share three flags on top of the persistent set:
| Flag | Meaning |
|---|---|
--data |
Mirror directory (default $DOUBAN_DATA, else $HOME/data/douban) |
--frodo-key |
Override the Frodo API key (or $DOUBAN_FRODO_KEY) |
--frodo-secret |
Override the Frodo API secret (or $DOUBAN_FRODO_SECRET) |
Shared flags
Every command renders through one engine and shares these persistent flags:
| Flag | Meaning |
|---|---|
-o, --output |
auto (default), table, markdown, json, jsonl, csv, tsv, url, raw |
--color |
auto (default), always, never; honors NO_COLOR |
--fields |
Comma-separated columns to keep |
--no-header |
Drop the table/csv header row |
--template |
Go text/template applied per record |
-n, --limit |
Stop after N records (0 = no limit) |
--rate |
Minimum delay between requests |
--timeout |
Per-request timeout |
--retries |
Retry attempts on rate limit or 5xx |
--user-agent |
Override the request User-Agent |
--db |
Tee every record into a store (e.g. out.db) |
--data-dir |
Override the data directory |
--dry-run |
Print actions without performing them |
-q, --quiet |
Suppress progress output |
-v, --verbose |
Increase verbosity (repeatable) |
auto output prints a table to a terminal and JSONL when piped, so the same
command reads well by hand and parses well in a script.
HTTP and MCP surfaces
The lookup commands are defined once and exposed over three surfaces, so a script, a service, or an AI agent reaches the same records without a new client.
douban serve --addr :8080 # HTTP: GET /v1/<command>?<flags as query params>
douban mcp # MCP server over stdio
douban serve mounts each lookup command at /v1/<command>, with /healthz
and the OpenAPI document at /v1/openapi.json. Flags become query parameters
(/v1/suggest?query=matrix&type=movie&limit=2) and a positional argument can
trail the path (/v1/book/1084336). Records stream as NDJSON. The mirror
commands are CLI-only and do not appear on the HTTP or MCP surfaces.
douban mcp speaks the Model Context Protocol over stdio, exposing the same
seven lookup commands as MCP tools.
What serves anonymously
Book subject pages and the search, suggest, chart, now-playing and doulist
surfaces serve fully over anonymous HTTPS. Movie subject and celebrity
detail pages redirect to a security challenge, so the lookup commands reach
movie detail through suggest and the list commands rather than a per-subject
fetch. The mirror reaches the same sealed surfaces through the signed Frodo API.