跳转到主要内容
POST
社交数据研究
Reddit、X、YouTube、TikTok、Instagram 和 LinkedIn 的公开社交数据:搜索帖子、读取账号、近期帖子或单篇帖子,以及查找同一账号在其他平台上的资料。选择 platform 和 mode,并提供 query、handle 或 url。 所有模式返回六个平台共享的规范化 output,以及最后一个 Run 的 id、provider 和生命周期 status。profile 返回单个账号,包含 platform、handle、name、url、bio、headline、website、followers、following、posts、verified;search 和 feed 返回帖子列表 output.items[],包含 id、url、title、text、author、author_url、published_at、likes、comments、shares、views;post 返回相同字段的单篇帖子;find 返回 output.profiles[],包含 platform、url、handle、scrapecreators_confidence、followers,Reddit 为匹配版块,并包含 pdl_likelihood。原生输出不在 output 中重复,保留在 Run 中,可通过 GET /v1/runs/:id 读取。平台或数据提供商未报告的值为 null。 分别检查 result_status 和 status:前者为 success、no_result、error 或 pending。有效空结果为 no_result,保留模式结构,items 或 profiles 为 [],或各字段为 null。charge_usd 为本响应 runs 总费用,所有 Run 结算前为 null。provider=auto 选择第一家符合条件的数据提供商,仅在 PROVIDER_ERROR、TIMED_OUT 或受理时 503 后尝试下一家;指定数据提供商时不切换。对于 QUEUED/RUNNING,即 Apify 路径的 HTTP 202,在 API 服务地址上使用认证轮询 result_url。有意重试时复用相同 Idempotency-Key 和执行参数。

各模式输出

各模式共享的规范化字段,适用于所有平台。原生输出保留在 Run 中,可通过 GET /v1/runs/:id 读取。平台或数据提供商未报告的值为 null。
  • profile: platform, handle, name, url, bio, headline, website, followers, following, posts, verified
  • search: items[]: id, url, title, text, author, author_url, published_at, likes, comments, shares, views
  • feed: items[]: 与 search 相同的帖子字段
  • post: id, url, title, text, author, author_url, published_at, likes, comments, shares, views
  • find: profiles[]: platform, url, handle, scrapecreators_confidence, followers ,Reddit 为匹配版块; pdl_likelihood

请求头

idempotency-key
string
必填

为每次预期执行生成唯一值,推荐使用 UUID。使用同一个键和执行参数重试,可读取原 Run,避免再次扣费。使用同一个键但修改执行参数会返回 409;修改 task_id 或 metadata 不会更新原 Run。

Minimum string length: 1

请求体

application/json
platform
enum<string>
必填
可用选项:
reddit,
x,
youtube,
tiktok,
instagram,
linkedin
mode
enum<string> | null

默认为 search。每个平台都支持各个模式。

  • search:匹配 query 的帖子。
  • profile:根据 handle 获取账号详情;Reddit 为版块,LinkedIn 需提供个人或公司 url。
  • feed:handle 的近期帖子或视频;LinkedIn 需提供公司 url。
  • post:根据 url 获取单篇帖子或视频。
  • find:根据 handle 查找其他社交平台资料;LinkedIn 需提供个人资料 url;Reddit 使用 query 查找版块。
可用选项:
search,
profile,
feed,
post,
find
provider
enum<string> | null

默认为 auto,按 Glasser 偏好顺序选择第一家符合条件的数据提供商。指定的数据提供商必须支持请求且获得当前 API Key 的允许,不会切换到其他家。可用值见下方。

可用选项:
auto,
scrapecreators,
apify,
tikhub,
pdl
query
string | null
Required string length: 1 - 500
handle
string | null

用户名,不含 @;或 Reddit 版块名,不含 r/。

Required string length: 1 - 100
url
string | null
Required string length: 1 - 2048
task_id
string | null

将相关 Run,包括自动切换产生的 Run,归入同一个 Task。复用稳定字符串,并通过 Task 筛选 Run 列表。

metadata

