{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper & API: Search, Videos, Comments, Danmaku",
    "description": "Bilibili scraper for videos with full stats, comments and replies, danmaku (弹幕), creators and their articles. Search with sort, dates, length and category, paste video or creator links, or read the trending lists. Optional full English translation. No login needed.",
    "version": "0.1",
    "x-build-id": "6skFLp3LyHYTBR11k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quarra~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quarra-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/quarra~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-quarra-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/quarra~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-quarra-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 terms",
            "maxItems": 1000,
            "type": "array",
            "description": "One per line, in Chinese or any language Bilibili understands (原神, iPhone 17, 机器人). Each term returns up to 'Max results per search, creator or list' of the type picked below.",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "videos",
              "creators",
              "articles"
            ],
            "type": "string",
            "description": "What the search terms look for.",
            "default": "videos"
          },
          "videoUrls": {
            "title": "Videos",
            "maxItems": 1000,
            "type": "array",
            "description": "One per line: a video link (https://www.bilibili.com/video/BV1SMJC6sE6R), a b23.tv share link (the whole share text from the app works too), a BV ID or an av number. Each video gives one full record, then its comments and danmaku if you ask for them.",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "creatorUrls": {
            "title": "Creators",
            "maxItems": 1000,
            "type": "array",
            "description": "One per line: a channel link (https://space.bilibili.com/946974), a b23.tv share link or a numeric user ID. Each creator gives its profile, then its videos and/or articles (below).",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "creatorContent": {
            "title": "From each creator, get",
            "type": "array",
            "description": "What to list from each creator in 'Creators', up to 'Max results per search, creator or list' of each.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "articles"
              ],
              "enumTitles": [
                "Videos (newest first)",
                "Articles (newest first)"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "trending": {
            "title": "Trending lists",
            "type": "array",
            "description": "Bilibili's own trending lists. The ranking follows 'Category' and 'Ranking type'.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking",
                "mustWatch",
                "hotSearches"
              ],
              "enumTitles": [
                "Popular now (综合热门)",
                "Ranking, top 100 (排行榜)",
                "Must-watch (入站必刷)",
                "Hot searches (热搜)"
              ]
            }
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "mostViewed",
              "newest",
              "mostDanmaku",
              "mostFavorited",
              "mostCommented",
              "mostFollowers"
            ],
            "type": "string",
            "description": "Order of the search results. 'Most danmaku' is for videos, 'Most followers' for creators; a sort that does not apply falls back to relevance.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "maxLength": 40,
            "type": "string",
            "description": "Videos and articles published on or after this date: 2026-10-01, 2026-10-01T08:00:00Z, or a duration back from now like '7 days' or '12 hours'. Applies to searches and creators' lists."
          },
          "publishedBefore": {
            "title": "Published before",
            "maxLength": 40,
            "type": "string",
            "description": "Videos and articles published on or before this date (same formats)."
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10min",
              "10to30min",
              "30to60min",
              "over60min"
            ],
            "type": "string",
            "description": "Video searches only.",
            "default": "any"
          },
          "category": {
            "title": "Category",
            "enum": [
              "all",
              "animation",
              "anime",
              "chineseAnimation",
              "music",
              "dance",
              "gaming",
              "knowledge",
              "tech",
              "ai",
              "cars",
              "life",
              "food",
              "animals",
              "kichiku",
              "fashion",
              "entertainment",
              "film",
              "sports",
              "news",
              "painting",
              "home",
              "outdoors",
              "fitness",
              "crafts",
              "travel",
              "rural",
              "parenting",
              "health",
              "relationships",
              "lifestyle",
              "lifeTips",
              "shortDrama",
              "vlog"
            ],
            "type": "string",
            "description": "Filters video searches and picks the ranking list. Bilibili has no ranking for Anime and News, and its search cannot filter by AI, Outdoors, Fitness, Parenting, Health, Relationships, Hobbies, Life tips, Short dramas or Vlog: the run then says so and reads all categories.",
            "default": "all"
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "all",
              "original",
              "newcomers"
            ],
            "type": "string",
            "description": "Which ranking to read when 'Ranking' is in the trending lists.",
            "default": "all"
          },
          "maxResultsPerSource": {
            "title": "Max results per search, creator or list",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Videos, creators or articles per search term, per creator (videos and articles each) and per trending list. Bilibili serves 1,000 results per search; for videos, the scraper goes past that by reading the rest newest first.",
            "default": 20
          },
          "fullVideoDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Open each video's page for everything: coins, shares, favorites, tags, category, parts, original or repost. Off: only the fields the search or list shows (faster).",
            "default": true
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Add the comments of every video scraped (related videos excepted): text, likes, date, author with level, pinned, liked or answered by the creator, pictures.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Comments per video, replies included.",
            "default": 100
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Order in which comments are read.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Replies",
            "type": "boolean",
            "description": "Add the replies under each comment, right after it, with the comment they answer.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Replies read under each comment.",
            "default": 20
          },
          "includeDanmaku": {
            "title": "Danmaku (弹幕)",
            "type": "boolean",
            "description": "Add the danmaku of every video scraped (related videos excepted), the comments that fly over the video: text, second of the video, date, mode, color, part. You get what Bilibili shows a visitor; older danmaku that Bilibili keeps for signed-in users are not included.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Danmaku per video, all parts together.",
            "default": 1000
          },
          "includeRelatedVideos": {
            "title": "Related videos",
            "type": "boolean",
            "description": "For each video in 'Videos': add the videos Bilibili shows next to it, up to 'Max results per search, creator or list'.",
            "default": false
          },
          "translateToEnglish": {
            "title": "Translate to English",
            "type": "boolean",
            "description": "Add an English translation next to the original, which is always kept: title and description of videos, text of comments and danmaku, bio of creators, title and summary of articles. Paid option, charged per record translated, only when the translation is complete. Records already in English, or with only emoji, are not translated and not charged. Available on paid Apify plans only.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Total number of records delivered by the run (videos, comments, danmaku, creators, articles, hot searches), counted exactly.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}