{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper | 哔哩哔哩 B站 Video Search: Views, Likes, Replies",
    "description": "Scrape Bilibili (China's dominant video platform) by keyword, video URL or creator ID: views, danmaku, likes, coins, favorites, shares, duration and creator stats. Public API, no login, no browser needed.",
    "version": "0.1",
    "x-build-id": "ofs74MYIPOJKE1XXi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-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/themineworks~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-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/themineworks~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-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": {
          "keywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Words to search on Bilibili, one per line, in Chinese or English. Example: 美食, cooking, minecraft. What comes back depends on Search type below. Up to 100 keywords.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "video",
              "creator",
              "live"
            ],
            "type": "string",
            "description": "What the keywords look for: videos (default), creators (UP主) or live rooms.",
            "default": "video"
          },
          "maxResultsPerKeyword": {
            "title": "Max results per keyword",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The most rows to return for each keyword. Bilibili serves up to 1,000 results per search; when you ask for more, the actor continues newest first under date windows that move back in time (video search). Example: 200.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort videos by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Video search only. Relevance is Bilibili's default.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Video search only.",
            "default": "any"
          },
          "categoryId": {
            "title": "Category (zone) ID",
            "minimum": 1,
            "type": "integer",
            "description": "Video search only. Keep to one Bilibili zone. Examples: 211 food, 4 games, 36 knowledge, 188 tech, 3 music, 129 dance, 160 life, 1 animation, 223 cars. Leave empty for all zones."
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Video search only. Date as YYYY-MM-DD (UTC), for example 2026-01-01."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Video search only. Date as YYYY-MM-DD (UTC); the whole day is included."
          },
          "creatorSortBy": {
            "title": "Sort creators by",
            "enum": [
              "relevance",
              "fans",
              "level"
            ],
            "type": "string",
            "description": "Creator search only.",
            "default": "relevance"
          },
          "videoUrls": {
            "title": "Video URLs or BV IDs (details)",
            "type": "array",
            "description": "Video links (https://www.bilibili.com/video/BV1xx411c7mD), BV ids or av numbers. One detail row per video: views, likes, coins, favorites, shares, danmaku and comment counts, tags, category, parts, duration, creator and subtitle languages.",
            "items": {
              "type": "string"
            }
          },
          "commentVideoUrls": {
            "title": "Video URLs or BV IDs (comments)",
            "type": "array",
            "description": "Videos whose comments you want, one row per comment or reply. Bilibili shows an anonymous visitor only a few top-level comments per video (3 hot and 3 newest), plus the first 20 replies under each. Those are what you get; the row field video_comment_total tells you how many the video really has.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerVideo": {
            "title": "Max comments and replies per video",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap per video for the comment list above. Bilibili's anonymous view tops out near 130 per video.",
            "default": 30
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also return the first 20 replies under each top-level comment. Replies count as comment rows.",
            "default": true
          },
          "danmakuVideoUrls": {
            "title": "Danmaku (弹幕): video URLs, BV IDs or av numbers",
            "type": "array",
            "description": "Videos whose bullet comments you want, one row per danmaku with its exact second in the video, text, color, display mode, send time and sender hash. Returns the video's current public display pool (often 1,000 to 8,000 per part). Multi-part videos include every part. Up to 50 videos per run.",
            "items": {
              "type": "string"
            }
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap per video. When capped, the highest-weight danmaku are kept and returned in timeline order. 0 returns the whole pool.",
            "default": 1000
          },
          "danmakuStartSec": {
            "title": "Danmaku window start (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Only danmaku at or after this second of the video.",
            "default": 0
          },
          "danmakuEndSec": {
            "title": "Danmaku window end (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Only danmaku at or before this second of the video. 0 means the end of the video.",
            "default": 0
          },
          "creatorIds": {
            "title": "Creator (UP主) UIDs or space links",
            "type": "array",
            "description": "Numeric Bilibili user IDs, for example 546195 (the number in space.bilibili.com/546195), or the space link. One profile row per creator: name, followers, following, video count, total likes, level, verification and bio.",
            "items": {
              "type": "string"
            }
          },
          "uploadsCreatorIds": {
            "title": "Creator UIDs (their uploaded videos)",
            "type": "array",
            "description": "Creators whose uploaded videos you want, one row per video with title, views, duration, publish date and link. Use Video URLs to get full stats for any of them.",
            "items": {
              "type": "string"
            }
          },
          "maxUploadsPerCreator": {
            "title": "Max uploads per creator",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most videos to return for each creator above, 30 per request.",
            "default": 30
          },
          "uploadsSortBy": {
            "title": "Sort uploads by",
            "enum": [
              "newest",
              "views"
            ],
            "type": "string",
            "description": "Newest first (default) or most viewed.",
            "default": "newest"
          },
          "liveRoomIds": {
            "title": "Live room numbers or links",
            "type": "array",
            "description": "Numbers from live.bilibili.com/21852 or the link itself. One row per room: title, status, viewers, streamer, followers, category and cover.",
            "items": {
              "type": "string"
            }
          },
          "hotLists": {
            "title": "Trending lists",
            "type": "array",
            "description": "Bilibili's own lists, one row per entry: popular (综合热门), weekly (每周必看), ranking (全站榜, or one zone), precious (入站必刷) and hotsearch (热搜 terms).",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "weekly",
                "ranking",
                "precious",
                "hotsearch"
              ],
              "enumTitles": [
                "Popular (综合热门)",
                "Weekly must-watch (每周必看)",
                "Ranking (全站榜)",
                "Must-watch classics (入站必刷)",
                "Hot search terms (热搜)"
              ]
            }
          },
          "maxHotItems": {
            "title": "Max entries per trending list",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "The most rows to return from each list above.",
            "default": 20
          },
          "rankingCategoryId": {
            "title": "Ranking zone ID",
            "minimum": 0,
            "type": "integer",
            "description": "Ranking list only. 0 is the whole site. Examples: 4 games, 36 knowledge, 188 tech, 211 food, 3 music, 129 dance, 160 life.",
            "default": 0
          },
          "useBilibiliApiHost": {
            "title": "Use api.bilibili.com (its robots.txt disallows crawlers)",
            "type": "boolean",
            "description": "On (default): video search, details, comments, creators, uploads and the trending lists read api.bilibili.com, the data service Bilibili's own web pages use. Its robots.txt says Disallow for all crawlers. Off: only routes whose robots.txt allows them are used (mobile pages for video details, creator profile and the first 20 search results, danmaku, live rooms, hot search terms); comments, uploads, creator and live search and the trending lists are skipped.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Bilibili limits how many requests one IP address may make. The Apify datacenter proxy rotates the address when it does. Turn the proxy off only for small runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}