{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper & API: Videos, Comments, Danmaku, Trending",
    "description": "Bilibili (哔哩哔哩, B站) data without login: video search, popular board and top-100 rankings, full video stats, comments with replies, danmaku (bullet comments), creator profiles, every upload and a new-items watcher. Pay per result, from $1.50 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "zC6fmBtYPLEdVy3Eb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/varnmill~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-varnmill-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/varnmill~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-varnmill-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/varnmill~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-varnmill-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "searchCreators",
              "videos",
              "comments",
              "danmaku",
              "trending",
              "creators",
              "creatorVideos"
            ],
            "type": "string",
            "description": "What to scrape. search: videos matching keywords. searchCreators: creators (UP主) matching a name. videos: full details of given videos. comments: comment threads of given videos. danmaku: the bullet comments (弹幕) of given videos. trending: popular board, top-100 rankings, weekly and all-time must-watch lists. creators: creator profiles (followers, likes, video count). creatorVideos: every upload of given creators.",
            "default": "search"
          },
          "queries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used by 'search' and 'searchCreators'. Chinese or English keywords, one per line, e.g. 原神, iPhone 17, DeepSeek. Bilibili returns at most 1,000 videos per keyword.",
            "items": {
              "type": "string"
            }
          },
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Used by 'videos', 'comments' and 'danmaku'. Video URLs (bilibili.com/video/BV...), BV IDs, av IDs or b23.tv short links. Add ?p=2 to a URL to pick part 2 of a multi-part video for danmaku.",
            "items": {
              "type": "string"
            }
          },
          "creators": {
            "title": "Creators",
            "type": "array",
            "description": "Used by 'creators' and 'creatorVideos'. Creator IDs (mid, e.g. 546195), space.bilibili.com/<mid> links, or creator names (resolved with Bilibili's creator search; the exact name wins).",
            "items": {
              "type": "string"
            }
          },
          "boards": {
            "title": "Trending boards",
            "type": "array",
            "description": "Used by 'trending'. popular: Bilibili's hot board (about 640 videos). ranking: the top-100 ranking per category. weekly: the weekly must-watch issue (每周必看). mustWatch: the all-time must-watch list (入站必刷, ~100 videos).",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking",
                "weekly",
                "mustWatch"
              ],
              "enumTitles": [
                "Popular (热门)",
                "Top-100 ranking (排行榜)",
                "Weekly must-watch (每周必看)",
                "All-time must-watch (入站必刷)"
              ]
            },
            "default": [
              "popular"
            ]
          },
          "rankingCategories": {
            "title": "Ranking categories",
            "type": "array",
            "description": "Used by the 'ranking' board. One top-100 list per category; 0 = all of Bilibili. Only categories whose ranking Bilibili still updates are listed (its other category rankings have been frozen since spring 2025).",
            "items": {
              "type": "string",
              "enum": [
                "0",
                "1005",
                "1001",
                "1002",
                "1003",
                "1004",
                "1007",
                "1008",
                "1010",
                "1012",
                "1013",
                "1014",
                "1018",
                "1020",
                "1024"
              ],
              "enumTitles": [
                "All",
                "Anime & ACG (二次元)",
                "Film & TV (影视)",
                "Entertainment (娱乐)",
                "Music (音乐)",
                "Dance (舞蹈)",
                "Kichiku / remix (鬼畜)",
                "Gaming (游戏)",
                "Knowledge (知识)",
                "Tech & digital (科技数码)",
                "Cars (汽车)",
                "Fashion & beauty (时尚美妆)",
                "Sports (体育运动)",
                "Food (美食)",
                "Animals (动物)"
              ]
            },
            "default": [
              "0"
            ]
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "all",
              "original",
              "newcomers"
            ],
            "type": "string",
            "description": "Used by the 'ranking' board. all: every video. original: original uploads only. newcomers: creators new to the ranking.",
            "default": "all"
          },
          "weeklyIssue": {
            "title": "Weekly issue number",
            "minimum": 0,
            "type": "integer",
            "description": "Used by the 'weekly' board. 0 (default) = the latest issue. Issues are numbered from 1 (March 2019); e.g. 394 is the week of 2026-10-02.",
            "default": 0
          },
          "maxResults": {
            "title": "Max results per input",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Videos per keyword, board, ranking category or creator (or creators per name search). Search is capped by Bilibili at 1,000 per keyword; rankings at 100; the popular board at about 640.",
            "default": 50
          },
          "sortBy": {
            "title": "Search: sort by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Used by 'search'. Order of the search results.",
            "default": "relevance"
          },
          "duration": {
            "title": "Search: video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Used by 'search'. Keep only videos of this length.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Search: published after",
            "type": "string",
            "description": "Used by 'search'. Only videos published on or after this date (YYYY-MM-DD, UTC) or within a relative window such as '7 days' or '2 weeks'."
          },
          "publishedBefore": {
            "title": "Search: published before",
            "type": "string",
            "description": "Used by 'search'. Only videos published on or before this date (YYYY-MM-DD, UTC) or relative such as '1 day'. Leave empty for up to now."
          },
          "creatorVideosOrder": {
            "title": "Creator uploads: order",
            "enum": [
              "newest",
              "mostViewed"
            ],
            "type": "string",
            "description": "Used by 'creatorVideos'. newest: latest uploads first (the full list, paged). mostViewed: the creator's most-played videos first.",
            "default": "newest"
          },
          "includeDetails": {
            "title": "Add full video details",
            "type": "boolean",
            "description": "For search, trending and creator uploads: also read each video's page data to add coins, shares, likes, all tags, honors (e.g. 'top 19 on the ranking'), parts, creator follower count and subtitle languages. One extra request per video, charged as 'video-details'. Always on in 'videos' mode.",
            "default": false
          },
          "includeComments": {
            "title": "Add comments of every video",
            "type": "boolean",
            "description": "For search, trending, video details and creator uploads: also return each video's comments as 'comment' rows (up to 'Max comments per video'). Always on in 'comments' mode.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Comment rows per video, replies included. Bilibili served logged-out visitors about 1,200 top comments per video in our tests and had not run out.",
            "default": 100
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "hot: Bilibili's popular-comments order (most liked and discussed first). newest: newest first (use this with 'Only new items' to monitor new comments).",
            "default": "hot"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also return the replies under each comment (rows with isReply = true and rootCommentId). Replies count toward 'Max comments per video'.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Add danmaku of every video",
            "type": "boolean",
            "description": "For search, trending, video details and creator uploads: also return each video's danmaku (bullet comments). Always on in 'danmaku' mode.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku rows per video",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Bilibili keeps a pool of recent danmaku per video part (1,000 to 6,000 in our tests). When the pool is larger than this limit, rows are picked evenly through the pool in time order, so they follow where viewers commented instead of stopping after the first seconds.",
            "default": 1000
          },
          "danmakuOutput": {
            "title": "Danmaku output",
            "enum": [
              "rows",
              "summary",
              "both"
            ],
            "type": "string",
            "description": "rows: one row per danmaku (time in video, text, sent at, position, color). summary: one row per video with the danmaku count, unique senders, a per-minute histogram, the peak minute and an even sample. both: both.",
            "default": "rows"
          },
          "onlyNew": {
            "title": "Only new items (watcher)",
            "type": "boolean",
            "description": "Remember what earlier runs returned (per watcher name) and output only videos (or, in comments mode, comments) not seen before. Skipped items are not charged. Use with a Schedule to monitor a keyword, a board, a creator's uploads or a video's comments.",
            "default": false
          },
          "watcherName": {
            "title": "Watcher name",
            "type": "string",
            "description": "Names the saved 'seen' list so separate monitors do not mix, e.g. 'ev-weekly' or 'brand-comments'. Stored in the key-value store 'bilibili-scraper-state'.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Max parallel requests",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Requests sent at the same time. Requests are also paced to about 4 per second, because Bilibili blocks bursts. Keep the default unless runs get refused.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: Bilibili answers Apify servers directly. Set a proxy only if your runs are refused.",
            "default": {
              "useApifyProxy": false
            }
          },
          "autoProxyFallback": {
            "title": "Switch to Apify proxy when refused",
            "type": "boolean",
            "description": "When Bilibili refuses repeated requests from the run's server, retry through the Apify datacenter proxy automatically (only when no proxy is set above).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}