{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper - Videos, Comments, Uploader Profiles & Stats",
    "description": "Export Bilibili video views, likes, coins, favorites and danmaku counts, uploader profiles and public comments. Start from keywords, video links, BV IDs, uploader IDs, popular videos or current category rankings. Built for agencies, China-focused marketers and researchers.",
    "version": "0.1",
    "x-build-id": "lrlirUqv08s5tsOPl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-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/s-r~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s-r-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/s-r~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-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",
              "videos",
              "comments",
              "profiles",
              "uploader_videos",
              "popular"
            ],
            "type": "string",
            "description": "Select keyword search, video details, comments, uploader profiles, uploader videos or popular videos.",
            "default": "popular"
          },
          "search_terms": {
            "title": "Search terms",
            "type": "array",
            "description": "Chinese or Latin keywords. Required in search mode; the limit applies separately to each term.",
            "items": {
              "type": "string"
            }
          },
          "video_urls": {
            "title": "Video urls",
            "type": "array",
            "description": "Bilibili video URLs, mobile URLs, BV IDs, av IDs or b23.tv links. Required for videos and comments.",
            "items": {
              "type": "string"
            }
          },
          "uploader_ids": {
            "title": "Uploader ids",
            "type": "array",
            "description": "Numeric uploader mid IDs or space.bilibili.com profile URLs. Required for profiles and uploader_videos.",
            "items": {
              "type": "string"
            }
          },
          "max_results": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum delivered rows per keyword, uploader or comments video. Inline replies count toward the limit. Direct video and profile modes return one row per input.",
            "default": 20
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Search: totalrank (default), click, pubdate, dm or stow. Uploader videos: pubdate (default), click or stow. Comments: hot (default) or newest."
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under_10",
              "10_30",
              "30_60",
              "over_60"
            ],
            "type": "string",
            "description": "Search video duration filter, in minutes.",
            "default": "any"
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Popular rankings use current Bilibili tid_v2: 0 all, 1001 film, 1002 entertainment, 1003 music, 1004 dance, 1005 animation, 1007 kichiku, 1008 games, 1010 knowledge, 1012 technology, 1013 cars, 1014 fashion, 1018 sports, 1020 food, 1024 animals. Supported legacy main IDs are translated; obsolete ranking subcategories are rejected. Omit for the popular list. Search translates these tid_v2 IDs to legacy tids. Only the all-category ranking may use an alternative source with a warning. Rankings without recent publication dates are rejected."
          },
          "include_details": {
            "title": "Include details",
            "type": "boolean",
            "description": "Enrich each list video with full details, including coins and shares. Included in the video row event.",
            "default": false
          },
          "include_replies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Return the inline replies visible on each comments page as separate comment rows. Does not expand full reply threads.",
            "default": false
          },
          "cursor": {
            "title": "Cursor",
            "minLength": 1,
            "maxLength": 150000,
            "type": "string",
            "description": "Continuation string from next_cursor. Keep every other input unchanged. Apify follows it automatically."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}