{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Creators, Comments & Danmaku",
    "description": "Scrape Bilibili (哔哩哔哩) videos by keyword, URL, creator (UP主) or trending list. Full stats, tags, creator followers, comments and danmaku with timestamps. Clean English fields, monitoring mode, no login needed.",
    "version": "0.1",
    "x-build-id": "8h5ONpT7UjIDelCbz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/senshiesr~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-senshiesr-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/senshiesr~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-senshiesr-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/senshiesr~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-senshiesr-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": "Find videos by keyword, like the search box on bilibili.com. Chinese or English keywords both work.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "Video links (bilibili.com/video/BV..., m.bilibili.com, b23.tv short links) or plain BV / av ids.",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator (UP主) channels",
            "type": "array",
            "description": "Get a creator's uploads, newest first. Use their channel URL (space.bilibili.com/123456) or numeric id.",
            "items": {
              "type": "string"
            }
          },
          "trending": {
            "title": "Trending list",
            "enum": [
              "none",
              "popular",
              "ranking"
            ],
            "type": "string",
            "description": "Also scrape a trending list: Popular (bilibili.com/v/popular, refreshed through the day) or Ranking (the daily top 100).",
            "default": "none"
          },
          "maxTrendingVideos": {
            "title": "Max trending videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many trending videos to scrape.",
            "default": 50
          },
          "searchSort": {
            "title": "Search sort order",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "How search results are ordered.",
            "default": "relevance"
          },
          "searchDuration": {
            "title": "Video length (search)",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only return search results of this length.",
            "default": "any"
          },
          "maxVideosPerSearch": {
            "title": "Max videos per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Bilibili returns at most 1,000 results per keyword.",
            "default": 50
          },
          "maxVideosPerCreator": {
            "title": "Max videos per creator",
            "minimum": 1,
            "type": "integer",
            "description": "Newest uploads first.",
            "default": 30
          },
          "publishedWithinDays": {
            "title": "Published within the last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Only output videos published in the last N days (does not apply to video URLs you enter directly)."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Adds comments (hot comments first) with their top replies to each video. Without a Bilibili login cookie, Bilibili only shows a few comments per video, so only those can be returned.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "type": "integer",
            "description": "Hot comments first. Without a login cookie Bilibili usually shows about 3.",
            "default": 20
          },
          "includeDanmaku": {
            "title": "Include danmaku (弹幕)",
            "type": "boolean",
            "description": "Adds the danmaku (on-screen comments) Bilibili shows viewers, with the exact second each one appears, its color and send time. Typically 1,000+ per video, spread across the whole video.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "type": "integer",
            "description": "0 = every danmaku Bilibili returns.",
            "default": 1000
          },
          "onlyNewVideos": {
            "title": "Only new videos since the last run",
            "type": "boolean",
            "description": "For scheduled monitoring of keywords, creators or trending lists: outputs (and charges for) only videos not delivered in earlier runs. The first run outputs everything.",
            "default": false
          },
          "monitoringName": {
            "title": "Monitoring name",
            "type": "string",
            "description": "Use a different name for each separate monitoring setup so they keep separate history.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed. If Bilibili starts blocking runs, enable Apify Proxy (residential works best).",
            "default": {
              "useApifyProxy": false
            }
          },
          "bilibiliCookie": {
            "title": "Bilibili login cookie (optional)",
            "type": "string",
            "description": "Only needed for more than a few comments per video. Paste the SESSDATA cookie from a logged-in browser as SESSDATA=.... Use an account you don't mind using for automation; it is used only to read public pages."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}