{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper 哔哩哔哩: Videos, Comments, Danmaku & Creators",
    "description": "Scrape Bilibili (哔哩哔哩) without login: search videos, full stats, comments, replies, danmaku, creator profiles and trending charts. Many sources in one run, monitor mode, from $0.002 per video.",
    "version": "0.1",
    "x-build-id": "IVATQNrECJKENFb4s"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smoldesk~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smoldesk-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/smoldesk~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-smoldesk-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/smoldesk~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-smoldesk-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": {
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search Bilibili videos by keyword. Chinese (人工智能) and English (AI tutorial) both work. Bilibili returns at most 1,000 videos per keyword; use the date filters below to go further back.",
            "items": {
              "type": "string"
            }
          },
          "autoLocalize": {
            "title": "Also search Chinese brand names",
            "type": "boolean",
            "description": "A Latin brand or game name (Nike, Tesla, Genshin Impact, ~120 built in) is also searched under the Chinese name Bilibili users write (耐克, 特斯拉, 原神). Results are merged and duplicates dropped; each video's matchedTerm says which term found it.",
            "default": true
          },
          "searchAliases": {
            "title": "Search aliases",
            "type": "array",
            "description": "Your own extra terms, merged with a keyword's results. One line per keyword: Nike = 耐克, 耐克鞋. A line without '=' applies to the only keyword when you search one.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Bilibili video links, BV IDs (BV1xx411c7mD), av IDs or b23.tv short links. Each video gets full stats; turn on comments / danmaku below to get those too.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Creators (UID or profile URL)",
            "type": "array",
            "description": "Bilibili creator UIDs (686127) or profile links (https://space.bilibili.com/686127). Returns the creator profile (followers, likes, video count, verification) and, if enabled, their latest videos.",
            "items": {
              "type": "string"
            }
          },
          "trending": {
            "title": "Trending videos",
            "enum": [
              "none",
              "popular",
              "ranking"
            ],
            "type": "string",
            "description": "Also scrape Bilibili's trending lists: 'Popular' is the live hot feed (up to 500 videos), 'Ranking' is the top-100 chart for a category.",
            "default": "none"
          },
          "rankingCategory": {
            "title": "Ranking category",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "kichiku",
              "fashion",
              "entertainment",
              "film-and-tv",
              "documentary",
              "movie",
              "tv-series"
            ],
            "type": "string",
            "description": "Category for the 'Ranking' chart.",
            "default": "all"
          },
          "maxVideosPerSearch": {
            "title": "Max videos per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many videos for each keyword (Bilibili's cap is 1,000).",
            "default": 20
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "How Bilibili orders search results.",
            "default": "relevance"
          },
          "searchDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only search videos of this length.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only search videos published on or after this date: YYYY-MM-DD, or relative like '7 days', '3 months', '1 year'."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only search videos published on or before this date: YYYY-MM-DD, or relative like '1 month'."
          },
          "includeUserVideos": {
            "title": "Include creators' videos",
            "type": "boolean",
            "description": "For each creator, also scrape their uploaded videos.",
            "default": true
          },
          "maxVideosPerUser": {
            "title": "Max videos per creator",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Newest first (or by the sort below).",
            "default": 20
          },
          "userVideoSort": {
            "title": "Creator videos sort",
            "enum": [
              "pubdate",
              "click",
              "stow"
            ],
            "type": "string",
            "description": "Order of a creator's videos.",
            "default": "pubdate"
          },
          "maxTrendingVideos": {
            "title": "Max trending videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Popular feed: up to 500. Ranking: up to 100.",
            "default": 20
          },
          "fetchDetails": {
            "title": "Full video stats",
            "type": "boolean",
            "description": "Fetch each video's detail page for likes, coins, shares, tags, honors and the uploader's follower count. Search results alone only have views, likes, favorites, comments and danmaku counts. Same price either way.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Scrape each video's comments as their own rows: the uploader's pinned comment, the most-liked and the newest, then their replies. Bilibili shows visitors who aren't logged in about 3 comments per order, so without a cookie expect ~6 top-level comments per video plus replies. Add your own Bilibili cookie below for full comment threads.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit of comment rows per video (top-level, plus replies when 'Fill with replies' is on).",
            "default": 20
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "hot",
              "time"
            ],
            "type": "string",
            "description": "Which order is read first. Both orders are read and merged; this decides which comments come first when the limit is low.",
            "default": "hot"
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Fixed number of replies per top comment (0 = use 'Fill with replies' instead). Replies are rows with isReply = true and parentId. With a value here, replies don't count toward the per-video limit.",
            "default": 0
          },
          "fillWithReplies": {
            "title": "Fill with replies",
            "type": "boolean",
            "description": "When 'Max replies per comment' is 0: after the top-level comments, add replies (which Bilibili shows without login) until 'Max comments per video' is reached.",
            "default": true
          },
          "bilibiliCookie": {
            "title": "Your Bilibili cookie (SESSDATA, optional)",
            "type": "string",
            "description": "For full comment threads (hundreds per video instead of ~6). Log in to bilibili.com in your browser, open DevTools (F12) → Application → Cookies → bilibili.com and copy the value of SESSDATA. Used only for comment requests, one at a time. Use a secondary account: this is your account and your risk. Stored encrypted by Apify. If it has expired, the run continues without it."
          },
          "includeDanmaku": {
            "title": "Include danmaku (弹幕)",
            "type": "boolean",
            "description": "Scrape the on-video scrolling comments (弹幕), the main audience-reaction data on Bilibili, each with the second of the video it appears at.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Danmaku are sampled evenly across the whole video timeline (not just the opening seconds). Bilibili serves up to ~1,000 to 3,000 recent danmaku per video.",
            "default": 50
          },
          "includeDanmakuProfile": {
            "title": "Danmaku profile per video",
            "type": "boolean",
            "description": "Add a danmakuProfile to each video: danmaku per minute, the busiest minute, a per-minute timeline, the most repeated danmaku and an evenly spread sample (with sentiment shares when sentiment is on). No extra rows; works without 'Include danmaku'.",
            "default": false
          },
          "danmakuAllParts": {
            "title": "Danmaku of all parts (P1, P2...)",
            "type": "boolean",
            "description": "For multi-part videos, read the danmaku of every part (up to 100), not just the first. Rows get part and partTitle.",
            "default": false
          },
          "sentimentAnalysis": {
            "title": "Sentiment analysis",
            "type": "boolean",
            "description": "Tag comments, danmaku and video titles/descriptions with a sentiment object: label (positive / neutral / negative) and score (-1 to 1), from a Chinese word list tuned for Bilibili slang (yyds, 绝了, 下头...). No AI model, no extra charge.",
            "default": false
          },
          "onlyNewVideos": {
            "title": "Only new videos (monitor mode)",
            "type": "boolean",
            "description": "Remember videos returned by earlier runs with the same keyword / creator / trending settings and only return new ones. Schedule the Actor to get a feed of new uploads.",
            "default": false
          },
          "followUpComments": {
            "title": "Follow-up comments (monitor mode)",
            "type": "boolean",
            "description": "With 'Only new videos' and 'Include comments': each video delivered is re-read once, at least 24 hours later, and only comments posted since the first read are returned (isFollowUp = true). Catches the discussion that builds up after upload. Up to 200 videos per run.",
            "default": false
          },
          "authorPrivacy": {
            "title": "Commenter data",
            "enum": [
              "full",
              "pseudonymous"
            ],
            "type": "string",
            "description": "Pseudonymous replaces commenter and danmaku-sender names, IDs and links with a stable authorKey / senderKey (salted per Apify account, so keys match across your runs but can't be reversed), and @mentions in text with @user_<key>. Creators and video uploaders are kept. Useful for GDPR / PIPL-minded research.",
            "default": "full"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Videos processed in parallel. Higher is faster but Bilibili rate-limits bursts.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: the Actor switches to Apify datacenter proxies on its own if Bilibili rate-limits the run. Residential proxies are ignored.",
            "default": {
              "useApifyProxy": false
            }
          },
          "compact": {
            "title": "Compact output (for AI agents)",
            "type": "boolean",
            "description": "Return smaller rows: only the main fields from the dataset views, without image links or empty values. Good for AI agents, MCP tools and LLM pipelines with limited context.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}