{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper",
    "description": "[💰 $1.40 / 1K videos] Scrape Bilibili (B站) videos, comments and danmaku. Just add a search, links or creators and get every video count, comments with replies and danmaku, past 1,000 videos per search, 1,000 videos in about 15 seconds. Monitor new videos. Export JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "QYQBTAVoIPi2hdepe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sleepmodesystems~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sleepmodesystems-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/sleepmodesystems~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sleepmodesystems-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/sleepmodesystems~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sleepmodesystems-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 words",
            "type": "array",
            "description": "Bilibili's own video search, in Chinese or English: 我的世界, 人工智能, minecraft. Bilibili stops one search at 1,000 videos; ask for more in \"Maximum videos per source\" and the run splits the search by publication date to read past that. A search link (search.bilibili.com/all?keyword=...) keeps its sort, length and date filters.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Bilibili links or video ids",
            "type": "array",
            "description": "Any public Bilibili page: a video (www, m., b23.tv short links, ?p=2 parts, links with tracking parameters), a creator (space.bilibili.com/546195), a search page, Popular (bilibili.com/v/popular/all), the weekly picks or a ranking (bilibili.com/v/popular/rank/game). Bare ids work too: BV1xx411c7mD, av170001.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "creators": {
            "title": "Creators (UP主)",
            "type": "array",
            "description": "Creators by name, UID or link: 老番茄, 546195, https://space.bilibili.com/546195. Each gives one creator row (followers, likes, video count, verification) and then their videos, newest first unless you pick another sort. A name is looked up in Bilibili's creator search; the plan in the log says which creator it found.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trending": {
            "title": "Trending lists",
            "type": "array",
            "description": "Bilibili's Popular page (about 1,000 videos), the latest weekly picks, the all-time must-watch list, and the top 100 ranking of each category.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "weekly",
                "precious",
                "rank-all",
                "rank-anime",
                "rank-guochuang",
                "rank-music",
                "rank-dance",
                "rank-game",
                "rank-knowledge",
                "rank-tech",
                "rank-sports",
                "rank-car",
                "rank-life",
                "rank-food",
                "rank-animal",
                "rank-kichiku",
                "rank-fashion",
                "rank-entertainment",
                "rank-film"
              ],
              "enumTitles": [
                "Popular now (热门)",
                "Weekly picks, latest issue (每周必看)",
                "All-time must-watch (入站必刷)",
                "Top 100: All",
                "Top 100: Animation",
                "Top 100: Chinese animation",
                "Top 100: Music",
                "Top 100: Dance",
                "Top 100: Gaming",
                "Top 100: Knowledge",
                "Top 100: Tech",
                "Top 100: Sports",
                "Top 100: Cars",
                "Top 100: Life",
                "Top 100: Food",
                "Top 100: Animals",
                "Top 100: Kichiku (remix)",
                "Top 100: Fashion",
                "Top 100: Entertainment",
                "Top 100: Film and TV"
              ]
            },
            "default": []
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "The order of search results. Creators' videos follow it when Bilibili offers it (newest, most viewed, most favorited), else newest first.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this day (YYYY-MM-DD, China time), or a relative value: 7 days, 1 month."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this day."
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Bilibili's own length filter.",
            "default": "any"
          },
          "videoDetails": {
            "title": "Honors",
            "type": "boolean",
            "description": "Every video always comes with views, likes, coins, favorites, shares, danmaku and comment counts, its tags and the creator's follower count. This adds Bilibili's honors (weekly picks, rankings, top lists the video made), which need each video's own page: runs take longer.",
            "default": false
          },
          "commentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Adds up to this many comments to each video (20 is a good start), with author, level, likes and replies; the Comments tab of the output lists them one per row. Off by default, as on other Bilibili scrapers: with 0 the Comments tab stays empty. Billed per comment.",
            "default": 0
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Pinned comments come first either way.",
            "default": "hot"
          },
          "commentReplies": {
            "title": "Comment replies",
            "type": "boolean",
            "description": "Adds the replies under each comment, one row each. Bilibili shows visitors only a handful of top-level comments per video; the replies under them are all there, so a busy video still gives hundreds. Off: top-level comments only.",
            "default": true
          },
          "danmaku": {
            "title": "Danmaku (弹幕)",
            "type": "boolean",
            "description": "Adds the video's danmaku track to its row, at no extra charge: every bullet comment with its second in the video, text, color, mode and send time, plus a per-minute profile and the peak minute. Bilibili's player track holds up to a few thousand per video.",
            "default": false
          },
          "danmakuAllParts": {
            "title": "Danmaku of every part",
            "type": "boolean",
            "description": "For videos in several parts (P1, P2...), reads every part's danmaku, each tagged with its part. Off: the first part, or the part a link names (?p=2).",
            "default": false
          },
          "maxItems": {
            "title": "Maximum videos",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many videos in total. Each video comes with its comments, danmaku and transcript when you ask for them.",
            "default": 100000
          },
          "maxVideosPerSource": {
            "title": "Maximum videos per source",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each search, creator, list or link after this many videos. Above 1,000, searches are split by publication date to read past Bilibili's own cap. 0 for no limit.",
            "default": 1000
          },
          "onlyNewVideos": {
            "title": "Only new videos",
            "type": "boolean",
            "description": "Return only videos an earlier run with the same monitor did not deliver, with their comments. Videos delivered before are skipped before anything else is read and are never charged. The first run delivers everything it finds; ids are kept 180 days after a video was last seen.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the list of delivered videos. Leave empty to tie it to this input (sources and filters): a changed input starts a new list. Give a name to share one list between inputs or tasks."
          },
          "authorPrivacy": {
            "title": "Commenters",
            "enum": [
              "full",
              "pseudonymous"
            ],
            "type": "string",
            "description": "Pseudonymous replaces each commenter's name, UID and avatar with a key that stays the same across your runs (so threads and repeat commenters still link up), and masks @mentions in comment text.",
            "default": "full"
          },
          "privacySalt": {
            "title": "Pseudonymous key secret",
            "type": "string",
            "description": "Optional. Keys depend on this secret: the same secret gives the same keys in any account. Empty: keys are tied to your Apify account."
          },
          "runLabel": {
            "title": "Run label",
            "type": "string",
            "description": "Optional. Written as `label` on every row, to tell snapshots, panels or query versions apart (e.g. panel-A 2026-11)."
          },
          "minItems": {
            "title": "Minimum videos",
            "minimum": 0,
            "type": "integer",
            "description": "Fail the run if fewer videos were found. Left empty: 1 for trending, 0 for a search, a link, a creator, dates or a duration filter, which may rightly find nothing."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}