{
  "openapi": "3.0.1",
  "info": {
    "title": "抖音数据 API：商品、用户、视频与评论 | Douyin API",
    "description": "社媒数据助手 SocialDataX 提供只读抖音 / Douyin data API，支持商品搜索、用户搜索、作品搜索、评论与回复、作品详情、博主信息、博主作品、合集/短剧列表和热榜，并可导出 Apify Dataset、CSV、Excel。",
    "version": "0.1",
    "x-build-id": "VJFq0Jle2YLLKABNN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialdatax~socialdatax-douyin-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialdatax-socialdatax-douyin-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-douyin-data-api/runs": {
      "post": {
        "operationId": "runs-sync-socialdatax-socialdatax-douyin-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-douyin-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-socialdatax-socialdatax-douyin-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_products",
              "get_product_detail",
              "search_users",
              "search_hot_list",
              "get_video_detail",
              "get_user_info",
              "list_user_videos",
              "list_user_series",
              "get_video_comments",
              "get_video_sub_comments"
            ],
            "type": "string",
            "description": "先选择要调用的抖音数据 API / Douyin data API 能力，然后只填写该 operation 需要的字段；不要用无关字段替代必填字段，否则 Actor 会返回错误或修正提示，避免跑错查询。持续使用需要 Apify paid plan；free plan 用户有 5 次 SocialDataX API request 试用额度。Choose the operation first, then fill only the fields used by that operation.",
            "default": "search_videos"
          },
          "keyword": {
            "title": "关键词 / Keyword",
            "type": "string",
            "description": "operation=search_videos、search_products 或 search_users 时必填；分别用于作品、商品或用户搜索。其它 operation 可留空。",
            "default": "露营"
          },
          "sort_type": {
            "title": "排序 / Sort type",
            "enum": [
              "general",
              "time_descending",
              "like_count_descending",
              "sales_descending",
              "price_ascending",
              "price_descending"
            ],
            "type": "string",
            "description": "operation=search_videos 时支持 general、time_descending、like_count_descending；operation=search_products 时支持 general、sales_descending、price_ascending、price_descending。search_users 仅兼容共享表单默认值 general，填写其它排序值会返回提示；非搜索 operation 会忽略该字段。",
            "default": "general"
          },
          "publish_time_range": {
            "title": "发布时间 / Publish time",
            "enum": [
              "all",
              "day",
              "week",
              "half_year"
            ],
            "type": "string",
            "description": "仅 operation=search_videos 时使用。all=不限，day=一天内，week=一周内，half_year=半年内。",
            "default": "all"
          },
          "duration_range": {
            "title": "时长 / Duration",
            "enum": [
              "all",
              "under_1_minute",
              "one_to_five_minutes",
              "over_5_minutes"
            ],
            "type": "string",
            "description": "仅 operation=search_videos 时使用。all=不限，under_1_minute=1 分钟以下，one_to_five_minutes=1-5 分钟，over_5_minutes=5 分钟以上。",
            "default": "all"
          },
          "content_type": {
            "title": "内容类型 / Content type",
            "enum": [
              "all",
              "video",
              "image"
            ],
            "type": "string",
            "description": "仅 operation=search_videos 时使用。all=不限，video=视频，image=图文。",
            "default": "all"
          },
          "follower_count_range": {
            "title": "粉丝数量 / Follower count",
            "enum": [
              "all",
              "under_1k",
              "1k_to_10k",
              "10k_to_100k",
              "100k_to_1m",
              "over_1m"
            ],
            "type": "string",
            "description": "仅 operation=search_users 时使用，用于按公开粉丝数量范围筛选用户。",
            "default": "all"
          },
          "user_type": {
            "title": "用户类型 / User type",
            "enum": [
              "all",
              "regular_user",
              "enterprise_verified",
              "individual_verified"
            ],
            "type": "string",
            "description": "仅 operation=search_users 时使用，用于筛选普通用户、企业认证或个人认证用户。",
            "default": "all"
          },
          "min_price": {
            "title": "最低价格 / Minimum price",
            "minimum": 1,
            "type": "integer",
            "description": "仅 operation=search_products 时使用，单位为元；必须为正整数。留空表示不限。"
          },
          "max_price": {
            "title": "最高价格 / Maximum price",
            "minimum": 1,
            "type": "integer",
            "description": "仅 operation=search_products 时使用，单位为元；必须为正整数且不小于最低价格。留空表示不限。"
          },
          "only_live": {
            "title": "仅直播中 / Live products only",
            "type": "boolean",
            "description": "仅 operation=search_products 时使用。开启后只返回当前正在直播的商品。",
            "default": false
          },
          "dispatch_within_24h": {
            "title": "24 小时内发货 / Dispatch within 24h",
            "type": "boolean",
            "description": "仅 operation=search_products 时使用。开启后只返回支持 24 小时内发货的商品。",
            "default": false
          },
          "shipping_insurance": {
            "title": "运费险 / Shipping insurance",
            "type": "boolean",
            "description": "仅 operation=search_products 时使用。开启后只返回支持运费险的商品。",
            "default": false
          },
          "seven_day_return": {
            "title": "7 天无理由 / Seven-day return",
            "type": "boolean",
            "description": "仅 operation=search_products 时使用。开启后只返回支持 7 天无理由退货的商品。",
            "default": false
          },
          "selling_point": {
            "title": "卖点筛选 / Selling point",
            "enum": [
              "all",
              "high_sales",
              "high_rating"
            ],
            "type": "string",
            "description": "仅 operation=search_products 时使用。all=不限，high_sales=月销过万，high_rating=好评多。",
            "default": "all"
          },
          "official_store": {
            "title": "抖音旗舰 / Official store",
            "type": "boolean",
            "description": "仅 operation=search_products 时使用。开启后只返回带抖音旗舰标识的商品。",
            "default": false
          },
          "product_id": {
            "title": "商品 ID / Product ID",
            "type": "string",
            "description": "operation=get_product_detail 时至少提供 product_id 或 url 之一；同时提供时优先使用 url。product_id 可从 search_products Dataset 行原样复制，不要填写 sku_id 或搜索词。"
          },
          "aweme_id": {
            "title": "作品 ID / Aweme ID",
            "type": "string",
            "description": "operation=get_video_detail、get_video_comments、get_video_sub_comments 时使用；如果只有作品链接、短链接或分享文案，请直接填 url。详情和评论列表至少提供 aweme_id 或 url 之一，同时提供时优先使用 url。评论回复必须使用 get_video_comments Dataset 行里的真实 aweme_id + comment_id，不支持链接或分享文案。"
          },
          "url": {
            "title": "链接或分享文案 / URL or share text",
            "type": "string",
            "description": "operation=get_product_detail 时可填写抖音商品短链接、商品页面链接或分享文案；operation=get_video_detail、get_video_comments 时可填写作品链接、短链接或分享文案。对应 ID 与 url 同时提供时优先使用 url。评论回复 get_video_sub_comments 不使用 url。"
          },
          "sec_user_id": {
            "title": "用户 ID / Sec user ID",
            "type": "string",
            "description": "operation=get_user_info、list_user_videos、list_user_series 时至少提供 sec_user_id 或 profile_url 之一；同时提供时优先使用 profile_url。只填真实 sec_user_id，不要填昵称、主页名称或抖音号；如果只有主页链接、短链接或分享文案，请直接填 profile_url。"
          },
          "profile_url": {
            "title": "主页链接 / Profile URL",
            "type": "string",
            "description": "operation=get_user_info、list_user_videos、list_user_series 时至少提供 profile_url 或 sec_user_id 之一；同时提供时优先使用 profile_url。强烈推荐直接粘贴抖音主页链接、短链接或分享文案。"
          },
          "comment_id": {
            "title": "一级评论 ID / Comment ID",
            "type": "string",
            "description": "仅 operation=get_video_sub_comments 时必填。先运行 get_video_comments，在 Dataset 里找到 reply_count > 0 的一级评论行，复制该行的 comment_id；不要填评论内容、昵称或其它文本。"
          },
          "page_token": {
            "title": "分页令牌 / Page token",
            "type": "string",
            "description": "作品搜索、商品搜索、用户搜索、评论、评论回复、博主作品列表、博主合集列表继续翻页时，原样传入上一页 Dataset 行的 page_next_page_token（对应 API 返回的 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。When enabled, each page request counts as one 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}