{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: videos, comments, danmaku, users & search",
    "description": "Scrape Bilibili (哔哩哔哩, B站) videos with views, likes, coins, favorites, shares, danmaku and tags, comments with replies, danmaku (bullet comments), UP主 profiles and uploads, video search past 1,000 results, user search and the Popular list. No login, no cookies, no browser.",
    "version": "0.1",
    "x-build-id": "Ksm22GgtyrmVmIyyN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~bilibili/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-bilibili",
        "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/pikoulas~bilibili/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-bilibili",
        "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/pikoulas~bilibili/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-bilibili",
        "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": {
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs (bilibili.com/video/..., m.bilibili.com, b23.tv short links) or IDs (BV1xx411c7mD, av170001). Each comes with its details, and its comments and danmaku as set below.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Users (UP主)",
            "type": "array",
            "description": "Space URLs (space.bilibili.com/33621433) or user IDs (UID, mid). Gives each user's profile and uploads, as set below.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerUser": {
            "title": "Max videos per user",
            "minimum": 0,
            "type": "integer",
            "description": "Uploads from each user, in the order below. 0 for the profile only.",
            "default": 30
          },
          "userVideosSort": {
            "title": "User videos order",
            "enum": [
              "pubdate",
              "click"
            ],
            "type": "string",
            "description": "Newest first, or most played first.",
            "default": "pubdate"
          },
          "includeUserDetails": {
            "title": "Include user profiles",
            "type": "boolean",
            "description": "One item per user: followers, following, video count, likes, level, verification, VIP, sign, birthday, school, live room. Off: their videos only.",
            "default": true
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords searched on Bilibili, in Chinese or any language (原神, 美食, iPhone 17). search.bilibili.com URLs work too.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "videos",
              "users"
            ],
            "type": "string",
            "description": "Videos, or users (UP主), each with their profile and uploads as set above.",
            "default": "videos"
          },
          "maxResultsPerSearch": {
            "title": "Max results per search",
            "minimum": 1,
            "type": "integer",
            "description": "Videos or users from each search. Bilibili shows up to 1,000 per search; past that, the run searches day ranges and gives thousands (videos only).",
            "default": 50
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "The order of a video search.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Duration",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Search filter on the video's length.",
            "default": "any"
          },
          "searchCategoryId": {
            "title": "Category ID",
            "minimum": 1,
            "type": "integer",
            "description": "Search filter on Bilibili's category (tid): 4 games, 17 single-player games, 36 knowledge, 76 food, 188 tech, 3 music, 129 dance, 160 life, 1 animation. Empty for all. The categoryId of the videos found is in the same tree."
          },
          "publishedAfter": {
            "title": "Published after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only videos published on or after this date (YYYY-MM-DD, UTC), in searches, users' uploads and the Popular list. Uploads read newest first stop once they get past it; videos given by URL are taken whatever their date."
          },
          "publishedBefore": {
            "title": "Published before",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only videos published on or before this date (YYYY-MM-DD, UTC)."
          },
          "includePopular": {
            "title": "Include the Popular list",
            "type": "boolean",
            "description": "The videos of Bilibili's Popular page (综合热门), in its order.",
            "default": false
          },
          "maxPopularVideos": {
            "title": "Max Popular videos",
            "minimum": 1,
            "type": "integer",
            "description": "Bilibili lists about 650.",
            "default": 100
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "Coins, shares, likes, favorites, tags, parts, collection and subtitle languages of every video searches, users and the Popular list give (a request or two each). Off: what the lists show, which is faster: search has views, likes, favorites, danmaku, comments and tags; users' uploads views and danmaku. Videos given by URL always get details.",
            "default": true
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Comments of every video, replies included. 0 for none.",
            "default": 0
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Hot (most liked) comments first, or newest first. Pinned comments come first.",
            "default": "hot"
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Replies under each comment, oldest first. 0 for none.",
            "default": 0
          },
          "maxDanmakuPerVideo": {
            "title": "Max danmaku per video",
            "minimum": 0,
            "type": "integer",
            "description": "Danmaku (弹幕, bullet comments) of every video, with their time in the video, in timeline order. Bilibili gives the latest few thousand of each part. 0 for none.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for most runs. When Bilibili's risk control refuses the run's IP, the run switches to Apify's residential proxy by itself.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}