{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper – Videos, Comments, Danmaku & Creators",
    "description": "Scrape Bilibili (哔哩哔哩) without login: search videos, full stats, comments, replies, danmaku, creator profiles and trending charts. Many sources in one run, monitor mode, from $0.002 per video.",
    "version": "0.1",
    "x-build-id": "FvbpdJToveqkeBHXR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smoldesk~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smoldesk-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/smoldesk~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-smoldesk-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/smoldesk~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-smoldesk-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": "Search Bilibili videos by keyword. Chinese (人工智能) and English (AI tutorial) both work. Bilibili returns at most 1,000 videos per keyword — use the date filters below to go further back.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Bilibili video links, BV IDs (BV1xx411c7mD), av IDs or b23.tv short links. Each video gets full stats; turn on comments / danmaku below to get those too.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Creators (UID or profile URL)",
            "type": "array",
            "description": "Bilibili creator UIDs (686127) or profile links (https://space.bilibili.com/686127). Returns the creator profile (followers, likes, video count, verification) and, if enabled, their latest videos.",
            "items": {
              "type": "string"
            }
          },
          "trending": {
            "title": "Trending videos",
            "enum": [
              "none",
              "popular",
              "ranking"
            ],
            "type": "string",
            "description": "Also scrape Bilibili's trending lists: 'Popular' is the live hot feed (up to 500 videos), 'Ranking' is the top-100 chart for a category.",
            "default": "none"
          },
          "rankingCategory": {
            "title": "Ranking category",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "kichiku",
              "fashion",
              "entertainment",
              "film-and-tv",
              "documentary",
              "movie",
              "tv-series"
            ],
            "type": "string",
            "description": "Category for the 'Ranking' chart.",
            "default": "all"
          },
          "maxVideosPerSearch": {
            "title": "Max videos per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many videos for each keyword (Bilibili's cap is 1,000).",
            "default": 20
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "How Bilibili orders search results.",
            "default": "relevance"
          },
          "searchDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only search videos of this length.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only search videos published on or after this date (YYYY-MM-DD)."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only search videos published on or before this date (YYYY-MM-DD)."
          },
          "includeUserVideos": {
            "title": "Include creators' videos",
            "type": "boolean",
            "description": "For each creator, also scrape their uploaded videos.",
            "default": true
          },
          "maxVideosPerUser": {
            "title": "Max videos per creator",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Newest first (or by the sort below).",
            "default": 20
          },
          "userVideoSort": {
            "title": "Creator videos sort",
            "enum": [
              "pubdate",
              "click",
              "stow"
            ],
            "type": "string",
            "description": "Order of a creator's videos.",
            "default": "pubdate"
          },
          "maxTrendingVideos": {
            "title": "Max trending videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Popular feed: up to 500. Ranking: up to 100.",
            "default": 20
          },
          "fetchDetails": {
            "title": "Full video stats",
            "type": "boolean",
            "description": "Fetch each video's detail page for likes, coins, shares, tags, honors and the uploader's follower count. Search results alone only have views, likes, favorites, comments and danmaku counts. Same price either way.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Scrape each video's top comments (most-liked, plus the uploader's pinned comment) as their own rows. Bilibili only shows visitors who aren't logged in the top 3 comments of a video, so expect up to ~4 comments per video, plus their replies if you turn those on below. For audience reactions at scale, use danmaku.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit of top-level comments per video (Bilibili currently shows logged-out visitors about 3 per video).",
            "default": 20
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "hot",
              "time"
            ],
            "type": "string",
            "description": "Which comments come first (Bilibili shows logged-out visitors only the first few).",
            "default": "hot"
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Also scrape the reply thread under each top comment (0 = off). Replies are rows with isReply = true and parentId.",
            "default": 0
          },
          "includeDanmaku": {
            "title": "Include danmaku (弹幕)",
            "type": "boolean",
            "description": "Scrape the on-video scrolling comments (弹幕) — the main audience-reaction data on Bilibili — each with the second of the video it appears at.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Danmaku are sampled evenly across the whole video timeline (not just the opening seconds). Bilibili serves up to ~1,000–3,000 recent danmaku per video.",
            "default": 50
          },
          "onlyNewVideos": {
            "title": "Only new videos (monitor mode)",
            "type": "boolean",
            "description": "Remember videos returned by earlier runs with the same keyword / creator / trending settings and only return new ones. Schedule the Actor to get a feed of new uploads.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Videos processed in parallel. Higher is faster but Bilibili rate-limits bursts.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed — the Actor switches to Apify datacenter proxies on its own if Bilibili rate-limits the run. Residential proxies are ignored.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}