{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Search, Rankings & Creators API",
    "description": "Bilibili (China's YouTube) data in one call: keyword search, popular and ranking lists, full video details and creator stats. Views, likes, coins, favorites, tags, followers. Drop-in input. $3 per 1,000 results.",
    "version": "0.1",
    "x-build-id": "WOiHEGUuqCE22PZQv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/praguedatalab~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-praguedatalab-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/praguedatalab~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-praguedatalab-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/praguedatalab~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-praguedatalab-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": "Mode",
            "enum": [
              "search",
              "popular",
              "ranking",
              "video_detail",
              "user_profile",
              "user_videos",
              "video_comments"
            ],
            "type": "string",
            "description": "What to collect. <b>search</b>: videos matching <code>searchQuery</code>. <b>popular</b>: the trending board (综合热门), or a category's trending board with <code>category</code>. <b>ranking</b>: the ranking board (排行榜) of a category, top 100. <b>video_detail</b>: full details of the videos in <code>videoUrls</code>. <b>user_profile</b>: one row per creator in <code>userIds</code> (followers, videos, likes, verification). <b>user_videos</b>: each creator's profile row followed by their newest uploads. <b>video_comments</b> is accepted for compatibility but returns nothing: comments are out of scope.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keywords for <b>search</b> mode, in Chinese or English: <code>python</code>, <code>人工智能</code>, <code>原神</code>, <code>iPhone 17 review</code>."
          },
          "keywords": {
            "title": "More search queries",
            "type": "array",
            "description": "Optional extra queries for <b>search</b> mode (for example the Chinese name of a brand: <code>耐克</code> next to <code>Nike</code>). Results of all queries are merged, deduplicated and share <code>maxResults</code>.",
            "items": {
              "type": "string"
            }
          },
          "sortOrder": {
            "title": "Sort order (search)",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Order of search results.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Duration filter (search)",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Keep only videos of this length.",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after (search)",
            "type": "string",
            "description": "Only videos published on or after this moment. Formats: <code>2026-04-15</code>, <code>2026/04/15</code>, <code>20260415</code>, <code>2026-04-15 10:30</code>, ISO 8601 such as <code>2026-04-15T18:30:00+08:00</code>. Without a zone the time is UTC. An unreadable value is not applied and the run status says so."
          },
          "pubtimeEnd": {
            "title": "Published before (search)",
            "type": "string",
            "description": "Only videos published on or before this moment. Same formats as <i>Published after</i>; a bare date means 00:00 UTC, use <code>2026-04-15T23:59:59Z</code> to include the whole day."
          },
          "category": {
            "title": "Category (popular, ranking)",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "kichiku",
              "fashion",
              "entertainment",
              "cinephile"
            ],
            "type": "string",
            "description": "Bilibili main zone for <b>popular</b> and <b>ranking</b>. In popular mode, a category other than <i>All</i> returns that category's trending board.",
            "default": "all"
          },
          "rankingType": {
            "title": "Ranking type (ranking)",
            "enum": [
              "all",
              "origin",
              "rookie"
            ],
            "type": "string",
            "description": "Which ranking board: all videos, original content only, or new creators.",
            "default": "all"
          },
          "videoUrls": {
            "title": "Video URLs or BV ids (video_detail)",
            "type": "array",
            "description": "Bilibili video links, BV ids, av ids or b23.tv short links: <code>https://www.bilibili.com/video/BV1xx411c7mD</code>, <code>BV1xx411c7mD</code>, <code>av170001</code>.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Creator ids (user_profile, user_videos)",
            "type": "array",
            "description": "Creator ids (mid) or profile links: <code>546195</code>, <code>https://space.bilibili.com/546195</code>, <code>UID:546195</code>. A channel name does not work.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum rows for the whole run (videos and creator rows). Each row is one <code>result</code> event. Search returns at most about 1,000 videos per query, the popular board 450 to 500, a ranking board 100. In <b>user_videos</b> mode the rows are shared fairly between the creators.",
            "default": 100
          },
          "fetchVideoDetails": {
            "title": "Fetch full details for every video",
            "type": "boolean",
            "description": "In search, popular, ranking and user_videos modes, open each video's detail record to fill tags, coins, shares, the creator's follower count and the full description. One extra request per video (slower), same price per row.",
            "default": false
          },
          "includeCreatorProfile": {
            "title": "Creator profile row (user_videos)",
            "type": "boolean",
            "description": "In <b>user_videos</b> mode, start each creator's rows with their profile row (followers, videos, likes). The profile row counts as one result.",
            "default": true
          },
          "deltaMode": {
            "title": "Delta mode: only videos not delivered before",
            "type": "boolean",
            "description": "For scheduled monitoring in <b>search</b>, <b>popular</b>, <b>ranking</b> and <b>user_videos</b> modes, so you pay only for new videos. The first run returns everything and sets the baseline. In <b>user_videos</b> and in search with <i>Newest first</i>, later runs return only videos published since the last run (they stop at the first video already delivered, no backfill of older ones). In other search orders and on the popular and ranking boards, later runs return the videos that no earlier run with the same <code>deltaStateKey</code> returned: set <code>maxResults</code> to the board size (500 popular, 100 ranking) to get exactly the new entries.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Delta state key",
            "type": "string",
            "description": "Name of the saved list of delivered videos. Use one key per monitor (for example <code>nike-daily</code>). Popular and ranking keep one list per category. The state is stored in the named key-value store <code>bilibili-scraper-delta</code> of your account and remembers up to 200,000 videos.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional, off by default. Every Bilibili endpoint this Actor uses answers from Apify's datacenter IPs without a proxy (tested October 2026). Switch on Apify Proxy only if your runs keep reporting HTTP 412 or code -352 (Bilibili risk control).",
            "default": {
              "useApifyProxy": false
            }
          },
          "includeComments": {
            "title": "Include comments (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility with other Bilibili scrapers. Comments are user-generated personal data and out of scope: the flag is ignored and the run status says so.",
            "default": false
          },
          "includeReplies": {
            "title": "Include comment replies (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility; ignored (comments are out of scope).",
            "default": false
          },
          "followUpComments": {
            "title": "Follow-up comments (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility; ignored (comments are out of scope).",
            "default": false
          },
          "maxComments": {
            "title": "Max comments per video (ignored)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Accepted for compatibility; ignored (comments are out of scope).",
            "default": 20
          },
          "sortComments": {
            "title": "Sort comments by (ignored)",
            "enum": [
              "hot",
              "time",
              "likes"
            ],
            "type": "string",
            "description": "Accepted for compatibility; ignored (comments are out of scope).",
            "default": "hot"
          },
          "includeDanmaku": {
            "title": "Danmaku profile (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility; ignored (danmaku is out of scope). The danmaku count of each video is still in <code>danmakuCount</code>.",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Danmaku samples (ignored)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Accepted for compatibility; ignored (danmaku is out of scope).",
            "default": 25
          },
          "sentimentAnalysis": {
            "title": "Sentiment analysis (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility; ignored.",
            "default": false
          },
          "autoLocalize": {
            "title": "Auto-localize brand names (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility; ignored. Add the Chinese name of a brand to <code>keywords</code> or <code>searchAliases</code> instead.",
            "default": false
          },
          "searchAliases": {
            "title": "Search aliases",
            "type": "array",
            "description": "Accepted for compatibility: works like <code>keywords</code> (extra queries merged with the search query).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}