{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper",
    "description": "Scrape Bilibili (B站) with no account and no cookies to paste: search videos by keyword, read full video statistics, get a creator's profile and upload list, and export bullet comments (danmaku). You pay per row saved.",
    "version": "0.1",
    "x-build-id": "Vxm1kjvrUfMqS4URe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/idealistic_countryside~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-idealistic_countryside-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/idealistic_countryside~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-idealistic_countryside-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/idealistic_countryside~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-idealistic_countryside-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": "What to collect",
            "enum": [
              "search",
              "videos",
              "creators",
              "popular"
            ],
            "type": "string",
            "description": "Search uses the keywords list. Videos uses the video links list. Creators uses the creator links list. Popular needs no list: it reads the Bilibili popular chart.",
            "default": "search"
          },
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used in Search mode. One keyword or phrase per line, in Chinese or English. Each keyword is searched separately. Bilibili shows at most 1,000 results for one keyword.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video links or BV ids",
            "type": "array",
            "description": "Used in Videos mode. One per line: a video link such as https://www.bilibili.com/video/BV1XbrYY4E35/ or only the BV id.",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator links or ids",
            "type": "array",
            "description": "Used in Creators mode. One per line: a channel link such as https://space.bilibili.com/8047632 or only the numeric id.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Maximum videos",
            "minimum": 1,
            "type": "integer",
            "description": "The most videos to save for each keyword, for each creator, or from the popular chart. The run stops asking Bilibili for more once it has this many.",
            "default": 20
          },
          "sortOrder": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "bulletComments",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Search mode only. The order Bilibili returns the results in.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under10Minutes",
              "from10To30Minutes",
              "from30To60Minutes",
              "over60Minutes"
            ],
            "type": "string",
            "description": "Search mode only. Keep videos of one length band.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Search mode only. Keep videos published on or after this day (China time). Leave empty for no lower bound."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Search mode only. Keep videos published on or before this day (China time). Leave empty for no upper bound."
          },
          "includeVideoDetails": {
            "title": "Open every video for full details",
            "type": "boolean",
            "description": "Search, Creators and Popular modes. Search results have no coin or share counts and can shorten the description. Creator upload lists and the popular chart have no tags. Switch this on to open each video and fill those in. It makes one more request per video, so the run is slower. Videos mode always returns full details.",
            "default": false
          },
          "includeCreatorVideos": {
            "title": "Also list each creator's uploads",
            "type": "boolean",
            "description": "Creators mode only. After the profile, save the uploads Bilibili lists for the creator, newest first, up to \"Maximum videos\". Each row already has views, likes, coins, favorites, shares and comment counts. Raise \"Maximum videos\" to get the whole list.",
            "default": false
          },
          "includeBulletComments": {
            "title": "Export bullet comments (danmaku)",
            "type": "boolean",
            "description": "Save the bullet comments of every video collected, one row each, with the second of the video they appear at. Each bullet comment is a paid row.",
            "default": false
          },
          "maxBulletCommentsPerVideo": {
            "title": "Maximum bullet comments per video",
            "minimum": 1,
            "type": "integer",
            "description": "Only used when bullet comments are switched on. Bilibili keeps a limited pool for each video, so popular videos return about a thousand, not every one ever sent.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}