Pull

企业主动拉

企业研发使用管理端生成的 ZSK_API_KEY,以企业身份调用/open-api/* 读取达人、任务与同步运行记录。

鉴权

所有真实接口都需要请求头:

GET /open-api/bloggers/changes?since=2026-05-01T00:00:00.000Z&limit=500
Host: api.zishutonggao.com
X-API-Key: zsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

API Key 由企业 Owner 在管理端「企业管理 → API Key」生成。明文只在创建或重置时展示一次, 后端仅保存不可逆 hash。

数据模式

主动拉只支持 CLOUD。企业为 LOCAL 时,所有 /open-api/* 都返回 403。
{
  "code": 403,
  "message": "开启云端共享数据模式后可用"
}

主动推 Webhook 不受 dataMode 限制,二者是独立能力。

Cursor 分页

列表类接口返回 itemsnextCursorhasMore。 客户端应在 hasMore = true 时带上 cursor 继续请求。

{
  "items": [],
  "nextCursor": "eyJzb3J0S2V5Ijoi...",
  "hasMore": true
}

当前限流为单 Key 60 req/min,响应头包含 X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset

增量同步

推荐使用 GET /open-api/bloggers/changes,用 since 固定本轮窗口, 用 cursor 翻页,整轮成功后再推进客户系统自己的本地水位。

let cursor = null;
const since = await loadLocalWatermark();

do {
  const url = new URL('https://api.zishutonggao.com/open-api/bloggers/changes');
  url.searchParams.set('since', since);
  url.searchParams.set('limit', '500');
  if (cursor) url.searchParams.set('cursor', cursor);

  const page = await fetch(url, { headers: { 'X-API-Key': process.env.ZSK_API_KEY } });
  const body = await page.json();
  await upsertBloggers(body.data.items);
  cursor = body.data.nextCursor;
} while (cursor);

接口清单

MethodPath说明
GET/open-api/organizations/self自查企业信息、dataMode 与本次配额
GET/open-api/bloggers达人列表,支持 platform、fansCount、tags、category、updatedSince 过滤
GET/open-api/bloggers/:id达人详情,含 priceJson 与 rawData
GET/open-api/bloggers/changes增量变更流,推荐用于定时同步
GET/open-api/bloggers/:id/stats达人所属平台统计快照
GET/open-api/scraping-tasks采集任务列表
GET/open-api/scraping-tasks/:id采集任务详情
GET/open-api/scraping-tasks/:id/runs采集任务运行历史
GET/open-api/sync-runs主动推运行记录
GET/open-api/sync-runs/:id单次推送详情,含 failedBloggerIds