{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili 哔哩哔哩 B站 Scraper: All Comments per Video, No Login",
    "description": "All comments of any Bilibili (B站, 哔哩哔哩) video: up to 100,000 per video with replies, a sentiment score per comment, daily tracking of only new comments. Plus videos from search, channels or Popular with stats and creator profiles. No login. $6.40 per 1,000 comments.",
    "version": "0.2",
    "x-build-id": "FgbeT0cz5VeTyxc1W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepurple~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepurple-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/deepurple~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-deepurple-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/deepurple~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-deepurple-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "popular",
              "videos",
              "users",
              "creatorVideos"
            ],
            "type": "string",
            "description": "search: videos for each keyword. popular: the Popular feed. videos: given videos with full stats. users: creators by keyword or user id. creatorVideos: all videos of the given creators.",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search words, Chinese or English, for example \"python\". Mode search: video search. Mode users: creator search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Search order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Sort order of video search. For creatorVideos: pubdate, click or stow (others fall back to pubdate).",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "all",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Keep only videos of this length in video search.",
            "default": "all"
          },
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Mode videos: BV ids or any URL containing one, for example https://www.bilibili.com/video/BV1rpWjevEip. Invalid entries are skipped.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User ids",
            "type": "array",
            "description": "Modes users and creatorVideos: user ids (digits) or space.bilibili.com/<id> URLs. Mode users gives one profile each; creatorVideos gives all videos of each creator.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Per keyword (search, users) or in total (popular). 1 to 1000.",
            "default": 100
          },
          "fetchDetails": {
            "title": "Fetch full video stats",
            "type": "boolean",
            "description": "Search and popular: open each video page for coins, shares, tags and uploader followers. One residential request per video; the row is billed as video-details.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Mode videos, or search/popular/creatorVideos with full video stats: up to maxCommentsPerVideo root comments per video, 20 per page, no login. In search, popular and creatorVideos modes also turn on fetchDetails.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "With Include comments on: maximum number of root comments per video, 20 per page. The pinned comment counts toward the limit. Every comment is billed as a comment event.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "popular",
              "newest"
            ],
            "type": "string",
            "description": "With Include comments on: popular = most liked first, newest = latest first.",
            "default": "popular"
          },
          "commentsOrder": {
            "title": "Sort comments by",
            "enum": [
              "api",
              "likes",
              "replies"
            ],
            "type": "string",
            "description": "With Include comments on: likes or replies first collect all root comments of a video (up to Comments per video), then output them sorted, with a commentRank place number. Replies follow right after their root comment, as before.",
            "default": "api"
          },
          "analyzeSentiment": {
            "title": "Analyze comment sentiment",
            "type": "boolean",
            "description": "With Include comments on: adds sentiment (positive, negative, neutral) and sentimentScore (-1 to 1) to every comment and reply. SnowNLP for Chinese text, a word list for English. An estimate, not a guarantee of accuracy.",
            "default": false
          },
          "videoSummary": {
            "title": "Video summary row",
            "type": "boolean",
            "description": "With Include comments on: one extra summary row per video (comment counts, likes, top comment, sentiment shares, time span). Handy for comparing videos in one table. Free: not charged.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "With Include comments on: also fetch up to this many replies under each root comment (full reply threads, no login needed). Each reply is billed as a comment. 0 = off.",
            "default": 0
          },
          "parallelVideos": {
            "title": "Videos at the same time",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many videos to collect at the same time (comments and details). Each video still loads its pages one by one with a pause. 1 = one video after another.",
            "default": 3
          },
          "onlyNew": {
            "title": "Only new items",
            "type": "boolean",
            "description": "Skip videos and users returned by earlier runs with the same mode, keywords, order, length and ids.",
            "default": false
          },
          "onlyNewComments": {
            "title": "Only new comments",
            "type": "boolean",
            "description": "With includeComments: return only comments posted since the previous run with this option, per video. The first run collects as usual and remembers where it stopped. Comments are read newest first. Run it on a schedule for daily monitoring.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Used for search, popular, comments and user requests (Apify datacenter proxy is enough). Video pages always use Apify residential proxy.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}