{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper 哔哩哔哩 — Search, Videos, Danmaku & Rankings",
    "description": "Scrape Bilibili (B站) without login: keyword search, video stats and tags, full danmaku (bullet comments), all videos of an uploader (UP主), popular and ranking lists. $2 per 1,000 videos, $0.10 per 1,000 danmaku.",
    "version": "0.1",
    "x-build-id": "gqUzrYzdwFdDI6chS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/china-data~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-china-data-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/china-data~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-china-data-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/china-data~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-china-data-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": "Keywords to search Bilibili videos for, in any language. Each keyword returns up to 'Max results per keyword' videos.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Max results per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Bilibili shows at most 1,000 results per keyword.",
            "default": 100
          },
          "searchOrder": {
            "title": "Sort search results by",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Same options as the Bilibili search page.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Video length",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "4"
            ],
            "type": "string",
            "description": "Only return videos of this length.",
            "default": "0"
          },
          "videoUrls": {
            "title": "Video URLs or IDs (视频链接)",
            "type": "array",
            "description": "Full details for specific videos. Accepts bilibili.com/video/BV… links, b23.tv short links, BV IDs and av numbers.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Uploader IDs or space URLs (UP主)",
            "type": "array",
            "description": "Get the videos of these uploaders, newest first. Accepts numeric user IDs (mid) or space.bilibili.com/… links.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerUser": {
            "title": "Max videos per uploader",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Newest videos are returned first.",
            "default": 100
          },
          "popular": {
            "title": "Popular videos (综合热门)",
            "type": "boolean",
            "description": "Get the current list of popular videos.",
            "default": false
          },
          "maxPopular": {
            "title": "Max popular videos",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "The popular list has up to about 1,000 videos.",
            "default": 100
          },
          "rankingCategories": {
            "title": "Ranking lists (排行榜)",
            "type": "array",
            "description": "Get the current top-100 of these ranking lists (same categories as bilibili.com/v/popular/rank).",
            "items": {
              "type": "string",
              "enum": [
                "0",
                "1005",
                "1008",
                "1007",
                "1003",
                "1004",
                "1001",
                "1002",
                "1010",
                "1012",
                "1013",
                "1014",
                "1018",
                "1020",
                "1024"
              ],
              "enumTitles": [
                "All 全站",
                "Anime 动画",
                "Gaming 游戏",
                "Remix 鬼畜",
                "Music 音乐",
                "Dance 舞蹈",
                "Film & TV 影视",
                "Entertainment 娱乐",
                "Knowledge 知识",
                "Tech & Digital 科技数码",
                "Cars 汽车",
                "Fashion & Beauty 时尚美妆",
                "Sports 体育运动",
                "Food 美食",
                "Animals 动物"
              ]
            }
          },
          "maxPerRanking": {
            "title": "Max videos per ranking",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Rankings have up to 100 videos.",
            "default": 100
          },
          "includeDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Add coins, shares, tags, parts (分P) and the full description to videos from search, uploaders, popular and rankings. Uses two extra requests per video, so runs are slower. Videos from 'Video URLs' always have full details.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Danmaku (弹幕, bullet comments)",
            "type": "boolean",
            "description": "Save the danmaku of every scraped video as separate rows (type = danmaku), with the time in the video, text, sent time, position and colour.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Danmaku are charged per row, so this also caps the cost per video.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for most runs. Turn on Apify Proxy if Bilibili starts blocking requests on very large runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}