{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper - Videos, Comments, Danmaku & Subtitles",
    "description": "Bilibili scraper for videos, search, UP master profiles, comments, danmaku (弹幕) and subtitles. Clean English fields, ISO dates, full stats with coins and shares. Monitor new uploads. No login or cookies.",
    "version": "1.0",
    "x-build-id": "ugEpfYdWihnolgcD6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/groupoject~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-groupoject-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/groupoject~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-groupoject-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/groupoject~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-groupoject-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",
              "search",
              "videos",
              "user",
              "comments",
              "danmaku",
              "subtitles",
              "trending"
            ],
            "type": "string",
            "description": "popular = Bilibili's current popular (热门) videos; search = videos for keywords; videos = full details for video links or BV/av ids; user = UP master profile and uploaded videos; comments / danmaku / subtitles = that data for video links; trending = the hot-search (热搜) keyword list.",
            "default": "popular"
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used in search mode. One keyword or phrase per line, in Chinese or English (for example 原神, 黑神话悟空 攻略, machine learning). Bilibili returns at most 1,000 videos per keyword.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Used in videos, comments, danmaku and subtitles modes. Accepts bilibili.com/video/BV… links (desktop or mobile, ?p= part numbers kept), b23.tv short links, BV ids (BV1chxT6xEyo) and av ids (av170001).",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User IDs or profile URLs",
            "type": "array",
            "description": "Used in user mode. UP master UIDs (546195) or space.bilibili.com/546195 links.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per input",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Popular / trending: total rows. Search: videos per keyword (Bilibili caps a keyword at 1,000). User: videos per UP master. Comments: top-level comments per video. Danmaku: bullet comments per video. Every saved row is a paid result, so this is your main cost control.",
            "default": 50
          },
          "sortBy": {
            "title": "Search sort order",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "Search mode only. Use \"Newest\" for monitoring with \"Only new videos\".",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length (search)",
            "enum": [
              "any",
              "under10min",
              "10to30min",
              "30to60min",
              "over60min"
            ],
            "type": "string",
            "description": "Search mode only. Filter by video duration.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Search, user and popular modes. Keep only videos published on or after this date: YYYY-MM-DD, an ISO date-time, or a relative window such as \"7 days\" or \"24 hours\"."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Search, user and popular modes. Keep only videos published before this date (same formats as above)."
          },
          "userVideoSort": {
            "title": "UP master video order",
            "enum": [
              "newest",
              "views",
              "favorites"
            ],
            "type": "string",
            "description": "User mode only. Order in which a creator's uploads are read.",
            "default": "newest"
          },
          "includeUserProfile": {
            "title": "Include UP master profile",
            "type": "boolean",
            "description": "User mode: save one profile row per creator (followers, following, total likes, video count, level, verification, live room).",
            "default": true
          },
          "includeUserVideos": {
            "title": "Include uploaded videos",
            "type": "boolean",
            "description": "User mode: save the creator's uploaded videos (up to \"Max results per input\").",
            "default": true
          },
          "fetchFullDetails": {
            "title": "Fetch full video details",
            "type": "boolean",
            "description": "Search, user and popular modes: look up each video's own record to add coins, shares, likes, all tags, cid, part count and the uploader's follower count. Search and creator lists do not include coins and shares. Adds the \"video detail\" charge per video.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments for each video",
            "type": "boolean",
            "description": "Search, user, popular and videos modes: also save comments for every video found.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Top-level comments per video when \"Include comments\" is on (comments mode uses \"Max results per input\").",
            "default": 20
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Hot = Bilibili's top comments first; Newest = most recent first.",
            "default": "hot"
          },
          "includeReplies": {
            "title": "Include replies to comments",
            "type": "boolean",
            "description": "Also save replies under each comment (rows with isReply = true), up to \"Max replies per comment\".",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Replies saved under each top-level comment when replies are on.",
            "default": 10
          },
          "includeDanmaku": {
            "title": "Include danmaku (弹幕) for each video",
            "type": "boolean",
            "description": "Search, user, popular and videos modes: also save each video's danmaku (bullet comments). For multi-part videos this is the first part (or the ?p= part you linked).",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Danmaku kept per video, earliest in the video first (danmaku mode uses \"Max results per input\"). Bilibili serves a pool of the latest ~1,000–8,000 danmaku depending on video length.",
            "default": 1000
          },
          "danmakuFormat": {
            "title": "Danmaku output format",
            "enum": [
              "perVideo",
              "perComment"
            ],
            "type": "string",
            "description": "One row per video (all danmaku in an items array plus fullText; one paid row plus the danmaku charge) or one row per bullet comment (each bullet is a paid row).",
            "default": "perVideo"
          },
          "includeSubtitles": {
            "title": "Include subtitles / transcript",
            "type": "boolean",
            "description": "Search, user, popular and videos modes: also save the video's subtitle track (creator or AI-generated ai-zh) as timed segments plus full text. Videos without subtitles give no row and are not charged.",
            "default": false
          },
          "subtitleLanguage": {
            "title": "Preferred subtitle language",
            "type": "string",
            "description": "Language code to prefer when a video has several tracks (zh, en, ja, ai-zh…). Falls back to the first available track.",
            "default": "zh"
          },
          "onlyNew": {
            "title": "Only new videos (monitoring)",
            "type": "boolean",
            "description": "Search and user modes: skip (and don't charge for) videos already delivered by earlier runs with the same state key. Schedule the Actor to get a feed of new uploads. Works best with sort order \"Newest\".",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "Name of the memory used by \"Only new videos\". Use a different key for each independent monitor (for example brand-a, competitor-ups).",
            "default": "default"
          },
          "tikhubApiKey": {
            "title": "Your own TikHub API key (optional)",
            "type": "string",
            "description": "Leave empty to use the Actor's built-in data access. If you have your own TikHub key you can enter it here; it is stored encrypted and never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}