{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper｜B站视频信息/UP主资料/弹幕",
    "description": "Scrape public Bilibili video metadata, uploader profiles and danmaku as JSON for KOL analysis, trends and AI agents. No login, pay per result. 抓取B站公开视频信息、UP主资料和弹幕，输出JSON，不登录按条计费。",
    "version": "0.1",
    "x-build-id": "KwgLuoy21lFid8jJa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ahuang~bilibili-video-comments-danmaku-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ahuang-bilibili-video-comments-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/ahuang~bilibili-video-comments-danmaku-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ahuang-bilibili-video-comments-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/ahuang~bilibili-video-comments-danmaku-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ahuang-bilibili-video-comments-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "视频 / Videos",
            "type": "array",
            "description": "B站视频链接、b23.tv 短链、BV 号或 av 号，可批量；只接受 bilibili.com / b23.tv。Bilibili video URLs, b23.tv short links, BV or av ids (batch). Only bilibili.com / b23.tv accepted.",
            "items": {
              "type": "string"
            }
          },
          "dataTypes": {
            "title": "数据类型 / Data types",
            "type": "array",
            "description": "每个视频要抓取的数据。What to scrape for each video.",
            "items": {
              "type": "string",
              "enum": [
                "video",
                "comments",
                "danmaku",
                "subtitles",
                "profile"
              ],
              "enumTitles": [
                "视频元数据 / Video metadata",
                "评论（有限）/ Comments (limited)",
                "弹幕 / Danmaku",
                "字幕（有限，多数需登录）/ Subtitles (limited, login usually required)",
                "UP主资料 / Uploader profile"
              ]
            },
            "default": [
              "video"
            ]
          },
          "maxCommentsPerVideo": {
            "title": "每视频一级评论上限 / Max top-level comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "默认 100，但未登录时 B站实际只返回约 3–4 条一级评论。Default 100, but guests actually get only ~3–4 top-level comments from Bilibili.",
            "default": 100
          },
          "includeReplies": {
            "title": "包含楼中楼 / Include replies",
            "type": "boolean",
            "description": "同时抓取评论下的回复。Also fetch replies under each comment.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "每条评论回复上限 / Max replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "每条一级评论最多抓多少回复。Max replies fetched per top-level comment.",
            "default": 10
          },
          "maxDanmakuPerVideo": {
            "title": "每个分P弹幕上限 / Max danmaku per part",
            "minimum": 0,
            "type": "integer",
            "description": "公开 XML 接口，按视频内时间排序。公开接口只提供部分弹幕，不是全部历史。Public XML endpoint, sorted by in-video time. Partial sample, not full history.",
            "default": 500
          },
          "subtitleFormat": {
            "title": "字幕格式 / Subtitle format",
            "enum": [
              "markdown",
              "text",
              "srt",
              "json"
            ],
            "type": "string",
            "description": "markdown（带时间戳）、纯文本、SRT 或分段 JSON。Markdown with timestamps, plain text, SRT or segment JSON.",
            "default": "markdown"
          },
          "allPages": {
            "title": "全部分P / All parts",
            "type": "boolean",
            "description": "多P视频的每个分P都抓弹幕和字幕。默认开启：分P越多，计费成倍增加。Danmaku/subtitles for every part of multi-part videos. Default on: charges multiply by the number of parts.",
            "default": true
          },
          "maxConcurrency": {
            "title": "最大并发 / Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "建议保持较低以避免 412 限流。Keep low to avoid HTTP 412 rate limits.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}