{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Comments, Creators & Rankings",
    "description": "Bilibili API alternative: scrape B站 (哔哩哔哩) videos, comments with replies, UP主 creator profiles and the official top-100 rankings by keyword, URL, creator or feed. Engagement rates included. $5 per 1,000 videos, $2 per 1,000 comments. No login or cookies needed.",
    "version": "0.1",
    "x-build-id": "9a7wbMnzKDbTJSlUS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawleast~bilibili-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawleast-bilibili-video-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/crawleast~bilibili-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawleast-bilibili-video-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/crawleast~bilibili-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawleast-bilibili-video-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": {
          "keywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Bilibili video search, one keyword per line (Chinese or English, e.g. 机械键盘 = mechanical keyboard). Up to 20 keywords. Bilibili itself returns at most 1,000 results per keyword.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Up to 300 videos: https://www.bilibili.com/video/BV…, m.bilibili.com links, BV ids or av ids (av170001 or 170001). b23.tv short links are not resolved — paste the full URL.",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator (UP主) URLs or mids",
            "type": "array",
            "description": "Up to 20 creators: https://space.bilibili.com/946974 or the numeric mid. Each creator gives one profile row (followers, total likes, video count, verification) plus a rollup computed from the videos fetched in this run, and up to maxVideosPerCreator of their newest videos.",
            "items": {
              "type": "string"
            }
          },
          "feeds": {
            "title": "Ranking / popular feeds",
            "type": "array",
            "description": "ranking = Bilibili's official top-100 board per region (see rankRegionIds); popular = the site-wide trending feed. Both are capped by maxVideos — set maxVideos to 100 to get a full board.",
            "items": {
              "type": "string",
              "enum": [
                "ranking",
                "popular"
              ],
              "enumTitles": [
                "Ranking — official board per region (up to 100)",
                "Popular — trending now"
              ]
            }
          },
          "rankRegionIds": {
            "title": "Ranking regions",
            "type": "array",
            "description": "Up to 5 region ids for the ranking feed. 0 = whole site, 1 Animation, 3 Music, 4 Gaming, 5 Entertainment, 36 Knowledge, 119 Remix, 129 Dance, 155 Fashion, 160 Life, 181 Film & TV, 188 Tech, 211 Food, 217 Animals, 223 Cars, 234 Sports.",
            "default": [
              0
            ]
          },
          "maxVideos": {
            "title": "Max videos (all inputs together)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Hard cap on video rows for the whole run, across all inputs (1–300). Creators split what is left evenly; feeds and keywords are then served in order until the cap is reached.",
            "default": 20
          },
          "maxVideosPerKeyword": {
            "title": "Max videos per keyword",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Per-keyword cap, applied together with maxVideos.",
            "default": 20
          },
          "maxVideosPerCreator": {
            "title": "Max videos per creator",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Newest videos fetched per creator, applied together with maxVideos. For full rollups on N creators set maxVideos ≥ N × this value.",
            "default": 40
          },
          "commentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Comment rows per delivered video (0–100). 0 = no comments. Videos are processed first; comments are then collected in video order.",
            "default": 0
          },
          "includeReplies": {
            "title": "Include replies (楼中楼)",
            "type": "boolean",
            "description": "Also fetch the replies under each comment, up to Max replies per comment. Replies are comment rows at the same price and count toward both comment caps; they follow their comment directly, before the next comment starts.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "With Include replies: at most this many replies under each comment (1–100), so one very long thread cannot use up a video's whole comment allowance. The comment's replyCount still shows the full thread size.",
            "default": 10
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "new"
            ],
            "type": "string",
            "description": "Hot = the pinned comment and Bilibili's hot list first; when a video's hot list is shorter than commentsPerVideo (common for videos with few liked comments) the rest is filled newest-first. Newest = most recent first. Each comment row's sort field says which list it came from; replies keep Bilibili's own order.",
            "default": "hot"
          },
          "maxCommentsTotal": {
            "title": "Max comments (whole run)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Hard cap on comment rows for the run (0–30,000). Comments are assigned first come, first served in video order, so later videos may get fewer or none; RUN_SUMMARY.perVideoComments shows what each video got.",
            "default": 1000
          },
          "maxTotalChargeUsd": {
            "title": "Spending cap (USD)",
            "minimum": 0,
            "type": "number",
            "description": "The run stops delivering before this amount would be exceeded. The lower of this value and the platform's max-charge setting applies.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Keep the default (Apify RESIDENTIAL, China). Bilibili rejects most requests from non-China IPs, including Apify's own servers; with other settings the run usually stops early with nothing delivered.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "CN"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}