{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper – Videos, Stats, Comments & Danmaku",
    "description": "Extract Bilibili (B站) videos with views, likes, coins, favorites, shares, tags and top comments. Search by keyword, scrape video URLs, creator (UP主) uploads, popular videos and danmaku. No login or cookies. $2.50 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "kBYbRAy14EF8zBBHk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/phantom-x64~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-phantom-x64-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/phantom-x64~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-phantom-x64-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/phantom-x64~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-phantom-x64-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",
        "properties": {
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search Bilibili videos by keyword, exactly like the search box on bilibili.com. Chinese, English or any language (e.g. 原神, lofi, iPhone 17 评测). Each keyword returns up to \"Max videos per source\" videos.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Video, creator or search URLs",
            "type": "array",
            "description": "Bilibili links or ids: video URLs (https://www.bilibili.com/video/BV1xx411c7mD), BV ids, av ids, b23.tv short links, creator pages (https://space.bilibili.com/946974), search URLs (https://search.bilibili.com/all?keyword=...) or the popular page (https://www.bilibili.com/v/popular/all).",
            "items": {
              "type": "string"
            }
          },
          "creators": {
            "title": "Creators (UP主)",
            "type": "array",
            "description": "Creators whose uploads you want: numeric UID (946974), space URL (https://space.bilibili.com/946974) or exact creator name (the best match of Bilibili's user search is used). Returns the creator profile (optional) and their latest videos.",
            "items": {
              "type": "string"
            }
          },
          "scrapePopular": {
            "title": "Popular videos (热门)",
            "type": "boolean",
            "description": "Also scrape the current Bilibili popular / trending list (https://www.bilibili.com/v/popular/all), up to \"Max videos per source\" videos.",
            "default": true
          },
          "maxVideos": {
            "title": "Max videos per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum videos per search keyword, per creator and for the popular list (Bilibili search returns at most 1,000 results per keyword). Video URLs are always scraped. Set 0 to get only creator profiles.",
            "default": 20
          },
          "videoDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Open every video to get the complete stats (views, likes, coins, favorites, shares, comments, danmaku), all tags, parts, subtitles languages and the uploader's follower count. Turn off for faster runs that only keep the fields shown in search results / upload lists.",
            "default": true
          },
          "searchOrder": {
            "title": "Search sort order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Order of search results.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Search video length",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "4"
            ],
            "type": "string",
            "description": "Only return search results of this length.",
            "default": "0"
          },
          "creatorVideoOrder": {
            "title": "Creator videos order",
            "enum": [
              "pubdate",
              "click",
              "stow"
            ],
            "type": "string",
            "description": "Which uploads of each creator to take first: newest, most viewed or most favorited.",
            "default": "pubdate"
          },
          "dateFrom": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date (search and creator uploads). Accepts YYYY-MM-DD, an ISO date-time or a relative value such as \"7 days\", \"24 hours\" or \"2 weeks\". Leave empty for no limit."
          },
          "dateTo": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this date (a plain YYYY-MM-DD includes the whole day). Same formats as \"Published after\". Leave empty for no limit."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Add comment rows for every video: the pinned comment, the top comments and their replies, with likes, date, user id, name, level and VIP status. Note: Bilibili shows only the first top comments and their reply threads to visitors who are not logged in; this actor never logs in.",
            "default": true
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum comment rows per video (top comments plus replies).",
            "default": 20
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Hot (most liked first, like the default Bilibili view) or newest first.",
            "default": "hot"
          },
          "includeCommentReplies": {
            "title": "Include comment replies",
            "type": "boolean",
            "description": "Also return the replies under each top comment (counted in \"Max comments per video\").",
            "default": true
          },
          "includeDanmaku": {
            "title": "Include danmaku (弹幕)",
            "type": "boolean",
            "description": "Add the bullet comments (danmaku) shown over the video: text, second of the video, color, mode, send date and anonymous user hash. Covers every part of multi-part videos.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Maximum danmaku rows per video (sorted by time in the video).",
            "default": 500
          },
          "includeCreatorInfo": {
            "title": "Creator profile rows",
            "type": "boolean",
            "description": "For every creator in \"Creators\" (or creator URL), add one profile row: name, bio, followers, following, video count, total likes, level, verification, live room status.",
            "default": true
          },
          "includeUploaderInfo": {
            "title": "Profile of every uploader found",
            "type": "boolean",
            "description": "Also add a creator profile row for the uploader of every video found by search, URL or popular list (one row per unique creator).",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel workers",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many videos/sources are processed at the same time. Each worker uses its own anonymous visitor session.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Minimum pause between two requests of the same worker, in milliseconds (a small random jitter is added). Lower values are faster but trigger Bilibili's rate limits sooner.",
            "default": 700
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a blocked or failed request is retried with a new visitor session (new cookies and proxy IP) and exponential backoff.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is recommended. Datacenter proxies usually work; switch to Residential if you see many \"blocked\" retries in the log.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}