{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper Pro (B站)",
    "version": "0.2",
    "x-build-id": "k9buCHUa4xVXGmxzT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/stone_jadex~bilibili-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-stone_jadex-bilibili-scraper-pro",
        "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/stone_jadex~bilibili-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-stone_jadex-bilibili-scraper-pro",
        "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/stone_jadex~bilibili-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-stone_jadex-bilibili-scraper-pro",
        "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": {
          "searchKeywords": {
            "title": "🔎 Search keywords",
            "type": "array",
            "description": "Search Bilibili videos by keyword (Chinese or English), e.g. 原神, AI, vlog.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "🎬 Video URLs / BV ids / av ids",
            "type": "array",
            "description": "Individual videos: https://www.bilibili.com/video/BV1..., BV1... or av123.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "📺 Creator uploads (UIDs)",
            "type": "array",
            "description": "Scrape latest uploads of these creators. Numeric UID or https://space.bilibili.com/<uid>.",
            "items": {
              "type": "string"
            }
          },
          "profileUserIds": {
            "title": "👤 Creator profiles (UIDs)",
            "type": "array",
            "description": "Output one profile row per creator: followers, following, likes, total views, level, bio, verification.",
            "items": {
              "type": "string"
            }
          },
          "includePopular": {
            "title": "🔥 Popular / trending now",
            "type": "boolean",
            "description": "Scrape the 综合热门 (popular) board.",
            "default": false
          },
          "rankingCategoryIds": {
            "title": "🏆 Ranking boards (category ids)",
            "type": "array",
            "description": "Ranking board by category id (rid). 0 = all-site ranking. Some category ids may not have boards; errors are reported in OUTPUT.",
            "items": {
              "type": "string"
            }
          },
          "includeWeeklyMustWatch": {
            "title": "📅 Weekly must-watch (每周必看)",
            "type": "boolean",
            "description": "Scrape the latest weekly must-watch issue (best effort; Bilibili may rate-limit it).",
            "default": false
          },
          "maxVideosPerSource": {
            "title": "Max videos per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Max videos per keyword / creator / board.",
            "default": 5
          },
          "searchOrder": {
            "title": "Search sort order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "totalrank = relevance, click = most viewed, pubdate = newest, dm = most danmaku, stow = most favorited.",
            "default": "totalrank"
          },
          "fetchDetails": {
            "title": "Fetch full video details",
            "type": "boolean",
            "description": "One extra request per video for coins, shares, multi-part (P) pages, subtitle availability, full description. Slower, more rate-limit prone. Popular/ranking already include full stats.",
            "default": false
          },
          "includeTags": {
            "title": "Include video tags",
            "type": "boolean",
            "description": "One extra request per video.",
            "default": false
          },
          "includeRelated": {
            "title": "Include related videos",
            "type": "boolean",
            "description": "Embed related/recommended videos list (bvid, title, uploader, views).",
            "default": false
          },
          "maxRelatedPerVideo": {
            "title": "Max related videos",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Max related videos embedded per video.",
            "default": 10
          },
          "includeAiSummary": {
            "title": "Include AI summary (experimental)",
            "type": "boolean",
            "description": "Tries Bilibili's AI video summary (AI视频总结). In our tests it was NOT returned to anonymous requests, so expect aiSummary.available=false. Adds one request per video.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Scrape public comments. Anonymous limit: Bilibili returns ~3 top-level (hot) comments per video; the Actor then paginates their full reply threads. Expect tens to a few thousand comments per video depending on how many replies those top comments have — not the full comment section.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Includes replies.",
            "default": 20
          },
          "includeCommentReplies": {
            "title": "Include reply threads",
            "type": "boolean",
            "description": "Paginate replies under top-level comments (main way to get more than 3 comments).",
            "default": true
          },
          "commentUserData": {
            "title": "Comment author data",
            "enum": [
              "none",
              "hashed",
              "public"
            ],
            "type": "string",
            "description": "none = no author fields (default, privacy-friendly); hashed = pseudonymous author id + level/region; public = public username & UID.",
            "default": "none"
          },
          "danmakuMode": {
            "title": "Danmaku (弹幕)",
            "enum": [
              "off",
              "summary",
              "raw",
              "both"
            ],
            "type": "string",
            "description": "off; summary = one cheap row per video (top terms, per-minute density timeline, peak); raw = individual danmaku rows; both.",
            "default": "off"
          },
          "maxDanmakuPerVideo": {
            "title": "Max raw danmaku per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Raw rows are sampled evenly across the video timeline if there are more.",
            "default": 500
          },
          "builtInProxyFallback": {
            "title": "Built-in proxy fallback",
            "type": "boolean",
            "description": "Included in the price. Requests go direct; only after Bilibili rate-limits (HTTP 412) the Actor switches to Apify datacenter proxy, then (within a small developer-set budget) residential proxy. Danmaku files never use residential.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. If set, ALL requests use your own proxy (billed to your account per Apify rules) and the built-in fallback is disabled.",
            "default": {
              "useApifyProxy": false
            }
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 300,
            "maximum": 10000,
            "type": "integer",
            "description": "Polite global delay; auto-increases when rate limited.",
            "default": 800
          },
          "maxRunSeconds": {
            "title": "Max run seconds",
            "minimum": 0,
            "type": "integer",
            "description": "Stop gracefully after N seconds (0 = use Actor timeout). Partial results are always kept.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}