获取详情
简介
POST /v1/generations;请求头 Authorization: Bearer <ANYCAP_API_KEY>。固定 type=social,通过 model 选择平台、input.operation 选择查询内容,其余参数见下表及示例。
| 平台 | 查询内容 | model | input.operation |
|---|---|---|---|
| 作品详情 | instagram | post | |
| TikTok | 作品详情 | tiktok | video |
| TikTok | App 作品详情 | tiktok | app_video |
| 抖音 | 作品详情 | douyin | douyin_video |
| 小红书 | 图文笔记 | xiaohongshu | image_note |
| 小红书 | 视频笔记 | xiaohongshu | video_note |
| 微信公众号 | 文章详情 | wechat_mp | article |
Instagram · 作品详情
用帖子链接获取一条 Instagram 公开帖子、Reel 或 TV 详情。传 type: social、model: instagram、input.operation: post 和帖子链接。
请求
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 5b1d7e2a-8c34-4f6d-9a0e-2d7c4b6f8a13" \ -d '{"type":"social","model":"instagram","input":{"operation":"post","url":"https://www.instagram.com/p/DPwhVB-jo9k/"}}'type
socialmodel
instagraminput.operation
postinput.url
instagram.com 的 /p/、/reel/ 或 /tv/ 页面;也接受 input.post_url 别名Idempotency-Key
个人主页、快拍、探索和分享页链接会在上游调用前被拒绝。返回是同步的。
接入密钥必须被授权使用 social.instagram.post.info;未授权会在上游调用前返回 503 capability_unavailable,不会扣费。
返回
{ "type": "social", "call": { "id": "5b1d7e2a-8c34-4f6d-9a0e-2d7c4b6f8a13", "state": "succeeded", "operation": "post", "url": "https://www.instagram.com/p/DPwhVB-jo9k/", "amount_microcredits": "9000000", "charged_microcredits": "9000000", "created_at": "2026-10-28T03:25:00Z", "completed_at": "2026-10-28T11:25:06+08:00", "post": { "id": "3742637871112032100", "shortcode": "DPwhVB-jo9k", "media_type": "image", "description": "I’ll never forget how excited I was in 2006 …", "cover_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/562815025_18601398793054956_8673755740587648163_n.jpg", "play_url": "", "download_url": "", "width": 1080, "height": 1080, "created_at": 1760377223, "author": { "id": "11830955", "username": "taylorswift", "nickname": "Taylor Swift", "avatar_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/811102599_18700319776054956_6854910356429154091_n.jpg" }, "digg_count": 3861440 }, "media_downloads": [ { "field": "post.cover_url", "source_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/562815025_18601398793054956_8673755740587648163_n.jpg", "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "expires_at": "2026-10-28T05:25:06Z", "status": "ready" } ] }}call.post 包含帖子 ID 与 shortcode、media_type(image、video 或 carousel)、文案、封面、作者、发布时间、尺寸及 Instagram 实际提供的互动计数。轮播帖子会返回按序的 image_urls,视频/Reel 会返回 play_url;缺失的计数、尺寸和时长不返回,单图帖子没有 image_urls。媒体链接是 Instagram 的临时 CDN 地址。
call.media_downloads 提供 Anycap 下载链接,原始第三方链接保留。仅 status=ready 时可免 API Key 下载;有效期为 call.completed_at 后 2 小时,以 expires_at 为准,重复查询不续期。
错误
| HTTP | 响应 | 处理 |
|---|---|---|
| 200 | call.state=succeeded | 读取 call.post;已结算费用。 |
| 202 | call.state=started / unknown | 保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新获取。 |
| 402 | error.code=insufficient_credits | 积分不足;补充积分后重试,本次没有提交或扣费。 |
| 404 / 502 / 503 | error.code | 不扣客户费用;错误码为 post_not_found、upstream_error 或 capability_unavailable(能力暂停、未配置或密钥未授权)。 |
TikTok · 作品详情
用作品链接获取一条 TikTok 公开作品。图文返回全部图片 call.post.image_urls;视频返回播放与下载直链。
请求
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 8d0b2e44-9c52-4b5f-8a1d-3f6c7e9a0b21" \ -d '{"type":"social","model":"tiktok","input":{"url":"https://www.tiktok.com/@example_creator/photo/7000000000000000000"}}'type
socialmodel
tiktokinput.url
tiktok.com 及分享短链Idempotency-Key
input.operation 可省略,默认 video。
返回 · 图文作品
{ "type": "social", "call": { "id": "8d0b2e44-9c52-4b5f-8a1d-3f6c7e9a0b21", "state": "succeeded", "operation": "video", "amount_microcredits": "4000000", "charged_microcredits": "4000000", "created_at": "2026-10-26T10:00:00Z", "post": { "id": "7000000000000000000", "cover_url": "https://cdn.example.com/cover.jpg", "image_urls": [ "https://cdn.example.com/1.jpg", "https://cdn.example.com/2.jpg", "https://cdn.example.com/3.jpg" ] }, "completed_at": "2026-10-26T10:00:00Z", "media_downloads": [ { "field": "post.image_urls[0]", "source_url": "https://cdn.example.com/1.jpg", "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "expires_at": "2026-10-26T12:00:00Z", "status": "ready" } ] }}image_urls 按作品顺序排列,每张图一条链接(最多 100 张)。视频作品可返回 play_url、download_url。文案、作者、互动计数按上游实际数据提供;缺失计数和尺寸不返回。
call.media_downloads 提供 Anycap 下载链接,原始第三方链接保留。仅 status=ready 时可免 API Key 下载;有效期为 call.completed_at 后 2 小时,以 expires_at 为准,重复查询不续期。
错误
| HTTP | 响应 | 处理 |
|---|---|---|
| 200 | call.state=succeeded | 读取 call.post;已结算费用。 |
| 202 | call.state=started / unknown | 保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。 |
| 402 | error.code=insufficient_credits | 积分不足;补充积分后重试,本次没有提交或扣费。 |
| 404 / 502 / 503 | error.code | 不扣客户费用;错误码为 video_not_found、upstream_error 或 capability_unavailable。 |
同一幂等键复用原结果,来源停用后仍可读取;结果查询使用原接入密钥。
TikTok · App 作品详情
用作品链接获取一条 TikTok 公开作品(App 数据源)。input.operation 填写 app_video。图文返回全部图片 call.post.image_urls;视频返回播放与下载直链。
请求
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 8d0b2e44-9c52-4b5f-8a1d-3f6c7e9a0b21" \ -d '{"type":"social","model":"tiktok","input":{"operation":"app_video","url":"https://www.tiktok.com/@example_creator/photo/7000000000000000000"}}'type
socialmodel
tiktokinput.operation
app_videoinput.url
tiktok.com 及分享短链Idempotency-Key
返回 · 图文作品
{ "type": "social", "call": { "id": "8d0b2e44-9c52-4b5f-8a1d-3f6c7e9a0b21", "state": "succeeded", "operation": "app_video", "amount_microcredits": "4000000", "charged_microcredits": "4000000", "created_at": "2026-10-26T10:00:00Z", "post": { "id": "7000000000000000000", "cover_url": "https://cdn.example.com/cover.jpg", "image_urls": [ "https://cdn.example.com/1.jpg", "https://cdn.example.com/2.jpg", "https://cdn.example.com/3.jpg" ] }, "completed_at": "2026-10-26T10:00:00Z", "media_downloads": [ { "field": "post.image_urls[0]", "source_url": "https://cdn.example.com/1.jpg", "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "expires_at": "2026-10-26T12:00:00Z", "status": "ready" } ] }}image_urls 按作品顺序排列,每张图一条链接(最多 100 张)。视频作品可返回 play_url、download_url。文案、作者、互动计数按上游实际数据提供;缺失计数和尺寸不返回。
call.media_downloads 提供 Anycap 下载链接,原始第三方链接保留。仅 status=ready 时可免 API Key 下载;有效期为 call.completed_at 后 2 小时,以 expires_at 为准,重复查询不续期。
错误
| HTTP | 响应 | 处理 |
|---|---|---|
| 200 | call.state=succeeded | 读取 call.post;已结算费用。 |
| 202 | call.state=started / unknown | 保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。 |
| 402 | error.code=insufficient_credits | 积分不足;补充积分后重试,本次没有提交或扣费。 |
| 404 / 502 / 503 | error.code | 不扣客户费用;错误码为 video_not_found、upstream_error 或 capability_unavailable。 |
同一幂等键复用原结果,来源停用后仍可读取;结果查询使用原接入密钥。
抖音 · 作品详情
通过抖音 Web 数据源(fetch_one_video)读取单条公开作品。传 19 位 input.aweme_id,或规范的 douyin.com/video / iesdouyin.com/share/video 链接(数字 ID 在本地提取,不会额外产生解析调用);v.douyin.com 短链会被拒绝。input.need_anchor_info 可选返回地理位置、商户、商品橱窗等锚点。返回文案、作者、封面、视频播放地址、时长、分辨率与互动数据。
请求
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 8c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f" \ -d '{"type":"social","model":"douyin","input":{"operation":"douyin_video","aweme_id":"7372484719365098803"}}'type
socialmodel
douyininput.operation
douyin_videoinput.aweme_id
input.url 二选一;同时传入时优先使用 IDinput.url
douyin.com/video/... 或 iesdouyin.com/share/video/...;不支持短链input.need_anchor_info
true / falsefalse;开启锚点可能变慢Idempotency-Key
返回
{ "type": "social", "call": { "id": "8c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f", "state": "succeeded", "operation": "douyin_video", "aweme_id": "7372484719365098803", "amount_microcredits": "2000000", "charged_microcredits": "2000000", "created_at": "2026-11-02T03:20:00Z", "post": { "id": "7372484719365098803", "description": "你对我的好我一直记得", "cover_url": "https://p3-pc-sign.douyinpic.com/example-cover.jpg", "play_url": "https://v3-web.douyinvod.com/example-video.mp4", "duration_ms": 8010, "width": 1080, "height": 1920, "created_at": 1716540374, "author": { "id": "95823111667", "username": "L99612", "nickname": "萧萧不吃辣", "avatar_url": "https://p3-pc.douyinpic.com/example-avatar.jpg" }, "digg_count": 312986, "comment_count": 4071, "share_count": 79966, "collect_count": 19911 } }}call.post.play_url 是视频直链;媒体链接为抖音临时 CDN 地址。传作品 ID 时返回 call.aweme_id;传链接时也会带上本地提取的 ID。平台未提供的计数、时长与分辨率会省略。
错误
| HTTP | 响应 | 处理方式 |
|---|---|---|
| 200 | call.state=succeeded | 读取 call.post,扣费已结算。 |
| 202 | call.state=started / unknown | 保留 call.id,用原接入密钥查询 GET /v1/generations/{id};不要重新提交。 |
| 402 | error.code=insufficient_credits | 补充积分后重试;本次未提交、未扣费。 |
| 404 / 502 / 503 | error.code | 不扣客户费用。错误码:video_not_found、upstream_error、capability_unavailable。 |
小红书 · 图文笔记
用笔记链接或笔记 ID 获取一条小红书公开笔记(小红书 App 接口 app/v2)。input.operation 选择笔记接口:image_note(默认)可读取两种笔记,但视频笔记只返回封面图;video_note 读取视频笔记并返回播放地址。笔记 type 为 video 时,用同一笔记 ID 再调用 video_note 取得 call.note.play_url。本能力只暴露 App 接口,不包含网页版笔记接口。
请求
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 8d0b2e44-9c52-4b5f-8a1d-3f6c7e9a0b21" \ -d '{"type":"social","model":"xiaohongshu","input":{"operation":"image_note","note_id":"697c0eee000000000a03c308"}}'type
socialmodel
xiaohongshuinput.operation
image_note 或 video_noteimage_note 执行input.note_id
input.url 二选一;同时传入会被拒绝input.url
xiaohongshu.com 笔记链接、xhslink.com 与 xhslink.cn 分享链接Idempotency-Key
返回
{ "type": "social", "call": { "id": "5c4a1d2e-9f3b-4a6c-8d7e-1b2c3d4e5f60", "state": "succeeded", "operation": "image_note", "note_id": "697c0eee000000000a03c308", "amount_microcredits": "11000000", "charged_microcredits": "11000000", "created_at": "2026-10-30T08:00:00Z", "note": { "id": "697c0eee000000000a03c308", "type": "normal", "title": "秋日通勤穿搭", "description": "通勤三件套,配色参考。", "cover_url": "https://sns-webpic-qc.xhscdn.com/cover.jpg", "image_urls": [ "https://sns-webpic-qc.xhscdn.com/1.jpg", "https://sns-webpic-qc.xhscdn.com/2.jpg" ], "created_at": 1759718400, "author": { "id": "5f0000000000000000000001", "nickname": "示例作者", "avatar_url": "https://sns-avatar-qc.xhscdn.com/avatar.jpg" }, "digg_count": 12000, "collect_count": 3456, "comment_count": 78 }, "completed_at": "2026-10-30T08:00:01Z", "media_downloads": [ { "field": "note.image_urls[0]", "source_url": "https://sns-webpic-qc.xhscdn.com/1.jpg", "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "expires_at": "2026-10-30T10:00:00Z", "status": "ready" } ] }}note.type 为 normal(图文)或 video(视频)。note.image_urls 按笔记顺序排列,每张图一条链接(最多 100 张)。只有 video_note 读取时才会返回 note.play_url。互动计数、时长与尺寸按平台实际数据提供;1.2万 这类紧凑计数会展开为整数。
call.media_downloads 提供 Anycap 下载链接,原始第三方链接保留。仅 status=ready 时可免 API Key 下载;有效期为 call.completed_at 后 2 小时,以 expires_at 为准,重复查询不续期。
视频笔记
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 6b1f4c7e-2a3d-4e5f-8a9b-0c1d2e3f4a5b" \ -d '{"type":"social","model":"xiaohongshu","input":{"operation":"video_note","url":"http://xhslink.com/o/8GqargIxrko"}}'video_note 接受同样的 note_id 与 url,返回 call.note.play_url 和封面图。图文笔记无法用 video_note 读取,这是小红书官方限制,不是 Anycap 的限制。
错误
| HTTP | 响应 | 处理 |
|---|---|---|
| 200 | call.state=succeeded | 读取 call.note;已结算费用。 |
| 202 | call.state=started / unknown | 保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。 |
| 402 | error.code=insufficient_credits | 积分不足;补充积分后重试,本次没有提交或扣费。 |
| 404 / 502 / 503 | error.code | 不扣客户费用;错误码为 note_not_found(笔记不存在、未公开或类型不符)、upstream_error 或 capability_unavailable。 |
同一幂等键复用原结果,来源停用后仍可读取;结果查询使用原接入密钥。
微信公众号 · 文章详情
| 步骤 | 方法和路径 | 响应 |
|---|---|---|
| 发现已授权操作 | GET /v1/generations/models?type=social | 200;选择model=wechat_mp、operation=article |
| 读取文章 | POST /v1/generations | 200为成功,202为started/unknown |
| 读取已保存记录 | GET /v1/generations/{call.id} | 200,仍检查call.state |
输入公开的微信公众号文章链接,通过 H5 文章详情操作获取正文与元信息。
{ "type": "social", "model": "wechat_mp", "input": { "operation": "article", "url": "https://mp.weixin.qq.com/s/ARTICLE", "raw": true }}向 POST /v1/generations 发送请求,使用 Authorization: Bearer 连接密钥、Content-Type: application/json 与唯一的 Idempotency-Key。
input.urlstring
input.operationstring
input.rawboolean
成功结果为 call.article,包含 url、bizUin、itemIdx、content。常用字段为 content.title、author、nick_name、cdn_url、create_time、content_text、content_noencode、source_url 与 _content_type。mid、comment_id 等 ID 始终返回字符串,请保持字符串传递。content_noencode 是未经信任的 HTML,展示前必须净化。
正文图片为 call.article.image_urls,封面为 call.article.cover_url。call.media_downloads 中每项包含 field(如 article.image_urls[0])、status、download_url、expires_at。ready 图片提供私有签名下载链接,有效期固定到查询完成后 2 小时,重复读取不延长;expired 或 unavailable 不返回下载地址。文章提取至少预留 30 秒,包含图片保存时建议客户端超时设置为 120 秒。本接口不返回阅读统计和评论列表。raw=false 仅减少 content 内的元信息,顶层结构相同。形态包括 article、immersive、video、unknown;非经典图文的 HTML 可能为空。
图片下载字段
| 返回字段 | 说明 |
|---|---|
| call.article.cover_url / image_urls | 规范化后的原始图片链接;下载已保存的图片请使用 media_downloads。 |
| call.media_downloads[].field | 相对 call 的字段路径,例如 article.cover_url 或 article.image_urls[0],数组下标从 0 开始。 |
| source_url | 原平台图片地址,与平台保存后的下载链接分开返回。 |
| download_url | 保存后的图片私有签名 GET 链接,仅 ready 返回;下载域名可能与 API 域名不同。 |
| expires_at | 固定 UTC 到期时间,最晚为 call.completed_at 后 2 小时。查询历史或重放原请求不延长。 |
| status | ready:可下载;unavailable:无保存副本或传输/签名失败;expired:已到期。后两种状态不返回 download_url。 |
请直接 GET 完整的 download_url,不拼接 API 域名、不修改签名参数、不改用 HEAD,也不附加 Anycap Authorization 请求头。持有链接的人可在到期前下载,请妥善保管。2 小时有效期适用于保存后的下载链接,不适用于原始 source_url。图片保存失败不改变文章详情的成功结果。
# 将 ready 项的完整 download_url 赋给 DOWNLOAD_URL。curl --fail "$DOWNLOAD_URL" --output article-image.jpg成功响应(示例链接)
{ "type": "social", "call": { "id": "8b8ab1ac-20ae-4d2a-8323-09d33a0f0540", "state": "succeeded", "operation": "article", "url": "https://mp.weixin.qq.com/s/ARTICLE", "article": { "url": "https://mp.weixin.qq.com/s/ARTICLE", "bizUin": 123456, "itemIdx": 1, "cover_url": "https://images.example.invalid/cover.jpg", "image_urls": [ "https://images.example.invalid/illustration.jpg" ], "content": { "title": "Example article", "nick_name": "Example account", "author": "Example author", "create_time": "2026-11-09 10:00", "content_text": "Example article text.", "_content_type": "article", "mid": "12345678901234567890", "comment_id": "9007199254740993" } }, "media_downloads": [ { "field": "article.cover_url", "source_url": "https://images.example.invalid/cover.jpg", "download_url": "https://downloads.example.invalid/cover.jpg?X-Amz-Date=20261109T020000Z&X-Amz-Expires=7200&X-Amz-Signature=EXAMPLE", "expires_at": "2026-11-09T04:00:00Z", "status": "ready" }, { "field": "article.image_urls[0]", "source_url": "https://images.example.invalid/illustration.jpg", "download_url": "https://downloads.example.invalid/illustration.jpg?X-Amz-Date=20261109T020000Z&X-Amz-Expires=7200&X-Amz-Signature=EXAMPLE", "expires_at": "2026-11-09T04:00:00Z", "status": "ready" } ], "amount_microcredits": "12000000", "charged_microcredits": "12000000", "created_at": "2026-11-09T01:59:48Z", "completed_at": "2026-11-09T02:00:00Z" }}HTTP 202 表示started或unknown,通过GET /v1/generations/{call.id}查询。GET读取已有记录返回HTTP 200,仍须检查call.state:succeeded、started、unknown或failed。unknown表示待核对,不代表后台会自动重试;恢复请求应沿用原幂等键。HTTP 404及article_not_found表示未找到文章或不可访问,错误响应使用error结构而非call。