获取详情

简介

POST /v1/generations;请求头 Authorization: Bearer <ANYCAP_API_KEY>。固定 type=social,通过 model 选择平台、input.operation 选择查询内容,其余参数见下表及示例。

平台查询内容modelinput.operation
Instagram作品详情instagrampost
TikTok作品详情tiktokvideo
TikTokApp 作品详情tiktokapp_video
抖音作品详情douyindouyin_video
小红书图文笔记xiaohongshuimage_note
小红书视频笔记xiaohongshuvideo_note
微信公众号文章详情wechat_mparticle

Instagram · 作品详情

用帖子链接获取一条 Instagram 公开帖子、Reel 或 TV 详情。传 type: social、model: instagram、input.operation: post 和帖子链接。

请求

BASH
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
填写social
说明必填
model
填写instagram
说明必填
input.operation
填写post
说明必填;选择帖子详情而不是达人资料
input.url
填写Instagram 帖子链接
说明必填;instagram.com 的 /p/、/reel/ 或 /tv/ 页面;也接受 input.post_url 别名
Idempotency-Key
填写唯一键
说明推荐;新获取用新键,重试沿用原键

个人主页、快拍、探索和分享页链接会在上游调用前被拒绝。返回是同步的。

接入密钥必须被授权使用 social.instagram.post.info;未授权会在上游调用前返回 503 capability_unavailable,不会扣费。

返回

JSON
{  "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响应处理
200call.state=succeeded读取 call.post;已结算费用。
202call.state=started / unknown保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新获取。
402error.code=insufficient_credits积分不足;补充积分后重试,本次没有提交或扣费。
404 / 502 / 503error.code不扣客户费用;错误码为 post_not_found、upstream_error 或 capability_unavailable(能力暂停、未配置或密钥未授权)。

TikTok · 作品详情

用作品链接获取一条 TikTok 公开作品。图文返回全部图片 call.post.image_urls;视频返回播放与下载直链。

请求

BASH
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
填写social
说明必填
model
填写tiktok
说明必填
input.url
填写TikTok 作品链接
说明必填;支持 tiktok.com 及分享短链
Idempotency-Key
填写唯一键
说明推荐;新查询用新键,重试沿用原键

input.operation 可省略,默认 video。

返回 · 图文作品

JSON
{  "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响应处理
200call.state=succeeded读取 call.post;已结算费用。
202call.state=started / unknown保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。
402error.code=insufficient_credits积分不足;补充积分后重试,本次没有提交或扣费。
404 / 502 / 503error.code不扣客户费用;错误码为 video_not_found、upstream_error 或 capability_unavailable。

同一幂等键复用原结果,来源停用后仍可读取;结果查询使用原接入密钥。

TikTok · App 作品详情

用作品链接获取一条 TikTok 公开作品(App 数据源)。input.operation 填写 app_video。图文返回全部图片 call.post.image_urls;视频返回播放与下载直链。

请求

BASH
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
填写social
说明必填
model
填写tiktok
说明必填
input.operation
填写app_video
说明必填
input.url
填写TikTok 作品链接
说明必填;支持 tiktok.com 及分享短链
Idempotency-Key
填写唯一键
说明推荐;新查询用新键,重试沿用原键

返回 · 图文作品

JSON
{  "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响应处理
200call.state=succeeded读取 call.post;已结算费用。
202call.state=started / unknown保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。
402error.code=insufficient_credits积分不足;补充积分后重试,本次没有提交或扣费。
404 / 502 / 503error.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 可选返回地理位置、商户、商品橱窗等锚点。返回文案、作者、封面、视频播放地址、时长、分辨率与互动数据。

请求

BASH
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
取值social
说明必填
model
取值douyin
说明必填
input.operation
取值douyin_video
说明必填,选择抖音 Web 作品接口
input.aweme_id
取值19 位作品 ID
说明与 input.url 二选一;同时传入时优先使用 ID
input.url
取值抖音作品链接
说明douyin.com/video/... 或 iesdouyin.com/share/video/...;不支持短链
input.need_anchor_info
取值true / false
说明可选,默认 false;开启锚点可能变慢
Idempotency-Key
取值唯一键
说明建议每次新请求使用新键,重试沿用同一个键

返回

JSON
{  "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 并保留 filter_detail,且正常计费。Anycap 会映射为 video_not_found、客户不扣费,但上游这次查询已经消耗。

错误

HTTP响应处理方式
200call.state=succeeded读取 call.post,扣费已结算。
202call.state=started / unknown保留 call.id,用原接入密钥查询 GET /v1/generations/{id};不要重新提交。
402error.code=insufficient_credits补充积分后重试;本次未提交、未扣费。
404 / 502 / 503error.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 接口,不包含网页版笔记接口。

请求

BASH
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
填写social
说明必填
model
填写xiaohongshu
说明必填
input.operation
填写image_note 或 video_note
说明省略时按 image_note 执行
input.note_id
填写24 位笔记 ID
说明与 input.url 二选一;同时传入会被拒绝
input.url
填写笔记链接或分享链接
说明支持 xiaohongshu.com 笔记链接、xhslink.com 与 xhslink.cn 分享链接
Idempotency-Key
填写唯一键
说明推荐;新查询用新键,重试沿用原键

返回

JSON
{  "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 为准,重复查询不续期。

视频笔记

BASH
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响应处理
200call.state=succeeded读取 call.note;已结算费用。
202call.state=started / unknown保留 call.id,用原接入密钥读取 GET /v1/generations/{id};不要发起新查询。
402error.code=insufficient_credits积分不足;补充积分后重试,本次没有提交或扣费。
404 / 502 / 503error.code不扣客户费用;错误码为 note_not_found(笔记不存在、未公开或类型不符)、upstream_error 或 capability_unavailable。

同一幂等键复用原结果,来源停用后仍可读取;结果查询使用原接入密钥。

微信公众号 · 文章详情

步骤方法和路径响应
发现已授权操作GET /v1/generations/models?type=social200;选择model=wechat_mp、operation=article
读取文章POST /v1/generations200为成功,202为started/unknown
读取已保存记录GET /v1/generations/{call.id}200,仍检查call.state

输入公开的微信公众号文章链接,通过 H5 文章详情操作获取正文与元信息。

JSON
{  "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
说明必填,HTTPS mp.weixin.qq.com/s/文章短链或带__biz的/s长链;最长2048个UTF-8字节,不含fragment或登录凭据
input.operationstring
说明article(默认)
input.rawboolean
说明默认true,content内保留返回的额外元信息,具体字段随文章形态而定

成功结果为 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 小时。查询历史或重放原请求不延长。
statusready:可下载;unavailable:无保存副本或传输/签名失败;expired:已到期。后两种状态不返回 download_url。

请直接 GET 完整的 download_url,不拼接 API 域名、不修改签名参数、不改用 HEAD,也不附加 Anycap Authorization 请求头。持有链接的人可在到期前下载,请妥善保管。2 小时有效期适用于保存后的下载链接,不适用于原始 source_url。图片保存失败不改变文章详情的成功结果。

BASH
# 将 ready 项的完整 download_url 赋给 DOWNLOAD_URL。curl --fail "$DOWNLOAD_URL" --output article-image.jpg

成功响应(示例链接)

JSON
{  "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。

上一篇获取主页
下一篇获取评论