可选追踪字段,随 Run 返回,也可用于筛选。不会发送给数据提供商,也不影响路由、价格或幂等。

  • 最多 20 个键:小写字母、数字和下划线,以字母开头,最长 40 个字符。
  • 值:长度为 1–500 的字符串。
  • user_id:终端用户的不透明 ID,不得使用邮箱或姓名。

无效条目整体丢弃,不截断。请求继续执行,Run 返回实际保存的字段。

响应

成功

id
string
必填
run_url
string
必填

在控制台打开 Run,需要工作空间成员权限。

provider
string
必填
Pattern: ^[a-z0-9][a-z0-9-]*$
endpoint
string
必填
Pattern: ^\/.+$
endpoint_version
integer
必填
status
enum<string>
必填

QUEUED 或 RUNNING 表示仍在执行。COMPLETED 表示已有数据提供商响应,包括非 2xx 响应。FAILED 请读取 failure。STOPPED 表示分派前停止。charge_usd 与状态分别检查。

可用选项:
QUEUED,
RUNNING,
COMPLETED,
FAILED,
STOPPED
failure
object | null
必填

Run 失败原因,仅在 status 为 FAILED 时非 null。

input
object
必填
output
object
必填

各模式共享的规范化字段,适用于所有平台。原生输出保留在 Run 中,可通过 GET /v1/runs/:id 读取。平台或数据提供商未报告的值为 null。

  • profile: platform, handle, name, url, bio, headline, website, followers, following, posts, verified
  • search: items[]: id, url, title, text, author, author_url, published_at, likes, comments, shares, views
  • feed: items[]: 与 search 相同的帖子字段
  • post: id, url, title, text, author, author_url, published_at, likes, comments, shares, views
  • find: profiles[]: platform, url, handle, scrapecreators_confidence, followers ,Reddit 为匹配版块; pdl_likelihood
provider_response
object | null
必填

仅在 status 为 COMPLETED 时非 null。

  • 2xx 响应:output 为任意结构的数据提供商原生 JSON;正文为空时为 null。
  • 非 2xx 响应:error 包含数据提供商错误正文,output 为 null。

两种正文均会移除敏感字段。

charge_usd
string | null
必填

此 Solution 响应所含 runs 的总费用,全部 Run 结算前为 null。每个 Run 保留各自费用;失败也可能收费。

Pattern: ^(0|[1-9]\d*)\.(\d{2}|\d{2}\d{0,3}[1-9])$
charge_basis
object | null
必填

单个 Run 的计费依据;多个 Run 汇总时为 null。各项费用请查看 runs[].charge_basis。

stoppable
boolean
必填

当前是否可接受停止请求。不保证能在分派前停止 Run。

stop_requested_at
string<date-time> | null
必填

请求停止的时间。如果已开始分派,Run 仍可能继续。

created_at
string<date-time>
必填

ISO 8601 UTC 时间戳。

started_at
string<date-time> | null
必填

ISO 8601 UTC 时间戳。

completed_at
string<date-time> | null
必填

ISO 8601 UTC 时间戳。

task_id
string | null
必填
metadata
object
必填

已保存的追踪字段,可用于筛选 Run,不发送给数据提供商,不影响路由、价格或幂等。

  • 最多 20 个键:小写字母、数字和下划线,以字母开头,最长 40 个字符。
  • 值:长度为 1–500 的字符串。
  • user_id:终端用户的不透明 ID,不得使用邮箱或姓名。
action
string
必填

<platform>.<mode>;profile 模式下的 LinkedIn 公司页面为 linkedin.company。

Pattern: ^[a-z]+\.[a-z]+$
result_status
enum<string>
必填

业务交付状态,与 status 中的最终 Run 生命周期独立。no_result 为有效空结果;error 表示数据提供商输出无法交付。

可用选项:
success,
no_result,
error,
pending
error
object | null
必填
runs
object[]
必填
result_url
string
必填

通过认证读取规范化结果和总费用的只读 URL 路径,配合 API 服务地址使用。不创建 Run,也不恢复切换。GET /v1/runs/:id 仍返回原生单个 Run。