{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper — Videos, Comments & Danmaku",
    "description": "B站（哔哩哔哩）一站式数据采集器：快速批量抓取视频搜索结果、完整播放/点赞/投币/收藏数据、视频评论、全量弹幕、热门榜单与UP主主页，导出干净 JSON/CSV/Excel。Scrape Bilibili videos, search, comments, danmaku, trends & creator profiles from $0.50/1k.",
    "version": "0.1",
    "x-build-id": "IfakYoCZhORb9g8I0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alias_md5~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alias_md5-bilibili-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/alias_md5~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-alias_md5-bilibili-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/alias_md5~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-alias_md5-bilibili-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scraping Mode / 采集模式",
            "enum": [
              "search",
              "video",
              "comments",
              "danmaku",
              "popular",
              "creator"
            ],
            "type": "string",
            "description": "Choose what Bilibili data to extract / 选择需要采集的 B 站数据类型。",
            "default": "search"
          },
          "keywords": {
            "title": "Search Keywords / 搜索关键词",
            "type": "array",
            "description": "Keywords for Video Search mode (e.g. 'AI', 'NVIDIA', '人工智能') / 关键词搜视频模式下的搜索词列表。",
            "items": {
              "type": "string"
            },
            "default": [
              "AI",
              "NVIDIA"
            ]
          },
          "searchOrder": {
            "title": "Search Sort Order / 搜索排序方式",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Sort order for video search results / 视频搜索结果排序方式。",
            "default": "totalrank"
          },
          "maxItemsPerQuery": {
            "title": "Max Videos Per Keyword or Feed / 每个关键词或热榜最多抓取条数",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of videos to scrape per keyword or in Trending mode / 每个搜索词或热门榜单最多抓取的视频数量。",
            "default": 40
          },
          "bvids": {
            "title": "Video URLs or BVIDs / 视频链接或 BVID 列表",
            "type": "array",
            "description": "Accepts full Bilibili video URLs (https://www.bilibili.com/video/BV...) or bare BVIDs (BV1xE421j7Uv), automatically deduplicated / 支持直接粘贴完整 B 站视频链接或 BVID，自动提取并去重。",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxCommentsPerVideo": {
            "title": "Max Comments Per Video / 单个视频最多抓取评论数",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of comments to extract per video (paginates automatically up to 2,000 comments per video out of the box) / 评论模式下每个视频最多抓取的评论条数（开箱自动翻页，单视频支持抓取最多 2,000 条评论）。",
            "default": 100
          },
          "commentSortMode": {
            "title": "Comment Sort Order / 评论排序方式",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Choose whether to fetch most popular (hot) or newest comments in Comments mode / 评论模式下选择按最热或最新排序抓取。",
            "default": "hot"
          },
          "maxDanmakuPerVideo": {
            "title": "Max Danmaku Per Video / 单个视频最多抓取弹幕数",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of timestamped danmaku (bullet comments) to extract per video (hundreds to thousands available per video out of the box) / 弹幕模式下每个视频最多抓取的弹幕条数（单视频默认即可获取数百至上千条时间戳弹幕）。",
            "default": 500
          },
          "creatorMids": {
            "title": "Creator Space URLs or MIDs / UP主主页链接或 MID 列表",
            "type": "array",
            "description": "Accepts full creator space URLs (https://space.bilibili.com/14871346) or numeric MIDs (14871346), automatically deduplicated / 支持直接粘贴 UP 主主页链接或数字 UID（MID），自动提取并去重。",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "shouldIncludeVideoDetails": {
            "title": "Include Full Video Stats in Search / 搜索结果附带完整视频详情",
            "type": "boolean",
            "description": "In Search mode, fetch full engagement metrics (coins, shares, chapters) for each video / 开启后为每条搜索结果补充投币、分享、分P等完整视频详情。",
            "default": false
          },
          "shouldIncludeCommentsPreview": {
            "title": "Include Free Top 5 Comments with Video Details / 视频详情免费附赠前 5 条热门评论",
            "type": "boolean",
            "description": "Attach top 5 popular comments at no extra cost when scraping Video Details / 抓取视频详情时免费附赠前 5 条热门评论，不另计评论费用。",
            "default": false
          },
          "sessdata": {
            "title": "Optional Bilibili Session Cookie (SESSDATA) / 可选 SESSDATA Cookie",
            "type": "string",
            "description": "Not required for standard paginated comments (up to 2,000/video). Optional encrypted cookie only if needed for special or account-restricted cases; never logged or written to outputs / 标准翻页抓取评论（最多 2,000 条/视频）无需填写；仅在特殊场景下选填，严格加密且绝不写入日志或结果。"
          },
          "requestMinIntervalMs": {
            "title": "Delay Between Requests (ms) / 请求间隔（毫秒）",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum delay in milliseconds between consecutive requests / 连续请求之间的最小等待毫秒数。",
            "default": 250
          },
          "proxyConfiguration": {
            "title": "Network Routing Settings / 网络连接设置",
            "type": "object",
            "description": "Default routing configuration for reliable runs (enabled automatically) / 默认已开启稳定路由配置，一般无需修改。",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}