{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Trending & Danmaku",
    "description": "Scrape Bilibili (哔哩哔哩) videos by keyword, trending board, category ranking, video URL or creator. Get views, likes, coins, favorites, danmaku and comment counts, tags, creator followers, plus the danmaku bullet comments themselves. No login or cookies.",
    "version": "0.1",
    "x-build-id": "2kHeG5KgtuW65u7NH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cirkit~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cirkit-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/cirkit~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cirkit-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/cirkit~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cirkit-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "trending",
              "videos",
              "creators",
              "danmaku"
            ],
            "type": "string",
            "description": "search: videos matching your keywords. trending: the hot board or a category's top 100. videos: full records for specific video URLs. creators: a creator's profile plus their uploads. danmaku: the bullet comments (弹幕) of specific videos, one row per comment.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords to search Bilibili for, in Chinese or English (for example 原神, 人工智能, iPhone 17 review). Used in search mode. Each keyword returns up to 1,000 videos.",
            "items": {
              "type": "string"
            }
          },
          "trendingSource": {
            "title": "Trending board",
            "enum": [
              "popular",
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "kichiku",
              "fashion",
              "entertainment",
              "film",
              "documentary",
              "movie",
              "tv"
            ],
            "type": "string",
            "description": "Used in trending mode. Popular right now is Bilibili's hot board (several hundred videos). The category options return that category's top-100 ranking.",
            "default": "popular"
          },
          "videoUrls": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "Used in videos and danmaku modes. Accepts bilibili.com/video/BV... links, b23.tv short links, BV ids (BV1xx411c7mD) and av ids (av170001).",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator URLs or user IDs",
            "type": "array",
            "description": "Used in creators mode. Accepts space.bilibili.com/<id> links or the numeric user id (mid). Returns a profile row and then the creator's uploads, newest first.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Search mode only.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Search mode only. Filter by duration.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published on or after",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Search mode only. Date as YYYY-MM-DD (UTC). Leave empty for no lower bound."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Search mode only. Date as YYYY-MM-DD (UTC), inclusive. Leave empty for no upper bound."
          },
          "fetchFullDetails": {
            "title": "Fetch full video details",
            "type": "boolean",
            "description": "Search, trending and creator rows already carry views, danmaku, comments and author. Turn this on to also fill coins, shares, likes, tags, part count and the original-content flag for every video. Slower (two extra requests per video), same price per row.",
            "default": false
          },
          "includeCreatorProfile": {
            "title": "Include the creator profile row",
            "type": "boolean",
            "description": "Creators mode only. Push one profile row per creator (followers, following, total likes, video count, level, verification) before their uploads.",
            "default": true
          },
          "maxResultsPerSource": {
            "title": "Max videos per keyword, board or creator",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit of videos taken from each search keyword, the trending board, or each creator. Search stops at 1,000 per keyword (Bilibili's own limit) and rankings at 100.",
            "default": 100
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Danmaku mode only. Upper limit of bullet comments returned per video, ordered by when they appear in the video.",
            "default": 1000
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on rows written to the dataset across all inputs. You are charged per row, so this is your spend limit. Leave empty for no total cap."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify's default datacenter proxy works well for Bilibili and is the cheapest option. Refused exits are rotated automatically.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}