{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili 哔哩哔哩 Scraper: Videos, Danmaku, Comments & UP主",
    "description": "Scrape Bilibili (哔哩哔哩, B站) without login: search, video stats, creator (UP主) profiles and uploads, popular and ranking lists, comments and danmaku reaction profiles. Mix keywords, videos and creators in one run. Fast HTTP, no browser.",
    "version": "0.1",
    "x-build-id": "F7lknoGEs3J9FU5BV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ragequit~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ragequit-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/ragequit~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ragequit-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/ragequit~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ragequit-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": "Keywords to search Bilibili videos for. Chinese works best (原神, 人工智能, 华为), English also works.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Bilibili video links or IDs, e.g. https://www.bilibili.com/video/BV1xx411c7mD, BV1xx411c7mD or av170001.",
            "items": {
              "type": "string"
            }
          },
          "creators": {
            "title": "Creators (UP主)",
            "type": "array",
            "description": "Creator IDs (mid) or profile links like https://space.bilibili.com/946974. Returns the creator's profile and latest videos. Channel names are not supported.",
            "items": {
              "type": "string"
            }
          },
          "trendingLists": {
            "title": "Trending lists",
            "type": "array",
            "description": "Popular: the current popular feed (综合热门). Ranking: the top-100 ranking board for the category below.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking"
              ],
              "enumTitles": [
                "Popular now",
                "Ranking board (top 100)"
              ]
            },
            "default": []
          },
          "rankingCategory": {
            "title": "Ranking category",
            "enum": [
              "all",
              "anime",
              "guochuang",
              "music",
              "dance",
              "gaming",
              "knowledge",
              "tech",
              "sports",
              "cars",
              "life",
              "food",
              "animals",
              "kichiku",
              "fashion",
              "entertainment",
              "movies"
            ],
            "type": "string",
            "description": "Category of the ranking board.",
            "default": "all"
          },
          "searchOrder": {
            "title": "Search order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "How search results are sorted.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Video length (search)",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only return videos of this length in searches.",
            "default": "any"
          },
          "maxVideosPerSearch": {
            "title": "Max videos per keyword",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Bilibili returns up to 1,000 results per keyword.",
            "default": 50
          },
          "maxVideosPerCreator": {
            "title": "Max videos per creator",
            "minimum": 0,
            "type": "integer",
            "description": "Latest videos to collect from each creator. 0 returns only the creator profile.",
            "default": 30
          },
          "maxTrendingVideos": {
            "title": "Max videos per trending list",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "The ranking board has 100 videos; the popular feed has a few hundred.",
            "default": 50
          },
          "includeVideoDetails": {
            "title": "Full video stats",
            "type": "boolean",
            "description": "Add likes, coins, shares and exact counts to videos found by search or on creator pages (one extra request per video). Videos from URLs and trending lists always have full stats.",
            "default": true
          },
          "includeDanmaku": {
            "title": "Danmaku reaction profile",
            "type": "boolean",
            "description": "For each video, add one row summarizing its danmaku (弹幕, the comments scrolling over the video): total count, unique senders, danmaku per minute, the peak minute, and a sample of texts spread across the whole video.",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Danmaku texts per video",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many danmaku texts to include in each profile, spread evenly over the video. 0 for numbers only.",
            "default": 25
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Add the video's top comments and their reply threads, one row per comment. Bilibili shows logged-out visitors the top 3 comments of each video, so expect up to 3 top-level comments plus their replies.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Replies per top comment",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Replies to collect under each top comment. 0 for top comments only.",
            "default": 10
          },
          "includeCreatorProfiles": {
            "title": "Creator profiles for every video",
            "type": "boolean",
            "description": "Also add a profile row (followers, video count, total likes, verification) for the creator of each video found. Creators you list above always get a profile.",
            "default": false
          },
          "onlyNewVideos": {
            "title": "Only new videos (monitoring)",
            "type": "boolean",
            "description": "Return only videos not seen in earlier runs, per keyword, creator and list. The first run returns everything and remembers it; scheduled runs then return just new videos. Seen videos are kept in a named key-value store in your account.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitoring store name",
            "type": "string",
            "description": "Name of the key-value store that remembers seen videos. Use a different name for each separate monitor.",
            "default": "bilibili-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many videos to process at the same time.",
            "default": 4
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many times to retry a request on a new IP when Bilibili's risk control blocks it.",
            "default": 6
          },
          "residentialFallback": {
            "title": "Switch to residential proxies when blocked",
            "type": "boolean",
            "description": "Start on cheap datacenter IPs and move to Apify residential proxies for the rest of the run if Bilibili blocks them. Only applies when you use Apify datacenter proxies.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxies work for most data; creator pages may need the residential fallback.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}