{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili 哔哩哔哩 Scraper — Search, Videos, Danmaku & Comments",
    "description": "Fast zero-cookie Bilibili (B站) scraper for keyword video search, full video metadata, timestamped live Danmaku (弹幕) XML with peak-moment analytics, top comments, popular rankings, and hot search trends. 512MB pure HTTP, WBI-signed, MCP & Pay-Per-Event ready.",
    "version": "1.0",
    "x-build-id": "f3VYgHGagNYN05ycU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/flowery_bluebird_jay~bilibili-all-in-one-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-flowery_bluebird_jay-bilibili-all-in-one-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/flowery_bluebird_jay~bilibili-all-in-one-scraper/runs": {
      "post": {
        "operationId": "runs-sync-flowery_bluebird_jay-bilibili-all-in-one-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/flowery_bluebird_jay~bilibili-all-in-one-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-flowery_bluebird_jay-bilibili-all-in-one-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": "Extraction mode",
            "enum": [
              "search",
              "video",
              "danmaku",
              "comments",
              "trending"
            ],
            "type": "string",
            "description": "Choose search, direct video metadata, danmaku, comments, or trending. Optional add-on flags apply to search and video modes.",
            "default": "search"
          },
          "keywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search mode only. An array of Chinese or English keywords; omitted defaults to [\"AI Agent\"]. An explicit empty array exits without data requests. Duplicate and blank entries are removed.",
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Search sort order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Search mode sorting: totalrank (relevance), click (views), pubdate (newest), dm (danmaku), or stow (favorites).",
            "default": "totalrank"
          },
          "videoInputs": {
            "title": "Video URLs or BV / AV IDs",
            "type": "array",
            "description": "Direct modes only. Accepts exact BV IDs, positive AV IDs with or without av, Bilibili video URLs, watch-later video fragments, or b23.tv links. Omitted uses the sample video; an explicit empty array exits without data requests.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Maximum videos per keyword or ranking",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Integer from 1 to 200. Limits videos per search keyword or the trending video list. Hot-search keywords are additional records; this is not a run-wide record cap.",
            "default": 15
          },
          "enrichVideoDetails": {
            "title": "Enrich search results with details and tags",
            "type": "boolean",
            "description": "Search mode only. Fetch video metadata and tags; if enrichment fails, retain the original search row. Enable this when requesting danmaku because search rows do not provide a CID.",
            "default": true
          },
          "includeDanmaku": {
            "title": "Include danmaku summary and samples",
            "type": "boolean",
            "description": "Search and video modes only. Add a parsed danmaku XML summary and chronological samples to each video. Danmaku mode always fetches this data. Successful batches use a separate PPE event.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Maximum danmaku samples per video",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Integer from 1 to 3000. Caps returned danmaku_items after sorting. Analytics summarize all valid entries in the returned XML, which may not contain the complete video history.",
            "default": 200
          },
          "includeComments": {
            "title": "Include video comments",
            "type": "boolean",
            "description": "Search and video modes only. Embed available top-level comments on each video. Comments mode emits individual comment records. Each returned comment uses a separate PPE event.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Integer from 1 to 200. Upper bound for returned top-level comments per video. The API may return fewer; nested replies are not fetched.",
            "default": 20
          },
          "commentSort": {
            "title": "Comment sort order",
            "enum": [
              "hot",
              "latest"
            ],
            "type": "string",
            "description": "Use hot for popularity or latest for chronological ordering. Applies to comments mode and optional comment extraction.",
            "default": "hot"
          },
          "trendingCategoryRid": {
            "title": "Ranking category ID",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Trending mode only. Non-negative integer category ID; 0 requests all categories. If ranking is unavailable or empty, use the popular feed, which is not category-specific.",
            "default": 0
          },
          "cookieString": {
            "title": "Optional cookie header",
            "type": "string",
            "description": "Optional single-line Bilibili Cookie header. Leave blank to attempt automatic session bootstrap. Cookies and proxies cannot guarantee access to restricted or unavailable data."
          },
          "requestDelayMs": {
            "title": "Request delay in milliseconds",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Integer from 100 to 5000. Minimum pacing between HTTP requests plus small random jitter. Throttling reduces request frequency but does not guarantee access or a success rate.",
            "default": 350
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify Proxy or custom proxy configuration. Defaults to direct requests. Proxy access and costs depend on your Apify account; no proxy guarantees Bilibili access.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}