{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili 哔哩哔哩 B站 Scraper: Full Comments, Danmaku 弹幕, Creators",
    "description": "Scrape Bilibili (哔哩哔哩 / B站) in 10 modes: search, video details, full comment threads, danmaku (弹幕), creator profiles and search, related videos, trending keywords and the popular board. Full threads, not the 1-3 comments most scrapers return. Chinese and English keywords. No login, cookie or proxy.",
    "version": "0.0",
    "x-build-id": "dfwc3MbNfrFbXkOGs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourabhbgp~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourabhbgp-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/sourabhbgp~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sourabhbgp-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/sourabhbgp~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sourabhbgp-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": "What to scrape",
            "enum": [
              "search",
              "video_detail",
              "creator_videos",
              "creator_profile",
              "creator_search",
              "video_comments",
              "danmaku",
              "related_videos",
              "hot_search",
              "popular"
            ],
            "type": "string",
            "description": "Pick one job per run. Search finds videos or creators by keyword, Video details and Comments and Danmaku and Related take video URLs, Creator videos and Creator profile take channel URLs, Trending keywords and Trending board take no target.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword to search. Works in Chinese and English, for example 人工智能 or python tutorial. Used in Search videos and Search creators modes."
          },
          "searchAliases": {
            "title": "Extra search terms",
            "type": "array",
            "description": "Additional terms to search and merge into the same result set, for example the Chinese name of a brand alongside the English one. Bilibili caps every single query at 1000 results, so extra terms are the only way past that ceiling. Used in Search mode.",
            "items": {
              "type": "string"
            }
          },
          "expandQuery": {
            "title": "Search wider (suggestions and Chinese script variants)",
            "type": "boolean",
            "description": "Search more widely for the same idea. Adds Bilibili's own related search suggestions, and for Chinese queries also searches the simplified and traditional forms. Those are genuinely different result sets on Bilibili: for computer, 电脑 and 電腦 shared only 10 of their top 20 results, and for AI, 人工智能 and 人工智慧 shared just 1. Used in Search videos and Search creators modes.",
            "default": false
          },
          "searchOrder": {
            "title": "Sort search results by",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "How to order search results. Used in Search mode.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Filter search results by video length. Used in Search mode.",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return videos published on or after this date, as YYYY-MM-DD. Leave empty for no limit. Used in Search mode."
          },
          "pubtimeEnd": {
            "title": "Published before",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return videos published on or before this date, as YYYY-MM-DD. Leave empty for no limit. Used in Search mode."
          },
          "videoUrls": {
            "title": "Video URLs or BV ids",
            "type": "array",
            "description": "Bilibili videos. Accepts a full URL, a bare BV id, an av id, or a b23.tv share link, for example https://www.bilibili.com/video/BV1uv411q7Mv or BV1uv411q7Mv or av170001. Used in Video details, Comments, Danmaku and Related videos modes.",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator URLs or ids",
            "type": "array",
            "description": "Bilibili creator pages, for example https://space.bilibili.com/946974 or the bare id 946974. Used in Creator videos and Creator profile modes.",
            "items": {
              "type": "string",
              "pattern": "^(https?://space\\.bilibili\\.com/\\d+.*|\\d+)$"
            }
          },
          "popularCategory": {
            "title": "Trending category",
            "enum": [
              "all",
              "1",
              "3",
              "4",
              "5",
              "36",
              "119",
              "129",
              "155",
              "160",
              "188",
              "211",
              "217",
              "234"
            ],
            "type": "string",
            "description": "Which board to read in Trending mode. All returns the site-wide popular feed.",
            "default": "all"
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many rows. Each video, comment or danmaku line counts as one row.",
            "default": 100
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Upper limit of comment rows per video, counting replies. Bilibili threads can run to tens of thousands, so raise this when you want a whole thread rather than the top of it.",
            "default": 50
          },
          "includeReplies": {
            "title": "Expand reply threads",
            "type": "boolean",
            "description": "Also pull the replies under each top level comment, each as its own row. This is the only way to get real thread depth without a Bilibili account. Used in Comments mode.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "How deep to follow each individual reply thread. Bilibili only inlines 2 or 3 replies per comment no matter how many there are, so this Actor pages the rest. Keep it low for a broad spread across many threads, raise it to pull whole conversations. Set 0 for top level comments only.",
            "default": 20
          },
          "sortComments": {
            "title": "Sort comments by",
            "enum": [
              "hot",
              "time"
            ],
            "type": "string",
            "description": "Order of the comment thread. Used in Comments mode and when comments are added to other modes.",
            "default": "hot"
          },
          "maxDanmakuPerVideo": {
            "title": "Maximum danmaku per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit of danmaku rows per video. Used in Danmaku mode.",
            "default": 500
          },
          "includeFullStats": {
            "title": "Fetch full engagement stats",
            "type": "boolean",
            "description": "Used in Creator videos mode. Bilibili's creator listing returns only the view count. Turn this on to look up each video individually so likes, coins, favourites, danmaku and comment counts are filled in too. It is slower and uses one extra request per video, so it is off by default.",
            "default": false
          },
          "includeComments": {
            "title": "Also scrape comments for each video",
            "type": "boolean",
            "description": "In Search, Creator videos and Trending modes, also pull the comment thread of every video found, one row per comment. This multiplies rows and cost, so it is off by default and bounded by Maximum comments per video.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Also scrape danmaku for each video",
            "type": "boolean",
            "description": "In Search, Creator videos and Trending modes, also pull the danmaku track of every video found, one row per danmaku. Samples evenly across the whole video, not just the opening seconds. Off by default.",
            "default": false
          },
          "deltaMode": {
            "title": "Only return items not seen before",
            "type": "boolean",
            "description": "Turns a one off scrape into a recurring monitor. Each run returns only items that earlier runs did not already deliver, so a schedule gives you new items and does not bill you again for old ones.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Names the saved list of already delivered items, so separate monitors do not collide. Use a distinct name per thing you track, for example nike-weekly. Used when Only return items not seen before is on.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Bilibili does not require a proxy for these endpoints and testing showed residential proxies perform worse than none, so leave this off unless you have a specific reason.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}