{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili (哔哩哔哩) Scraper - Videos, Comments & Creators",
    "description": "Extract Bilibili (哔哩哔哩) videos by keyword, BV id, or creator UID: views, likes, coins, favorites, danmaku, tags, comments, and creator profiles. Export to JSON, CSV, or Excel.",
    "version": "0.0",
    "x-build-id": "Spy1IhjDTch6oA4WS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zen-studio~bilibili-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zen-studio-bilibili-video-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/zen-studio~bilibili-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zen-studio-bilibili-video-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/zen-studio~bilibili-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zen-studio-bilibili-video-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": "Mode",
            "enum": [
              "search",
              "video_detail",
              "comments",
              "user_videos",
              "popular"
            ],
            "type": "string",
            "description": "What to scrape. Fill in the section below that matches your choice.",
            "default": "search"
          },
          "keywords": {
            "title": "🔍 Search keywords",
            "type": "array",
            "description": "<b>search mode.</b> One or more terms. Chinese gives the best recall (e.g. <code>原神</code>, <code>美食</code>), English works too (<code>nike</code>). Each keyword runs with its own <b>Max results</b> budget.",
            "items": {
              "type": "string"
            }
          },
          "sortOrder": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "How results are ranked.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Restrict by video length.",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after",
            "type": "string",
            "description": "Optional. Only videos published on/after this date. Format <code>YYYY-MM-DD</code>."
          },
          "pubtimeEnd": {
            "title": "Published before",
            "type": "string",
            "description": "Optional. Only videos published on/before this date. Format <code>YYYY-MM-DD</code>."
          },
          "maxResults": {
            "title": "📊 Max results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Per keyword (search), per creator (creator videos), or total (popular). Set <code>0</code> for all available.",
            "default": 50
          },
          "videoUrls": {
            "title": "🎬 Video URLs or BV ids",
            "type": "array",
            "description": "<b>video_detail & comments modes.</b> One or more Bilibili video URLs or BV ids (e.g. <code>https://www.bilibili.com/video/BV1DYjA6KEJ7</code> or <code>BV1DYjA6KEJ7</code>).",
            "items": {
              "type": "string"
            }
          },
          "includeTags": {
            "title": "Include tags (video_detail)",
            "type": "boolean",
            "description": "<b>video_detail mode.</b> Include each video's tag list in the output.",
            "default": true
          },
          "includeRelated": {
            "title": "Include related videos (video_detail)",
            "type": "boolean",
            "description": "<b>video_detail mode.</b> Attach a compact list of Bilibili's recommended/related videos to each result.",
            "default": false
          },
          "includeHotComments": {
            "title": "Include hot comments (video_detail)",
            "type": "boolean",
            "description": "<b>video_detail mode.</b> Attach each video's top comments. Adds a separate comment fetch per video; leave off if you don't need comments here (use Comments mode for full comment scraping).",
            "default": false
          },
          "creatorProfileDetail": {
            "title": "Creator profile on each video (video_detail)",
            "enum": [
              "none",
              "subset",
              "full"
            ],
            "type": "string",
            "description": "<b>video_detail mode.</b> How much creator info to attach to each video. Follower and like counts are always included.",
            "default": "subset"
          },
          "maxComments": {
            "title": "Max comments per video (comments)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "<b>comments mode.</b> Cap per video. Note: Bilibili only exposes a limited set of top comments per video publicly, so in practice you get the most-liked few dozen.",
            "default": 50
          },
          "userIds": {
            "title": "👤 Creator UIDs",
            "type": "array",
            "description": "<b>user_videos mode.</b> One or more creator UIDs or <code>space.bilibili.com/{uid}</code> URLs. Each user's output starts with a profile row, then their videos.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}