{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper API — Comments & Danmaku (B站弹幕)",
    "description": "Bilibili (哔哩哔哩/B站) scraper API for Chinese audience research. Search videos by keyword, then export stats, top comments and danmaku (弹幕) profiles with peak moments and samples. No login. JSON/CSV from $3 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "KtDE10kBreadyQi0T"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/peerless_columbine~bilibili-all-in-one-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-peerless_columbine-bilibili-all-in-one-scraper-api",
        "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/peerless_columbine~bilibili-all-in-one-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-peerless_columbine-bilibili-all-in-one-scraper-api",
        "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/peerless_columbine~bilibili-all-in-one-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-peerless_columbine-bilibili-all-in-one-scraper-api",
        "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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "video_detail",
              "video_comments",
              "popular",
              "ranking",
              "user_profile",
              "user_relation_stats",
              "user_videos",
              "video_danmaku",
              "danmaku_profile",
              "video_caption",
              "video_transcript",
              "live_info"
            ],
            "type": "string",
            "description": "What to scrape; each mode needs its own input: search (searchQuery), video_detail / video_comments / video_danmaku / danmaku_profile / video_caption / video_transcript (videoUrls), popular / ranking (optional category), user_profile / user_relation_stats / user_videos (userIds), live_info (liveRoomIds). Inputs for other modes are ignored. If both mode and operation are empty, popular is used. Example: `search`."
          },
          "operation": {
            "title": "SIAN-compatible operation alias",
            "type": "string",
            "description": "Advanced, leave empty: alias for mode used by the sian.agency Bilibili actor. Accepted values: searchVideo, videoDetail, videoComments, userDetail, userRelationStat, userVideos, videoDanmu, videoCaption. Must not contradict mode if both are set. Example: `searchVideo`."
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Search keyword for mode=search (required in that mode; ignored in other modes). Chinese keywords usually return far more results. Example: `人工智能教程`."
          },
          "keyword": {
            "title": "SIAN-compatible keyword alias",
            "type": "string",
            "description": "Alternative name for searchQuery (sian.agency compatibility). Set only one of the two; if both are set they must be identical. Example: `人工智能`."
          },
          "autoLocalize": {
            "title": "Auto-localize common brand names",
            "type": "boolean",
            "description": "For mode=search: also search the Chinese name of a few well-known brands typed in English (e.g. nike -> 耐克, tesla -> 特斯拉) and merge results. No effect for other keywords.",
            "default": true
          },
          "searchAliases": {
            "title": "Additional search aliases",
            "type": "array",
            "description": "For mode=search: extra keywords searched in addition to searchQuery; results are merged and de-duplicated, and maxResults is split across all queries. Example: `[\"AI教程\", \"机器学习入门\"]`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pubtimeBegin": {
            "title": "Published after",
            "type": "string",
            "description": "For mode=search: only videos published on or after this date (UTC), format YYYY-MM-DD. Leave empty for no lower bound. Example: `2026-01-01`."
          },
          "pubtimeEnd": {
            "title": "Published before",
            "type": "string",
            "description": "For mode=search: only videos published on or before this date (inclusive, UTC), format YYYY-MM-DD. Leave empty for no upper bound. Example: `2026-06-30`."
          },
          "videoUrls": {
            "title": "Video URLs / BVIDs / AIDs",
            "type": "array",
            "description": "Videos for the video_* and danmaku_profile modes: full video URLs (https://www.bilibili.com/video/BV...), BV IDs (e.g. BV1GJ411x7h7) or numeric AV IDs (e.g. 170001). Ignored in search, popular, ranking, user and live modes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "bvid": {
            "title": "Single BVID alias",
            "type": "string",
            "description": "Single video BV ID; same as adding one entry to videoUrls (compatibility alias). Example: `BV1GJ411x7h7`."
          },
          "aid": {
            "title": "Single numeric AID alias",
            "type": "string",
            "description": "Single numeric video AV ID (compatibility alias); used for video_detail / video_comments when videoUrls is empty, and together with cid for video_caption / video_transcript. Example: `170001`."
          },
          "cid": {
            "title": "Single CID",
            "type": "string",
            "description": "Advanced: numeric CID of one video part (page). Lets video_danmaku / danmaku_profile run without videoUrls, and with aid lets video_caption / video_transcript run. Usually leave empty - it is resolved from the video automatically. Example: `279786`."
          },
          "userIds": {
            "title": "Creator MIDs",
            "type": "array",
            "description": "Creator IDs (numeric Bilibili MID, the number in space.bilibili.com/<MID>) for user_profile, user_relation_stats and user_videos modes. Ignored in other modes. Example: `[\"546195\"]`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "userId": {
            "title": "Single creator MID alias",
            "type": "string",
            "description": "Single creator MID; same as adding one entry to userIds (compatibility alias). Example: `546195`."
          },
          "liveRoomIds": {
            "title": "Live room IDs / URLs",
            "type": "array",
            "description": "For mode=live_info: live room numeric IDs or live room URLs (https://live.bilibili.com/<id>). Ignored in other modes. Example: `[\"21452505\"]`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "roomId": {
            "title": "Single live room ID alias",
            "type": "string",
            "description": "Single live room ID; same as adding one entry to liveRoomIds (compatibility alias). Example: `21452505`."
          },
          "category": {
            "title": "Popular / ranking category",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "fashion",
              "entertainment"
            ],
            "type": "string",
            "description": "Category board for popular and ranking modes; `all` = no filter. Ignored in other modes.",
            "default": "all"
          },
          "includeComments": {
            "title": "Enrich discovered videos with comments",
            "type": "boolean",
            "description": "For search, popular, ranking and user_videos modes: also add up to maxComments public comment rows per found video (extra rows are billed).",
            "default": false
          },
          "includeReplies": {
            "title": "Expand comment reply chains",
            "type": "boolean",
            "description": "When collecting comments (video_comments mode or includeComments), also fetch replies to each comment; replies count toward maxComments.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Add danmaku profile for discovered videos",
            "type": "boolean",
            "description": "For search, popular, ranking and user_videos modes: also add one danmaku_profile row per found video (danmaku = on-screen bullet comments): count, unique senders, per-minute rate, peak minute and sample texts.",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Danmaku sample size",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Number of example danmaku texts kept in each danmaku_profile row (0 = none). Allowed range: 0–500.",
            "default": 25
          },
          "includeCreator": {
            "title": "Enrich video rows with creator profile rows",
            "type": "boolean",
            "description": "For search, popular, ranking and user_videos modes: also add one creator profile row for each creator appearing in the results.",
            "default": false
          },
          "includeTranscript": {
            "title": "Enrich video rows with available native transcripts",
            "type": "boolean",
            "description": "For search, popular, ranking and user_videos modes: also add the video's native subtitle text when Bilibili exposes a public subtitle track (no speech-to-text; many videos have none).",
            "default": false
          },
          "enrichDetails": {
            "title": "Enrich search/user-video rows with full video detail",
            "type": "boolean",
            "description": "For search and user_videos modes: fetch the full video detail for each result to fill more complete engagement fields (likes, coins, favorites, shares). Slower: one extra request per video.",
            "default": false
          },
          "requestDelayMillis": {
            "title": "Minimum delay between request starts",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Leave at default unless tuning: minimum gap in milliseconds between request starts. Raise it if you hit rate limits. Allowed range: 0–5000.",
            "default": 120
          },
          "sentimentAnalysis": {
            "title": "Chinese sentiment analysis",
            "type": "boolean",
            "description": "When true, adds a local Chinese sentiment score (-1 to +1, SnowNLP) and polarity to video titles/descriptions and comments. Heuristic only; non-Chinese text is tagged no_chinese_text. Use at least 512 MB memory. No extra fee.",
            "default": false
          },
          "sortOrder": {
            "title": "Search sort order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Sort order for mode=search. Accepted values: totalrank (relevance), click (most views), pubdate (newest), dm (most danmaku), stow (most favorites), scores (most comments).",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Duration filter",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Video length filter for mode=search. Accepted values: any, short (< 10 min), medium (10-30 min), long (30-60 min), verylong (> 60 min).",
            "default": "any"
          },
          "sortComments": {
            "title": "Comment sort",
            "enum": [
              "hot",
              "time",
              "likes"
            ],
            "type": "string",
            "description": "Comment ordering for video_comments mode and includeComments. Accepted values: hot (most popular, default), time (newest first), likes (most liked).",
            "default": "hot"
          },
          "maxResults": {
            "title": "Maximum result rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of primary results (videos, creators, comments etc. depending on mode); billing is per result row. Optional enrichment rows (includeComments/Danmaku/Creator/Transcript) come on top unless maxResultsScope=global. Allowed range: 1–10,000.",
            "default": 100
          },
          "maxPages": {
            "title": "Maximum source pages",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Optional cap on source pages fetched per query/target (a page holds about 20-50 items). Leave empty to page until maxResults is reached. Allowed range: 1–50. Example: `3`."
          },
          "maxComments": {
            "title": "Maximum comments per video",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum comment rows (including replies) per video, for video_comments mode and includeComments. Allowed range: 1–1000.",
            "default": 20
          },
          "maxRetries": {
            "title": "Retries for 403/412/429/5xx and Bilibili risk-control responses",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Leave at default unless tuning: retries for temporary blocks, rate limits (HTTP 403/412/429/5xx), network errors and Bilibili anti-bot responses. Allowed range: 0–8.",
            "default": 3
          },
          "maxResultsScope": {
            "title": "Result limit scope",
            "enum": [
              "primary",
              "global"
            ],
            "type": "string",
            "description": "How maxResults counts. Accepted values: primary (default: maxResults counts only the main videos/items; enrichment rows are extra), global (maxResults caps all rows together, so fewer videos are fetched when enrichment is on).",
            "default": "primary"
          },
          "maxOutputRows": {
            "title": "Hard total output row limit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on total rows written, including enrichment rows; may cut enrichment short. Your Apify max charge limit can stop the run earlier. Allowed range: 1–10,000.",
            "default": 10000
          },
          "deltaMode": {
            "title": "Only return unseen videos",
            "type": "boolean",
            "description": "For search, popular and ranking modes: return only videos not delivered by earlier runs with the same deltaStateKey (useful for scheduled monitoring). Seen IDs are stored in the named key-value store bilibili-delta-state. Don't run two runs with the same key at once.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Delta state key",
            "type": "string",
            "description": "Name that separates deltaMode history between different monitors; use a different key per query/workflow. Plain label, not a secret or API key. Only used when deltaMode is true. Example: `ai-tutorials-weekly`.",
            "default": "default"
          },
          "outputSchema": {
            "title": "Output schema",
            "enum": [
              "extended",
              "zhorex-strict"
            ],
            "type": "string",
            "description": "Row format. Accepted values: extended (default; adds coverage, warnings and other extra fields), zhorex-strict (only the fields of the zhorex Bilibili actor, for drop-in migration).",
            "default": "extended"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy settings. Default is a direct connection without proxy; enable Apify Proxy if you see rate-limit or risk-control errors.",
            "default": {
              "useApifyProxy": false
            }
          },
          "requestConcurrency": {
            "title": "Request concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Leave at default unless tuning: how many targets (videos, users, rooms) are processed in parallel. Allowed range: 1–20.",
            "default": 5
          },
          "zhorexInput": {
            "title": "Import zhorex input",
            "type": "object",
            "description": "Advanced, leave empty: paste a complete input JSON from the zhorex Bilibili actor to reuse it unchanged. When used, put all options inside this object (other top-level fields must stay at defaults). Stored encrypted because it may contain proxy credentials."
          },
          "sianInput": {
            "title": "Import sian.agency input",
            "type": "object",
            "description": "Advanced, leave empty: paste a complete input JSON from the sian.agency Bilibili actor (operation, keyword, maxPages...) to reuse it unchanged. When used, put all options inside this object (other top-level fields must stay at defaults). Stored encrypted because it may contain credentials."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}