{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper - Videos, Comments, Danmaku & Creator Uploads",
    "description": "Scrape Bilibili (哔哩哔哩 B站) videos by keyword, link, creator or ranking: views, likes, coins, favorites, shares, tags. Add comments with replies, danmaku and danmaku profiles, creator profiles with bio contacts, live rooms and hot search. Monitor mode, no login. From $0.90 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "dqMAPNLHgGS5klPSz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-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/topapi~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-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/topapi~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-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": "What to scrape",
            "enum": [
              "search",
              "video_detail",
              "video_comments",
              "video_danmaku",
              "user_videos",
              "user_profile",
              "user_search",
              "popular",
              "hot_search",
              "live_search"
            ],
            "type": "string",
            "description": "Pick one per run. Search, links, uploads and popular return video rows; comments, replies, danmaku and profiles can be added to any of them under Extra data.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "One keyword, Chinese or English, for the search, creator-search and live-room modes. e.g. \"原神\", \"机械键盘\", \"AI tutorial\"."
          },
          "searchQueries": {
            "title": "More search queries",
            "type": "array",
            "description": "Extra keywords, each searched on its own (bulk). e.g. \"iPhone 17\", \"小米汽车\".",
            "items": {
              "type": "string"
            }
          },
          "searchAliases": {
            "title": "Search aliases",
            "type": "array",
            "description": "Other spellings searched with each query and merged into it, deduped by video. e.g. \"耐克\" for Nike.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video links or BV ids",
            "type": "array",
            "description": "For the video, comments and danmaku modes. Accepts bilibili.com/video/BV..., BV ids, av ids and b23.tv share links; ?p=2 picks a part.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Creator ids (mid)",
            "type": "array",
            "description": "For the uploads and profile modes: the number in space.bilibili.com/<mid>, or that link. e.g. \"946974\", \"https://space.bilibili.com/546195\".",
            "items": {
              "type": "string"
            }
          },
          "popularSource": {
            "title": "Popular list",
            "enum": [
              "popular",
              "ranking",
              "precious"
            ],
            "type": "string",
            "description": "For the popular mode: the popular feed (综合热门), the ranking (排行榜, by category) or the must-watch list (入站必刷).",
            "default": "popular"
          },
          "category": {
            "title": "Ranking category",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "kichiku",
              "fashion",
              "entertainment",
              "film"
            ],
            "type": "string",
            "description": "For the ranking: one category (zone) or all.",
            "default": "all"
          },
          "sortOrder": {
            "title": "Search sort",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "How Bilibili sorts search results.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Search only videos of this length.",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date. 2026-04-15, 2026/04/15, 20260415 or 2026-04-15T10:30:00Z; empty = no limit. Also filters uploads and popular rows."
          },
          "pubtimeEnd": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this date (same formats). A bare date means 00:00 UTC that day."
          },
          "searchCategoryId": {
            "title": "Search category id",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Bilibili category (tid) for search, e.g. 4 = games, 36 = knowledge, 188 = tech. 0 = all.",
            "default": 0
          },
          "sortComments": {
            "title": "Comment order",
            "enum": [
              "hot",
              "time",
              "likes"
            ],
            "type": "string",
            "description": "Hot (Bilibili's ranking), newest first, or hot re-sorted by likes within each page.",
            "default": "hot"
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Skip videos with fewer views. 0 = no limit.",
            "default": 0
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Skip videos with fewer likes. 0 = no limit.",
            "default": 0
          },
          "minDurationSec": {
            "title": "Minimum length (s)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Skip videos shorter than this many seconds. 0 = no limit.",
            "default": 0
          },
          "maxDurationSec": {
            "title": "Maximum length (s)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Skip videos longer than this many seconds. 0 = no limit.",
            "default": 0
          },
          "publishedWithinDays": {
            "title": "Published in the last N days",
            "minimum": 0,
            "maximum": 36500,
            "type": "integer",
            "description": "Keep only videos from the last N days (any mode). Pairs well with a daily schedule. 0 = no limit.",
            "default": 0
          },
          "includeKeywords": {
            "title": "Must contain",
            "type": "array",
            "description": "Keep a video only if its title, description or tags contain one of these words.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Must not contain",
            "type": "array",
            "description": "Drop a video whose title, description or tags contain one of these words.",
            "items": {
              "type": "string"
            }
          },
          "minFollowers": {
            "title": "Minimum followers",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Creator rows only: skip creators with fewer followers. 0 = no limit.",
            "default": 0
          },
          "onlyWithContacts": {
            "title": "Only creators with contacts",
            "type": "boolean",
            "description": "Creator rows only: keep creators whose public bio lists an email, WeChat, QQ or phone.",
            "default": false
          },
          "includeDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "For search, uploads and popular rows: also read each video's page data (coins, shares, tags, parts, cid, honors). No extra charge; slower.",
            "default": false
          },
          "includeRelated": {
            "title": "Related videos",
            "type": "boolean",
            "description": "Add Bilibili's 40 related videos to each video row (relatedVideos). No extra charge.",
            "default": false
          },
          "includeCreatorProfile": {
            "title": "Creator stats on video rows",
            "type": "boolean",
            "description": "Add the uploader's followers, video count, total likes, level and verification to each video row. No extra charge.",
            "default": false
          },
          "includeOnlineCount": {
            "title": "Watching now",
            "type": "boolean",
            "description": "Add how many people are watching each video right now (onlineCount). No extra charge.",
            "default": false
          },
          "includeStreamUrls": {
            "title": "Stream URLs",
            "type": "boolean",
            "description": "Add the DASH video and audio stream links a signed-out visitor gets (up to 480p; valid about 2 hours). No extra charge.",
            "default": false
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Also return each video's comments as their own rows (charged per comment).",
            "default": false
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Top-level comments per video, 20 per page, paged as deep as you ask.",
            "default": 20
          },
          "includeReplies": {
            "title": "Replies",
            "type": "boolean",
            "description": "Also return the replies under each comment (each a comment row with rootCommentId).",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum replies read under each comment.",
            "default": 10
          },
          "includeDanmaku": {
            "title": "Danmaku (弹幕)",
            "type": "boolean",
            "description": "Also return each video's danmaku (on-screen bullet comments), charged per danmaku. Output shape below.",
            "default": false
          },
          "danmakuOutput": {
            "title": "Danmaku output",
            "enum": [
              "packed",
              "rows"
            ],
            "type": "string",
            "description": "Packed = one dataset item per video holding its danmaku as an array (compact, the default). Rows = one dataset item per danmaku. Same price either way.",
            "default": "packed"
          },
          "maxDanmakuPerVideo": {
            "title": "Danmaku per video",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap per video part. Above the cap an even spread across the timeline is returned, not the first N.",
            "default": 1000
          },
          "danmakuAllParts": {
            "title": "All parts of multi-part videos",
            "type": "boolean",
            "description": "Read danmaku of every part (P1, P2...) instead of the first (or the ?p= part of the link).",
            "default": false
          },
          "danmakuStartSec": {
            "title": "Danmaku from second",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only danmaku shown at or after this second of the video. 0 = from the start.",
            "default": 0
          },
          "danmakuEndSec": {
            "title": "Danmaku to second",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only danmaku shown up to this second. 0 = to the end.",
            "default": 0
          },
          "includeDanmakuProfile": {
            "title": "Danmaku reaction profile",
            "type": "boolean",
            "description": "One row per video with danmaku count, unique senders, per-minute rate, peak minute and an evenly spread text sample (charged per profile).",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Profile sample size",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Danmaku texts in each profile's sample, spread evenly across the timeline.",
            "default": 25
          },
          "sentimentAnalysis": {
            "title": "Sentiment",
            "type": "boolean",
            "description": "Add a lexicon-based sentiment (polarity and a -1 to +1 score) to comments and to video title + description. No extra charge.",
            "default": false
          },
          "anonymizeUsers": {
            "title": "Anonymize commenters",
            "type": "boolean",
            "description": "Replace commenter names and ids with stable hashes and drop their avatars and bios.",
            "default": false
          },
          "monitorMode": {
            "title": "Only new rows (monitor)",
            "type": "boolean",
            "description": "Return only videos, comments, danmaku, creators, live rooms and topics no earlier run with the same store delivered. Pairs with a daily schedule.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Names the saved state, so separate monitors do not collide. e.g. \"nike-weekly\".",
            "default": "bilibili-monitor"
          },
          "followUpComments": {
            "title": "Follow up comments",
            "type": "boolean",
            "description": "With monitor and comments on: each run also reads the new comments under videos delivered by earlier runs (up to 200 videos).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Videos (or creators, live rooms, topics) per run. Bilibili's search returns about 1,000 per query; past that the run walks date windows. 0 = no limit.",
            "default": 100
          },
          "maxResultsPerSearch": {
            "title": "Max per keyword / creator",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Cap per keyword or per creator when you give several. 0 = only Max results applies.",
            "default": 0
          },
          "compact": {
            "title": "Compact output",
            "type": "boolean",
            "description": "Core fields only, sized for AI agents and MCP.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Requests go direct first; the proxy (then residential) is used only for a request Bilibili refuses from the container's IP.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos are read at the same time.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}