{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper – Videos, Search, Rankings, Comments & Danmaku",
    "description": "Bilibili scraper for public data, no login: popular and ranking (排行榜) videos, keyword search, video details with views, likes, coins and favorites, comments, danmaku (弹幕 bullet comments) and uploader search. Pay per result.",
    "version": "1.0",
    "x-build-id": "n84hb5NT7dQ2rq0SA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/openharvest~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-openharvest-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/openharvest~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-openharvest-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/openharvest~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-openharvest-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": [
              "popular",
              "ranking",
              "search",
              "videos",
              "searchUploaders"
            ],
            "type": "string",
            "description": "<b>popular</b> = Bilibili's current popular (热门) list. <b>ranking</b> = top-100 ranking (排行榜) of a category. <b>search</b> = videos matching your keywords. <b>videos</b> = specific videos from links / BV ids. <b>searchUploaders</b> = uploader (UP主) channels matching your keywords.",
            "default": "popular"
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used by <b>search</b> and <b>searchUploaders</b>. Chinese or English keywords, one per line, e.g. <code>原神</code>, <code>minecraft</code>, <code>影视飓风</code>.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video links or BV ids",
            "type": "array",
            "description": "Used by <b>videos</b>. Accepts <code>https://www.bilibili.com/video/BV1xx411c7mD</code>, <code>BV1xx411c7mD</code> or <code>av170001</code>.",
            "items": {
              "type": "string"
            }
          },
          "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": "Used by <b>ranking</b>. The Bilibili zone whose top-100 list you want.",
            "default": "0"
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "all",
              "origin",
              "rookie"
            ],
            "type": "string",
            "description": "Used by <b>ranking</b>. <b>all</b> = overall, <b>origin</b> = original content only, <b>rookie</b> = new uploaders.",
            "default": "all"
          },
          "searchOrder": {
            "title": "Search sort order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Used by <b>search</b>.",
            "default": "totalrank"
          },
          "maxItems": {
            "title": "Max videos (or uploaders)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum videos per run (per keyword in search modes). Popular list has up to ~500 videos, rankings 100, search up to 1,000 per keyword. You pay per video, so this also caps your cost.",
            "default": 20
          },
          "includeTags": {
            "title": "Include video tags",
            "type": "boolean",
            "description": "Load the tag list of every video (one extra request per video, no extra charge). Search results already include tags.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also scrape comments of each video (pinned + hot comments and their replies). Commenter names and ids are NOT exported. Charged per comment.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper limit of comments per video. Note: Bilibili shows visitors (no login) only the top hot comments and the first page of replies under each, typically 20-70 comments per video.",
            "default": 20
          },
          "includeDanmaku": {
            "title": "Include danmaku (bullet comments)",
            "type": "boolean",
            "description": "Also scrape the danmaku (弹幕) of each video with their video timestamp, text, display mode and color. Sender ids are NOT exported. Charged per danmaku line.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "type": "integer",
            "description": "Upper limit of danmaku lines per video (sorted by video time). Bilibili's public danmaku pool holds up to 1,000-8,000 lines per video depending on its length. 0 = all available.",
            "default": 200
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Bilibili sometimes answers datacenter IPs with risk-control blocks (HTTP 412 / code -352). If you see 'BLOCKED' error rows, enable Apify Proxy with the RESIDENTIAL group.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}