{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper",
    "description": "Scrape Bilibili (哔哩哔哩) videos by keyword, BV id, uploader or trending list: views, likes, coins, favorites, danmaku, tags, followers, comments and subtitle tracks. No login. Pay per video.",
    "version": "0.1",
    "x-build-id": "3g4phLVW5tyb7UMJT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/romajure~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-romajure-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/romajure~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-romajure-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/romajure~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-romajure-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": [
              "popular",
              "search",
              "video",
              "user"
            ],
            "type": "string",
            "description": "`popular`: trending / ranking lists (default). `search`: keyword search. `video`: specific BV ids, av ids or URLs. `user`: an uploader's (UP主) videos by mid or space URL.",
            "default": "popular"
          },
          "popularSource": {
            "title": "Popular list",
            "enum": [
              "popular",
              "ranking",
              "weekly",
              "precious"
            ],
            "type": "string",
            "description": "Popular mode only. `popular`: 综合热门, the live trending feed (paginated, up to ~1,000). `ranking`: 排行榜, top 100 of the last 3 days for one category. `weekly`: 每周必看, the weekly editor pick. `precious`: 入站必刷, the all-time must-watch list.",
            "default": "popular"
          },
          "rankingCategory": {
            "title": "Ranking category",
            "enum": [
              "0",
              "1",
              "3",
              "4",
              "5",
              "11",
              "23",
              "36",
              "119",
              "129",
              "155",
              "160",
              "168",
              "177",
              "181",
              "188",
              "211",
              "217",
              "223",
              "234"
            ],
            "type": "string",
            "description": "Popular list `ranking` only: which category board to read.",
            "default": "0"
          },
          "weeklyIssue": {
            "title": "Weekly issue number",
            "minimum": 1,
            "type": "integer",
            "description": "Popular list `weekly` only: issue number (e.g. 394). Empty = latest issue."
          },
          "searchQueries": {
            "title": "Search keywords",
            "uniqueItems": true,
            "type": "array",
            "description": "Search mode: one or more keywords, in Chinese or any language (`原神`, `黑神话悟空`, `AI 教程`). Each keyword is searched separately.",
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Search sort",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Search mode: `totalrank` relevance, `click` most played, `pubdate` newest, `dm` most danmaku, `stow` most favorited.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Search duration filter",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Search mode: 0 any length, 1 under 10 min, 2 10-30 min, 3 30-60 min, 4 over 60 min.",
            "default": 0
          },
          "videos": {
            "title": "Videos",
            "uniqueItems": true,
            "type": "array",
            "description": "Video mode: BV ids (`BV1qt411j7fV`), av ids (`av170001` or `170001`), video URLs (`https://www.bilibili.com/video/BV...`, `m.bilibili.com/video/...`) or `b23.tv` short links.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Uploaders",
            "uniqueItems": true,
            "type": "array",
            "description": "User mode: uploader ids (mid, e.g. `546195`) or space URLs (`https://space.bilibili.com/546195`).",
            "items": {
              "type": "string"
            }
          },
          "userOrder": {
            "title": "Uploader video order",
            "enum": [
              "pubdate",
              "click"
            ],
            "type": "string",
            "description": "User mode: `pubdate` newest first (default) or `click` most played first.",
            "default": "pubdate"
          },
          "maxVideos": {
            "title": "Max videos per query / uploader / list",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop each search keyword, uploader or popular list after this many videos. Bilibili search stops at 1,000 results (50 pages). Not used in video mode.",
            "default": 20
          },
          "fetchDetails": {
            "title": "Fetch full details",
            "type": "boolean",
            "description": "Read each video's detail record: complete stats (coins, shares, likes), tags, multi-part info and uploader follower count. One extra request per video, no extra charge. Turn off for faster list-only data (some stats then stay null).",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Attach top-level comments (with the pinned one first) to every video. Charged per comment as `comment-scraped`.",
            "default": false
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Upper limit of top-level comments per video when comments are on.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "time"
            ],
            "type": "string",
            "description": "`hot` most liked first (Bilibili default) or `time` newest first.",
            "default": "hot"
          },
          "includeSubtitles": {
            "title": "Include subtitle tracks",
            "type": "boolean",
            "description": "List each video's CC subtitle tracks (language, AI or human). Bilibili currently serves subtitle text only to logged-in users, so `text` is usually null; tracks whose file is public are downloaded with timed cues.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel requests. Bilibili's risk control reacts to bursts; 3 is a safe default.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxy works for every mode (verified from US IPs). Sessions are rotated automatically when Bilibili answers with risk-control codes (412, -352).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}