AB Answerbit

AI-Answers API

DataForSEO 式的异步任务制 API。抓取开启联网后的真实答案与引用来源。

模型状态 Live / Pending

API 接受全部 5 个模型入队,但当前仅 DeepSeek / Kimi 端到端跑通;其余被平台反爬阻断(platform anti-bot),入队后会停留在 pending。监测 Cron 仅采集 live 模型。

模型状态说明
豆包 Doubao doubaopendingplatform anti-bot
元宝 Yuanbao yuanbaopendingplatform anti-bot
DeepSeek deepseeklive已跑通(auth 模式,联网+引用)
Kimi kimilive已跑通(auth 模式,联网+引用)
千问 Qwen qwenpendingplatform anti-bot

鉴权

每个请求带 Authorization: Bearer <ab_key>(也支持 HTTP Basic,key 放 login 或 password 均可)。 key 以 sha-256 存储,服务端常数时间比对。

curl -H "Authorization: Bearer ab_xxx" https://answerbit.rushos.com/v3/ai/answers/tasks_ready

提交任务

POST/v3/ai/answers/task_post

批量提交(最多 100 条)。入队时按「模型 × 是否联网」预扣 credits,任务入队失败自动退款。

POST https://answerbit.rushos.com/v3/ai/answers/task_post
Authorization: Bearer ab_xxx
Content-Type: application/json

[
  { "model": "doubao", "prompt": "best noise cancelling headphones",
    "web_search": true, "location": "cn", "tag": "hp-q3",
    "pingback_url": "https://you.example.com/hook" }
]

-> { "ok": true, "cost": 1.5, "tasks_count": 1,
     "tasks": [ { "id": "uuid", "model": "doubao", "tag": "hp-q3",
                  "status": "queued", "cost": 1.5 } ] }

轮询已完成

GET/v3/ai/answers/tasks_ready
GET https://answerbit.rushos.com/v3/ai/answers/tasks_ready?limit=100
-> { "ok": true, "tasks_count": 2, "tasks": [ { "id": "uuid", "model": "doubao", "status": "done", ... } ] }

取结果

GET/v3/ai/answers/task_get/{id}
GET https://answerbit.rushos.com/v3/ai/answers/task_get/<id>
-> {
  "ok": true, "id": "uuid", "model": "doubao", "prompt": "...", "status": "done",
  "answer_markdown": "...",
  "citations": [ { "rank": 1, "title": "...", "url": "https://...", "domain": "example.com", "snippet": "..." } ],
  "brand_mentions": { ... }, "raw": { ... }, "latency_ms": 4210, "tier": "tier1", "ts": "..."
}

同步 (live)

POST/v3/ai/answers/live

单条高优先级提交,服务端最多等待约 60s。完成返回 200(结果 shape 同 task_get);超时返回 202 带任务 id,改用轮询取回。

POST https://answerbit.rushos.com/v3/ai/answers/live
{ "model": "deepseek", "prompt": "top CRM tools 2026", "web_search": true }

监测与内容 API(owner-scoped)

以下接口按 key 的 owner 归属隔离,供 项目 / 分析 / 优化 页面使用。

POST/v3/projects GET
POST https://answerbit.rushos.com/v3/projects
{ "name": "brand watch", "brands": ["Answerbit", {"name":"RushOS","aliases":["rush os"]}],
  "competitors": ["Peec"], "models": ["deepseek","kimi"] }
GET  https://answerbit.rushos.com/v3/projects            # 列出本 owner 的项目
GET/v3/projects/{id}
POST/v3/projects/{id}/prompts GET
POST https://answerbit.rushos.com/v3/projects/<id>/prompts
{ "prompt": "best AI search visibility tools", "models": ["deepseek","kimi"], "schedule": "daily" }
POST/v3/analyze/summary

用 clssai 归纳「AI 如何描述品牌 + 情感 + 主题聚类」,读取本 owner 的 ab_runs。可选 { "project_id": <id> }。

POST/v3/optimize
POST https://answerbit.rushos.com/v3/optimize
{ "brand": "Answerbit", "topic": "中国 AI 搜索可见性监测" }
-> { "ok": true, "content": "# ...markdown...", "references": { "domains": [...], "urls": [...] } }

采集调度:CF Cron([triggers].crons)在 AB_CRON_ENABLED=true 且 Fly 引擎在线时, 每天为活跃 tracked prompt 入队 deepseek / kimi 任务并聚合为 ab_runs。

Pingback

WP6 任务完成后向 pingback_url 回调(对齐 DataForSEO)。当前采集引擎直接写 ab_results;回调由后续 Cron watcher 触发,字段已预留。

错误

状态error含义
401missing_api_key / invalid_api_key缺少或无效 key
403key_disabledkey 已停用
400invalid_model / missing_prompt / invalid_json请求体校验失败
402insufficient_credits余额不足(附 needed / available)
429rate_limited超过每分钟限额(附 Retry-After)