{
  "openapi": "3.0.1",
  "info": {
    "title": "B站 / Bilibili API - 视频搜索、Bilibili comments、专栏、用户数据",
    "description": "社媒数据助手 SocialDataX 提供的只读 B站 / 哔哩哔哩 / Bilibili data API，支持 Bilibili video search / B站视频搜索、article search / 专栏搜索、content details / 内容详情、Bilibili comments / B站评论导出、comment replies / 评论回复、likes and reposts / 赞转列表、user profiles / 用户资料和用户发布列表。",
    "version": "0.1",
    "x-build-id": "KDqT13UMbhrt4lUPA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialdatax~socialdatax-bilibili-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialdatax-socialdatax-bilibili-data-api",
        "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/socialdatax~socialdatax-bilibili-data-api/runs": {
      "post": {
        "operationId": "runs-sync-socialdatax-socialdatax-bilibili-data-api",
        "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/socialdatax~socialdatax-bilibili-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-socialdatax-socialdatax-bilibili-data-api",
        "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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "操作 / Operation",
            "enum": [
              "search_videos",
              "search_articles",
              "get_content_detail",
              "get_content_comments",
              "get_content_comment_replies",
              "get_content_likes_and_reposts",
              "get_user_info",
              "list_user_videos",
              "list_user_articles",
              "list_user_dynamics"
            ],
            "type": "string",
            "description": "先选择要调用的 B站 / Bilibili 数据能力，然后只填写该 operation 需要的字段；无关字段会被忽略。Choose one Bilibili data operation first, then fill only the fields used by that operation.",
            "default": "search_videos"
          },
          "keyword": {
            "title": "关键词 / Keyword",
            "type": "string",
            "description": "operation=search_videos 或 search_articles 时必填；其它 operation 可留空。Required for video search and article search.",
            "default": "露营"
          },
          "sort_type": {
            "title": "排序 / Sort type",
            "type": "string",
            "description": "搜索、评论和用户视频列表使用。视频搜索支持 general、view_count_descending、time_descending、danmaku_count_descending、collect_count_descending；专栏搜索支持 general、time_descending、view_count_descending、like_count_descending、comment_count_descending；评论支持 hot、time_descending；用户视频支持 time_descending、view_count_descending、collect_count_descending。"
          },
          "category": {
            "title": "专栏分类 / Article category",
            "enum": [
              "all",
              "animation",
              "gaming",
              "film_and_tv",
              "lifestyle",
              "hobbies",
              "light_novel",
              "technology",
              "notes"
            ],
            "type": "string",
            "description": "仅 operation=search_articles 时使用。可选 all、animation、gaming、film_and_tv、lifestyle、hobbies、light_novel、technology、notes。",
            "default": "all"
          },
          "publish_time_range": {
            "title": "发布时间范围 / Publish time range",
            "enum": [
              "all",
              "day",
              "week",
              "half_year"
            ],
            "type": "string",
            "description": "仅 operation=search_videos 时使用。可选 all、day、week、half_year。",
            "default": "all"
          },
          "publish_time_start_date": {
            "title": "开始日期 / Start date",
            "type": "string",
            "description": "仅 operation=search_videos 且需要自定义发布时间范围时使用；格式 YYYY-MM-DD。自定义日期范围时 publish_time_range 保持 all，并同时填写结束日期。"
          },
          "publish_time_end_date": {
            "title": "结束日期 / End date",
            "type": "string",
            "description": "仅 operation=search_videos 且需要自定义发布时间范围时使用；格式 YYYY-MM-DD。自定义日期范围时 publish_time_range 保持 all，并同时填写开始日期。"
          },
          "duration_range": {
            "title": "视频时长 / Video duration",
            "enum": [
              "all",
              "under_10_minutes",
              "between_10_and_30_minutes",
              "between_30_and_60_minutes",
              "over_60_minutes"
            ],
            "type": "string",
            "description": "仅 operation=search_videos 时使用。可选 all、under_10_minutes、between_10_and_30_minutes、between_30_and_60_minutes、over_60_minutes。",
            "default": "all"
          },
          "url": {
            "title": "内容链接 / Content URL",
            "type": "string",
            "description": "operation=get_content_detail、get_content_comments、get_content_likes_and_reposts 时使用。详情和评论可粘贴 B站视频、专栏或动态链接；赞转列表仅支持 opus/动态帖子链接，不支持视频链接或 read/cv、read/mobile 专栏链接。"
          },
          "content_id": {
            "title": "内容 ID / Content ID",
            "type": "string",
            "description": "operation=get_content_detail 或 get_content_comments 时可填；如果有 B站视频、专栏或动态链接，推荐直接填 url。"
          },
          "post_id": {
            "title": "专栏/动态 ID / Article or dynamic post ID",
            "type": "string",
            "description": "仅 operation=get_content_likes_and_reposts 时使用；请填写 get_content_detail 返回的 post_id，或填写 opus/动态帖子 url。视频链接、BV/av ID、cv 专栏 ID 暂不支持赞转列表。"
          },
          "comment_object_id": {
            "title": "评论对象 ID / Comment object ID",
            "type": "string",
            "description": "仅 operation=get_content_comment_replies 时必填。先运行 get_content_comments，在 Dataset 里找到 reply_count > 0 的一级评论行，复制 comment_object_id。"
          },
          "comment_object_type": {
            "title": "评论对象类型 / Comment object type",
            "type": "integer",
            "description": "仅 operation=get_content_comment_replies 时必填。请从 get_content_comments 的同一条 Dataset 行复制 comment_object_type。"
          },
          "comment_id": {
            "title": "一级评论 ID / Comment ID",
            "type": "string",
            "description": "仅 operation=get_content_comment_replies 时必填。请从 get_content_comments 的同一条 Dataset 行复制 comment_id。"
          },
          "user_id": {
            "title": "用户 ID / User ID",
            "type": "string",
            "description": "operation=get_user_info、list_user_videos、list_user_articles、list_user_dynamics 时至少提供 user_id 或 profile_url 之一；只填 B站数字 user_id / mid，不要填昵称、主页名称、BV 号或 aid。"
          },
          "profile_url": {
            "title": "主页链接 / Profile URL",
            "type": "string",
            "description": "operation=get_user_info、list_user_videos、list_user_articles、list_user_dynamics 时使用。推荐直接粘贴完整 Bilibili / B站主页链接，例如 https://space.bilibili.com/{id}；用户类 operation 不要填 b23.tv 短链接。"
          },
          "page_token": {
            "title": "分页令牌 / Page token",
            "type": "string",
            "description": "搜索、评论、评论回复、赞转列表和用户内容列表继续翻页时传入上一页返回的完整 next_page_token；第一页留空。auto_paginate=true 时通常不用手动填写。"
          },
          "max_items": {
            "title": "最大结果数 / Max items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "最多写入多少条 Dataset item。对搜索、评论、评论回复、赞转列表和用户内容列表用于限制自动翻页结果；较大的值可能触发多次 SocialDataX API request。",
            "default": 50
          },
          "auto_paginate": {
            "title": "自动翻页 / Auto paginate",
            "type": "boolean",
            "description": "开启后 Actor 会按 next_page_token 继续请求，直到达到 max_items 或没有下一页。关闭时只请求当前 page_token。每翻一页计 1 次 SocialDataX API request。",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}