{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook 公开评论抓取器",
    "description": "抓取 Facebook 公开帖子评论和回复线程，无需登录或 Cookie。导出文本、作者、时间、互动、评论链接和线程关系，支持 API、MCP、定时任务和 JSON、CSV、Excel。",
    "version": "0.0",
    "x-build-id": "92VB2N8Ls9bh0tKe6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spbotdel~facebook-comments-cn/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spbotdel-facebook-comments-cn",
        "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/spbotdel~facebook-comments-cn/runs": {
      "post": {
        "operationId": "runs-sync-spbotdel-facebook-comments-cn",
        "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/spbotdel~facebook-comments-cn/run-sync": {
      "post": {
        "operationId": "run-sync-spbotdel-facebook-comments-cn",
        "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": [
          "postUrls"
        ],
        "properties": {
          "postUrls": {
            "title": "帖子链接",
            "type": "array",
            "description": "Facebook 公开链接。未登录支持：公共主页帖子、小组永久链接、story.php 和视频页面。Reels、照片页面和 /watch/ 会被识别，但 Facebook 不向未登录访客提供评论列表。",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerPost": {
            "title": "每个帖子最大评论数",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "每个帖子写入的评论和回复总上限。公开帖子每页约 10 条，最高 1000。",
            "default": 300
          },
          "maxPostsPerRun": {
            "title": "单次最大帖子数",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "单次运行最多处理的帖子链接数量，最高 100。",
            "default": 5
          },
          "maxConcurrency": {
            "title": "并行帖子数",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "同时处理的帖子数量。每个帖子维护独立游标和请求间隔。",
            "default": 5
          },
          "queryMode": {
            "title": "查询模式",
            "enum": [
              "FRESH_LIST",
              "FRESH_LIST_WITH_REPLIES",
              "LEGACY_TOPLEVEL"
            ],
            "type": "string",
            "description": "FRESH_LIST 使用实时评论分页查询，推荐使用。LEGACY_TOPLEVEL 是旧分页器，可能重复返回同一批评论。",
            "default": "FRESH_LIST"
          },
          "unionSorts": {
            "title": "合并排序窗口",
            "type": "boolean",
            "description": "同时遍历默认排序和最新排序，并合并不同评论 ID。可以提高公开内容覆盖率。",
            "default": true
          },
          "commentsSortOrder": {
            "title": "评论排序",
            "enum": [
              "MOST_RELEVANT",
              "NEWEST",
              "ALL_COMMENTS"
            ],
            "type": "string",
            "description": "Facebook 评论排序方式。MOST_RELEVANT 使用默认相关度，NEWEST 使用倒序时间，ALL_COMMENTS 使用未过滤时间排序。",
            "default": "MOST_RELEVANT"
          },
          "knownCommentIds": {
            "title": "已知评论 ID",
            "type": "array",
            "description": "已经拥有的评论 ID，运行时会跳过，适合增量监控。",
            "items": {
              "type": "string"
            }
          },
          "knownDatasetId": {
            "title": "已知评论数据集",
            "type": "string",
            "description": "包含历史评论 ID 的数据集 ID。需要 Actor 有读取该数据集的权限。"
          },
          "dedupeStoreName": {
            "title": "去重存储名称",
            "type": "string",
            "description": "跨运行保存已交付评论 ID 的 Key-Value Store 名称。使用固定名称时，重复运行只返回新评论。"
          },
          "failOnEmpty": {
            "title": "空结果时失败",
            "type": "boolean",
            "description": "没有抓取到评论时将运行标记为失败，适合定时监控。",
            "default": false
          },
          "includePostText": {
            "title": "包含帖子正文",
            "type": "boolean",
            "description": "把帖子正文复制到每行结果的 `post_text` 字段，不增加额外请求。",
            "default": false
          },
          "includeReplies": {
            "title": "包含回复",
            "type": "boolean",
            "description": "展开顶层评论下的回复线程，并继续分页到公开可见的末尾。",
            "default": true
          },
          "maxReplyThreadsPerPost": {
            "title": "每个帖子的回复线程数",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "展开多少个有回复的顶层评论，优先处理回复最多的线程。0 表示关闭。",
            "default": 20
          },
          "maxRepliesPerPost": {
            "title": "每个帖子最大回复数",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "每个帖子写入的回复行数上限，同时计入 `maxCommentsPerPost`。",
            "default": 200
          },
          "pageDelayMs": {
            "title": "分页间隔（毫秒）",
            "minimum": 200,
            "maximum": 10000,
            "type": "integer",
            "description": "GraphQL 分页之间的等待时间。默认 1000 毫秒最稳妥，200 到 400 毫秒也经过测试。",
            "default": 1000
          },
          "maxPagesPerPost": {
            "title": "每个帖子最大页数",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "分页安全上限。按每页约 10 条评论计算，60 页约为 600 条。",
            "default": 60
          },
          "introDelayMs": {
            "title": "页面加载后等待（毫秒）",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "首次 GraphQL 请求前等待页面稳定，0 表示关闭。",
            "default": 1500
          },
          "onlyCommentsNewerThan": {
            "title": "只保留较新的评论",
            "type": "string",
            "description": "只保留该时间之后的评论。支持绝对日期或 `30 days`、`12 hours`、`2 weeks` 等相对时间。"
          },
          "proxyCountry": {
            "title": "代理国家",
            "type": "string",
            "description": "住宅代理使用的两位国家代码。已验证运行使用 US。",
            "default": "US"
          },
          "proxyTier": {
            "title": "代理层级",
            "enum": [
              "auto",
              "datacenter",
              "residential"
            ],
            "type": "string",
            "description": "auto 先使用成本更低的数据中心代理，被 Facebook 拦截后自动切换到住宅代理。也可以强制使用 datacenter 或 residential。",
            "default": "auto"
          },
          "proxyGroups": {
            "title": "代理组",
            "type": "array",
            "description": "Apify 代理组。RESIDENTIAL 是已验证默认值，DATACENTER 更便宜但更容易被拦截。",
            "items": {
              "type": "string"
            },
            "default": [
              "RESIDENTIAL"
            ]
          },
          "minCommentsPerPost": {
            "title": "每个帖子最小评论数",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "密度保护。已知公开评论少于该值时提前停止，0 表示关闭。",
            "default": 0
          },
          "startCursorByPost": {
            "title": "按帖子继续的游标",
            "type": "object",
            "description": "从上次运行摘要中的 `{endCursor}` 继续。不要把不同帖子的游标混用。",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}