{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: 哔哩哔哩 Videos & Comments",
    "description": "Bilibili (哔哩哔哩, B站) videos by keyword, URL, uploader (UP主) or trending list: title, views, likes, coins, danmaku count, tags, duration, parts and uploader followers, plus comments with replies and uploader profiles. Chinese text kept as written. No login, no cookies.",
    "version": "0.1",
    "x-build-id": "EEhepiglNT3dVmy5w"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tortuga~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tortuga-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/tortuga~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tortuga-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/tortuga~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tortuga-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": {
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search on Bilibili, one per line, in Chinese or any language (e.g. 原神, 美食, python). Each term returns up to 'Max videos per search / uploader / list' videos, up to 1,000 (Bilibili's own limit of 50 pages).",
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Sort search results by",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Bilibili's search sort: best match (综合排序), most views (最多播放), newest (最新发布), most danmaku (最多弹幕), most favorites (最多收藏) or most comments (最多评论).",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Video length",
            "enum": [
              "all",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Bilibili's duration filter for search results.",
            "default": "all"
          },
          "urls": {
            "title": "Bilibili URLs",
            "type": "array",
            "description": "One per line: video URLs (bilibili.com/video/BV... or av..., always returned with full details), uploader pages (space.bilibili.com/<UID>, or a bare UID number), search URLs (search.bilibili.com/all?keyword=...) and popular-list pages (bilibili.com/v/popular/all, /rank/all, /weekly, /history). b23.tv short links are not supported.",
            "items": {
              "type": "string"
            }
          },
          "includeUploaderInfo": {
            "title": "Uploader profile row",
            "type": "boolean",
            "description": "For each uploader URL, also save one row with the uploader's profile: name, followers, following, number of videos, total likes, level, bio and verification. Charged as one result.",
            "default": true
          },
          "uploaderSort": {
            "title": "Uploader videos order",
            "enum": [
              "pubdate",
              "click",
              "stow"
            ],
            "type": "string",
            "description": "Order of an uploader's videos: newest first, most played or most favorited.",
            "default": "pubdate"
          },
          "popularLists": {
            "title": "Popular / trending lists",
            "type": "array",
            "description": "Bilibili's own trending lists: Popular now (综合热门, a few hundred videos), Top 100 ranking (排行榜), Weekly picks (每周必看, latest issue) and All-time must-watch (入站必刷). Each list returns up to 'Max videos per search / uploader / list' videos.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking",
                "weekly",
                "precious"
              ],
              "enumTitles": [
                "Popular now (综合热门)",
                "Top 100 ranking (排行榜)",
                "Weekly picks (每周必看)",
                "All-time must-watch (入站必刷)"
              ]
            }
          },
          "maxResultsPerSource": {
            "title": "Max videos per search / uploader / list",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop each search term, each uploader and each popular list after this many videos. 0 = uploader profile rows only.",
            "default": 50
          },
          "includeVideoDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Also open every video from searches, uploaders and lists for tags, coins, shares, parts (分P), honours, highest rank and the uploader's follower count. Charged as a 'video details' event instead of a list result. Video URLs always get details.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Also save up to this many top-level comments for every video in the run (video URLs and all videos found by search, uploader or list). 0 = no comments. Each comment and reply is charged as one 'comment' event.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Hot comments first (Bilibili's default, includes the uploader's pinned comment) or newest first.",
            "default": "hot"
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Also save up to this many replies under each comment (楼中楼). Up to 2-3 replies come with the comment page itself; more are read from the comment's reply thread, 20 per request. 0 = no replies.",
            "default": 0
          },
          "commentsNewerThan": {
            "title": "Only comments newer than",
            "type": "string",
            "description": "Only comments and replies newer than: a date (YYYY-MM-DD) or a period such as '7 days' or '24 hours'. Switches comment order to newest first and stops reading a video's comments once a whole page is older."
          },
          "maxItems": {
            "title": "Max results (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop the whole run after this many saved rows (videos, uploader rows, comments and replies together). Every saved row is charged, so this caps the cost.",
            "default": 1000
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed items",
            "type": "boolean",
            "description": "Remember what earlier runs of this input returned and output only new videos and comments, plus uploader rows whose video count changed. Use with a Schedule; unchanged items are not charged.",
            "default": false
          },
          "monitoringKey": {
            "title": "Monitoring key",
            "type": "string",
            "description": "Name for this watch, so several schedules on the same input stay separate; defaults to a key derived from the input"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy (datacenter) works for Bilibili's API and is the default. When Bilibili's risk control refuses a request twice (HTTP 412), the third and later tries of that request go through Apify RESIDENTIAL automatically (a few KB of JSON each). The proxy cost is included in the result price.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}