{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper API - B站 哔哩哔哩 Videos, 弹幕 Danmaku & UP主",
    "description": "📺 Scrape Bilibili (哔哩哔哩, B站) without login: keyword search with date, duration and category filters, full video stats, tags, UP主 profiles and uploads, comments and danmaku (弹幕). Deep search breaks the 1,000-result cap. B站数据采集，支持中英文关键词。Pay per result.",
    "version": "0.1",
    "x-build-id": "8fkk98sT3T6HPZe9g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapifier~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapifier-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/scrapifier~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapifier-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/scrapifier~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapifier-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": "What to search on Bilibili. Chinese and English both work (\"美食\", \"genshin impact\"). One search per keyword; with Deep search on, each search is split by publication date until every matching video is reached.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Specific videos: https://www.bilibili.com/video/BV1p5p26fEWB, a BV id, an av id, or a b23.tv share link. Each one always gets its full video page.",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator (UP主) space URLs or IDs",
            "type": "array",
            "description": "Creators: https://space.bilibili.com/504799975 or just 504799975. In Videos mode you get their uploads, in Creators mode their profile.",
            "items": {
              "type": "string"
            }
          },
          "dataType": {
            "title": "Data type",
            "enum": [
              "videos",
              "creators",
              "comments",
              "danmaku"
            ],
            "type": "string",
            "description": "Videos: one row per video with views, danmaku, comments, likes, coins, favourites and shares. Creators: one row per UP主. Comments and Danmaku: one row each, read from the videos your keywords, video URLs or creators resolve to.",
            "default": "videos"
          },
          "trending": {
            "title": "Trending board",
            "enum": [
              "none",
              "popular",
              "ranking",
              "newest_in_category",
              "hot_searches"
            ],
            "type": "string",
            "description": "Collect a board instead of (or on top of) a keyword search. Ranking and Newest follow the categories selected below.",
            "default": "none"
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "newest",
              "most_played",
              "most_danmaku",
              "most_favourited",
              "most_commented"
            ],
            "type": "string",
            "description": "Applied by Bilibili itself to every keyword search.",
            "default": "relevance"
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "any",
              "under_10min",
              "10_30min",
              "30_60min",
              "over_60min"
            ],
            "type": "string",
            "description": "Filter keyword searches by video length.",
            "default": "any"
          },
          "categories": {
            "title": "Categories (分区)",
            "type": "array",
            "description": "Empty = every category. Each category you select is searched separately, so none is dropped; they are also used by the Ranking and Newest boards. A few zones publish no \"newest\" feed — the run reports it per input.",
            "items": {
              "type": "string",
              "enum": [
                "douga",
                "guochuang",
                "cartoon",
                "music",
                "dance",
                "game",
                "knowledge",
                "tech",
                "life",
                "food",
                "animal",
                "kichiku",
                "fashion",
                "ent",
                "cinephile",
                "documentary",
                "movie",
                "teleplay",
                "news",
                "car",
                "sports"
              ],
              "enumTitles": [
                "Anime 动画",
                "Chinese anime 国创",
                "Cartoon 动漫",
                "Music 音乐",
                "Dance 舞蹈",
                "Gaming 游戏",
                "Knowledge 知识",
                "Tech & digital 科技数码",
                "Life 生活",
                "Food 美食",
                "Animals 动物圈",
                "Kichiku 鬼畜",
                "Fashion 时尚",
                "Entertainment 娱乐",
                "Cinephile 影视",
                "Documentary 纪录片",
                "Movies 电影",
                "TV series 电视剧",
                "News 资讯",
                "Cars 汽车",
                "Sports 运动"
              ]
            }
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "YYYY-MM-DD. Only videos published on or after this date."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "YYYY-MM-DD. Only videos published on or before this date."
          },
          "deepSearch": {
            "title": "Deep search (go past the 1,000-result cap)",
            "type": "boolean",
            "description": "Bilibili stops every keyword search at about 1,000 results. When a search fills up it is split into disjoint slices — by category 分区 first (the highest-yield cut), then by publication-date window, then by video length, then by the remaining sort orders — and every slice is deduplicated by video id. A saturated keyword returned 5,000+ unique videos this way instead of ~725. Turn off for a quick single-pass search.",
            "default": true
          },
          "includeVideoDetails": {
            "title": "Fetch each video's page",
            "type": "boolean",
            "description": "Adds the full description, tags, category, coins, favourites, shares, parts, resolution, publish location and honours to every video row. One extra request per video.",
            "default": false
          },
          "includeCreatorStats": {
            "title": "Add creator stats to video rows",
            "type": "boolean",
            "description": "Adds the creator's follower count, following count and total video count to every video row.",
            "default": false
          },
          "includeOnlineViewers": {
            "title": "Add live viewer counts",
            "type": "boolean",
            "description": "Adds how many people are watching each video right now (在线人数) to every video row. One extra request per video.",
            "default": false
          },
          "creatorVideos": {
            "title": "Uploads per creator",
            "minimum": 0,
            "type": "integer",
            "description": "In Videos mode, how many uploads to collect for each creator URL. 0 = every upload they have."
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Comments mode only. 0 = as many as the comment feed serves."
          },
          "includeCommentReplies": {
            "title": "Include reply threads",
            "type": "boolean",
            "description": "Comments mode only. Also collects the replies under each comment, linked by parentCommentId.",
            "default": false
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Comments mode only.",
            "default": "top"
          },
          "maxDanmakuPerVideo": {
            "title": "Danmaku per video",
            "minimum": 0,
            "type": "integer",
            "description": "Danmaku mode only. 0 = every bullet comment the player serves for that video."
          },
          "sessionCookie": {
            "title": "Your Bilibili SESSDATA (optional)",
            "type": "string",
            "description": "Optional, and only for comments. The public comment feed serves the top replies of each video; paste your own SESSDATA value, copied from a browser where you are logged in, to export whole threads. Videos, creators, danmaku and trending boards never need it."
          },
          "maxVideosPerSearch": {
            "title": "Max videos per search / board",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for each keyword, creator or trending board separately. 0 = no per-search cap."
          },
          "maxItems": {
            "title": "Max rows for the whole run",
            "minimum": 0,
            "type": "integer",
            "description": "Hard stop for the run, across every input. 0 = no limit."
          },
          "flatten": {
            "title": "Flatten nested fields (for CSV / Excel)",
            "type": "boolean",
            "description": "Turns lists and objects (tags, parts, latest videos) into single text columns, so a CSV or Excel export stays readable.",
            "default": false
          },
          "emitInputStatus": {
            "title": "Report what each input returned",
            "type": "boolean",
            "description": "Adds an input_status report to the run's OUTPUT record: rows collected per keyword, URL or board, the count Bilibili announced, and why anything came back empty.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed — this Actor reads Bilibili directly. Only switch a proxy on if your own runs need a specific exit country.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debug": {
            "title": "Verbose run log",
            "type": "boolean",
            "description": "Adds extra detail to the run log when you are debugging an input.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}