{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper — Video, UP主, Comments & Search",
    "description": "Bilibili scraper for video data, UP主 profiles, comments, danmaku (bullet chats), AI subtitle metadata & keyword search. KOL discovery, view/like/coin/favorite counts, creator analytics for China market research. Eight operations, one clean dataset per run. No API key.",
    "version": "1.1",
    "x-build-id": "NvDPoy7VbjKEVhkLx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~bilibili-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-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/sian.agency~bilibili-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-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/sian.agency~bilibili-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to scrape?",
            "enum": [
              "videoDetail",
              "userDetail",
              "userRelationStat",
              "userVideos",
              "videoComments",
              "videoDanmu",
              "videoCaption",
              "searchVideo"
            ],
            "type": "string",
            "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **📺 Video Detail** — deep scrape of a single Bilibili video by BV ID (title, description, view/like/coin/favorite/share/comment counts, cover, creator, video parts, tags)\n- **👤 User Profile** — full Bilibili UP主 profile by user ID (bio, level, verification, VIP status, live room, school, profession, join date)\n- **📈 User Relation Stat** — fast follower/following/whisper counts by user ID (cheaper than full profile)\n- **🎞️ User Videos** — paginated list of an UP主's complete video catalog\n- **💬 Video Comments** — paginated comments on a single video, with reply samples\n- **🎯 Video Danmaku** — bullet chat (弹幕) overlay text + timestamps for a single video (requires AID + CID)\n- **🌐 Video Caption Metadata** — language list + signed subtitle URLs for a video (requires AID + BV + CID; URL points to a JSON subtitle file you fetch yourself)\n- **🔍 Search Videos** — keyword search across Bilibili videos, paginated (~20 results/page)\n\n💡 **TIP:** Run `Video Detail` first to get the `aid` and `cid` of any BV-ID video, then feed them into Comments / Danmaku / Caption operations.",
            "default": "searchVideo"
          },
          "bvid": {
            "title": "📺 Video BV ID (for Video Detail / Video Caption)",
            "type": "string",
            "description": "📺 **Required for `Video Detail` and `Video Caption Metadata` operations.**\n\nThe Bilibili BV ID (always starts with `BV`, e.g. `BV1rpWjevEip`). You can find it:\n- In any Bilibili video URL: `https://www.bilibili.com/video/{BV_ID}` → the trailing segment\n- In the `bvid` field of any search or user-videos result row\n\n💡 **TIP:** Use the `Search Videos` operation to discover BV IDs in any niche, then drill into individual videos with `Video Detail`.\n\n⚠️ **Ignored** for User Profile, Comments (uses `aid`), Danmaku (uses `aid`+`cid`), and Search operations."
          },
          "aid": {
            "title": "🆔 Video AID (for Video Comments / Danmaku / Caption)",
            "type": "string",
            "description": "🆔 **Required for `Video Comments`, `Video Danmaku`, and `Video Caption Metadata` operations.**\n\nThe numeric Bilibili video ID (also called `aid` or `av number`). You can find it:\n- In the `aid` field of any `Video Detail` or `Search Videos` result row\n- In legacy URLs: `https://www.bilibili.com/video/av{AID}`\n\n💡 **TIP:** Always run `Video Detail` first to fetch the `aid` (and `cid`) for any BV-ID video, then use them for Comments / Danmaku / Caption.\n\n⚠️ **Ignored** for User and Search operations."
          },
          "cid": {
            "title": "🧩 Video CID (for Danmaku / Caption)",
            "type": "string",
            "description": "🧩 **Required for `Video Danmaku` and `Video Caption Metadata` operations.**\n\nThe Bilibili chapter ID (`cid`). Multi-part videos have one `cid` per part; single-part videos have one. You can find it:\n- In the `cid` field of any `Video Detail` result row\n- In `videoPages[].cid` for multi-part videos\n\n💡 **TIP:** For multi-part videos, run Danmaku / Caption per `cid` to fetch each part separately.\n\n⚠️ **Ignored** for non-danmaku / caption operations."
          },
          "userId": {
            "title": "👤 User ID (for User Profile / User Videos / Relation Stat)",
            "type": "string",
            "description": "👤 **Required for `User Profile`, `User Relation Stat`, and `User Videos` operations.**\n\nThe numeric Bilibili user ID (also called `mid`). You can find it:\n- In a creator's space URL: `https://space.bilibili.com/{USER_ID}`\n- In the `userId` / `mid` field of any video, search, or comment result row\n\n💡 **TIP:** Use `Search Videos` to discover trending UP主, then use their `userId` to pull full profile or complete video catalogs.\n\n⚠️ **Ignored** for video-specific and search operations."
          },
          "keyword": {
            "title": "🔍 Search Keyword (for Search Videos)",
            "type": "string",
            "description": "🔍 **Required for `Search Videos` operation.**\n\nAny Bilibili search query. Supports Chinese, English, and mixed queries:\n- `python`\n- `游戏` (games)\n- `美食` (food)\n- `anime review`\n\n💡 **TIP:** Specific niches return higher-relevance results. Chinese-language queries surface more native UP主; English / mixed queries surface global content."
          },
          "maxPages": {
            "title": "📄 Max pages to fetch",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "📄 **Applies to paginated operations** (User Videos, Video Comments, Search Videos). Ignored for single-record operations (Video Detail, User Profile, Relation Stat, Danmaku, Caption).\n\n- **User Videos:** ~30 videos per page\n- **Video Comments:** ~20 comments per page (with sub-comment samples)\n- **Search Videos:** ~20 results per page (max 50 pages = 1,000 videos)\n\n💡 **TIP:** Start small (1–3 pages) to preview results before scaling up.\n\n⚠️ Hard cap: 50 pages to prevent runaway runs.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}