{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Danmaku Scraper: Bullet Comments Downloader (B站弹幕)",
    "description": "Bilibili danmaku scraper (B站弹幕下载, 哔哩哔哩): download Bilibili bullet comments (弹幕) with playback timestamps from videos, searches, UP主 creators and popular or ranking feeds. Keyword filter, free density summaries, sentiment, delta mode. Export JSON, CSV or Excel. No login.",
    "version": "0.1",
    "x-build-id": "J5LAaIH1XP9ofeELa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/molded_mountainpass~bilibili-danmaku-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-molded_mountainpass-bilibili-danmaku-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/molded_mountainpass~bilibili-danmaku-scraper/runs": {
      "post": {
        "operationId": "runs-sync-molded_mountainpass-bilibili-danmaku-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/molded_mountainpass~bilibili-danmaku-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-molded_mountainpass-bilibili-danmaku-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",
        "properties": {
          "startUrls": {
            "title": "Bilibili video URLs, creator pages or search links",
            "type": "array",
            "description": "Video URLs (bilibili.com/video/BV…, b23.tv short links), creator pages (space.bilibili.com/123) or search pages (search.bilibili.com/all?keyword=…).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "videoIds": {
            "title": "Video IDs",
            "type": "array",
            "description": "BV ids or av ids.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Bilibili search keywords (B站搜索)",
            "type": "array",
            "description": "Each keyword is searched and up to 'Max videos per source' results are used.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Creator IDs (UID / mid)",
            "type": "array",
            "description": "Creator UIDs. Their uploads are used as videos.",
            "items": {
              "type": "string"
            }
          },
          "feed": {
            "title": "Feed",
            "enum": [
              "none",
              "popular",
              "ranking"
            ],
            "type": "string",
            "description": "Also take videos from the popular feed or the top-100 ranking.",
            "default": "none"
          },
          "rankingCategory": {
            "title": "Ranking category id",
            "type": "integer",
            "description": "0 = all. E.g. 1 animation, 3 music, 4 games, 36 knowledge, 188 tech, 160 life, 211 food.",
            "default": 0
          },
          "maxItems": {
            "title": "Max output items",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on danmaku rows for the whole run.",
            "default": 10000
          },
          "maxVideosPerSource": {
            "title": "Max videos per source",
            "minimum": 1,
            "type": "integer",
            "description": "Per search keyword, creator or feed.",
            "default": 20
          },
          "publishedAfter": {
            "title": "Only newer than",
            "type": "string",
            "description": "Absolute date (2024-05-01) or relative ('7 days', '12 hours'). Skips videos published earlier; search and creator pagination stop early, which keeps runs cheap."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Absolute date (2024-05-01) or relative ('30 days'). Skips videos published later. Search applies it on Bilibili's side, at no extra cost."
          },
          "searchOrder": {
            "title": "Search sort",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Order of search results. Bilibili returns at most 1,000 results per search.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Search: video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "very_long"
            ],
            "type": "string",
            "description": "Only return search results of this length. Bilibili filters them itself, at no extra cost.",
            "default": "any"
          },
          "uploadOrder": {
            "title": "Creator uploads sort",
            "enum": [
              "pubdate",
              "click",
              "stow"
            ],
            "type": "string",
            "description": "Order of a creator's uploads. With 'Newest', 'Published after' stops pagination at the first older upload.",
            "default": "pubdate"
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "type": "integer",
            "description": "0 = everything Bilibili serves.",
            "default": 0
          },
          "danmakuSource": {
            "title": "Danmaku source",
            "enum": [
              "both",
              "protobuf",
              "xml"
            ],
            "type": "string",
            "description": "Bilibili serves a sample spread over the video's lifetime (protobuf segments) and the most recent pool of a few thousand (XML). They barely overlap, so 'both' returns the most danmaku for one extra request per video.",
            "default": "both"
          },
          "allParts": {
            "title": "All parts of multi-part videos",
            "type": "boolean",
            "description": "Danmaku for every part (P1, P2, …) instead of only the first.",
            "default": false
          },
          "keywords": {
            "title": "Only danmaku containing",
            "type": "array",
            "description": "Keep only danmaku whose text contains one of these words (case-insensitive). Filtered before charging, so you pay only for matches. Empty = all danmaku.",
            "items": {
              "type": "string"
            }
          },
          "videoSummary": {
            "title": "Add a free summary row per video",
            "type": "boolean",
            "description": "Before each video's danmaku, output one uncharged 'summary' row: danmaku count, a 20-slice density timeline, the busiest moment (peak_time), the most repeated phrases and text samples. Computed over the collected (and keyword-filtered) danmaku.",
            "default": false
          },
          "summarySamples": {
            "title": "Text samples per summary",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many distinct danmaku texts each summary row includes, spread evenly over the video.",
            "default": 25
          },
          "sentimentAnalysis": {
            "title": "Sentiment analysis",
            "type": "boolean",
            "description": "Labels every danmaku positive, neutral or negative with a score from -1 to 1, using an AI model that understands Bilibili slang. Charged per label as a 'sentiment' event.",
            "default": false
          },
          "sentimentApiKey": {
            "title": "Your Groq API key (needed for sentiment)",
            "type": "string",
            "description": "Your own Groq API key, free at console.groq.com (takes a minute, no card needed), or a key for the provider below. Required for sentiment analysis: without a key the run still finishes, but with no sentiment labels and no sentiment charges. Stored encrypted."
          },
          "sentimentModel": {
            "title": "Model",
            "type": "string",
            "description": "Model name at the provider. The default is Qwen3 32B on Groq, which reads Chinese well.",
            "default": "qwen/qwen3-32b"
          },
          "sentimentApiUrl": {
            "title": "Provider API URL",
            "type": "string",
            "description": "Any OpenAI-compatible chat completions API. Default: Groq.",
            "default": "https://api.groq.com/openai/v1"
          },
          "onlyNewItems": {
            "title": "Only new items (delta mode)",
            "type": "boolean",
            "description": "Skip danmaku already returned by earlier runs with the same sources. You pay only for what is new, which suits scheduled monitoring.",
            "default": false
          },
          "deltaKey": {
            "title": "Delta key",
            "type": "string",
            "description": "Optional name to share delta history between tasks. Defaults to a hash of the sources."
          },
          "sessdata": {
            "title": "SESSDATA cookie (optional)",
            "type": "string",
            "description": "Login cookie from a bilibili.com account. Danmaku don't need it; it only raises some of Bilibili's limits. Stored encrypted."
          },
          "proxyStrategy": {
            "title": "Proxy strategy",
            "enum": [
              "auto",
              "none",
              "datacenter",
              "residential",
              "custom"
            ],
            "type": "string",
            "description": "'Auto' starts with no proxy (cheapest) and escalates to datacenter, then residential proxies only if Bilibili starts blocking.",
            "default": "auto"
          },
          "proxyCountry": {
            "title": "Residential proxy country",
            "type": "string",
            "description": "Two-letter code, e.g. HK, TW, SG. Empty = any."
          },
          "proxyConfiguration": {
            "title": "Custom proxy",
            "type": "object",
            "description": "Used only with the 'Custom' strategy.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxRequestsPerSecond": {
            "title": "Max requests per second",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Upper limit on requests to Bilibili. Higher is faster but triggers more risk-control blocks.",
            "default": 4
          },
          "maxConcurrency": {
            "title": "Videos processed in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos are scraped at the same time (still bounded by the request rate).",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}