API Docs
Includes only “Submit extract task” and “Query task status/result”
Professional Only
API 调用仅向专业版会员开放
标准版会员可以浏览文档,但创建 API Key 和调用开放接口需要先升级为专业版。
创建并管理 API Key
API Key 与 API Secret 用于服务端请求鉴权,请勿放入网页前端或公开仓库。
- 1开通专业版API 能力仅对专业版会员开放,请先确认账号的会员版本。
- 2创建密钥进入 API Key 管理页,填写密钥名称并点击创建或重新生成。
- 3安全保存复制 API Key 与 API Secret;Secret 仅在创建成功时完整展示。
Base Info
Base URL:https://api.anytocopy.com/vip/open-api/v1
If your gateway does not use the /prod-api prefix, adjust the Base URL accordingly.
Auth Headers
X-API-Key: your_api_key
X-API-Secret: your_api_secret Python 示例项目 ZIP
Python 调用示例下载
提供完整的 Python Open API 示例项目,包含视频文案提取与图片文案提取示例。 打开脚本后可直接在 main() 中修改变量,方便本地调试。
Submit video text extraction task
Submit a work URL and create a task, returns taskId for later query
Endpoint
https://api.anytocopy.com/vip/open-api/v1/video/extract
Parameters
- workUrl:Work URL (Xiaohongshu, Kuaishou, etc.)
curl example
curl -X POST 'https://api.anytocopy.com/vip/open-api/v1/video/extract?workUrl=https://example.com/video/xxx&taskType=TEXT' \
-H 'X-API-Key: your_api_key' \
-H 'X-API-Secret: your_api_secret'Response Example
1. Success
{
"msg": "任务已提交",
"code": 200,
"data": "2008802706718072832"
}2. Failed
{
"msg": "您的并发任务已达上限(5/5),请等待任务完成后再试",
"code": 500
}Query task status and result
Query progress and result by taskId
Endpoint
https://api.anytocopy.com/vip/open-api/v1/video/query
Parameters
- taskId:Task ID
Task status: WAITING / PROCESSING / SUCCESS / FAILED
curl example
curl -X GET 'https://api.anytocopy.com/vip/open-api/v1/video/query?taskId=1734422400000001' \
-H 'X-API-Key: your_api_key' \
-H 'X-API-Secret: your_api_secret'Response Example
1. Task Completed
{
"msg": "操作成功",
"code": 200,
"data": {
"taskId": "2008802706718072832",
"title": "小个子女生如何逆袭第一眼大美女",
"content": "#听劝改造[话题]# #如何找到自己的风格",
"videoUrl": "https://sns-video-bd.xhscdn.com/f0370019b934b9b6e_258.mp4",
"videoUrlList": [
"https://sns-video-bd.xhscdn.com/stream/79258.mp4"
],
"imageUrlList": [
"https://ci.xiaohongshu.com/1040g2sg31r0hdqhjnge05q"
],
"cover": "https://ci.xiaohongshu.com/1040g2sg31r0hdqhjnge05",
"textContent": "小个子女生真的不要再和别人卷身高上的天赋...",
"platform": "xhs",
"audioUrl": "https://pub-6026ae78487b47e5bd4a5b8a0d9ae5aa.r2.dev/audio.mp3",
"duration": 156.36,
"workType": "video",
"status": "SUCCESS",
"errorMessage": "视频处理成功!",
"createBy": "60227",
"createTime": "2026-01-07 15:27:42"
}
}2. Task Processing
{
"msg": "操作成功",
"code": 200,
"data": {
"taskId": "2008805155734429696",
"title": "今日摘抄,不知道原创是谁,太多了",
"content": "今日摘抄,不知道原创是谁,太多了,可以在",
"videoUrl": "https://sns-video-qc.xhscdn.com/stream/79/258.mp4",
"videoUrlList": ["https://sns-video-qc.xhscdn.com/stream/79/258.mp4"],
"imageUrlList": ["https://ci.xiaohongshu.com/spectrum/1040g0k031qo"],
"cover": "https://ci.xiaohongshu.com/spectrum/1040g0k031qoj7pr9gm905",
"textContent": "",
"platform": "xhs",
"audioUrl": null,
"duration": null,
"workType": "video",
"status": "WAITING",
"errorMessage": "作品内容提取中...",
"createBy": "60227",
"createTime": "2026-01-07 15:37:26"
}
}3. Task Failed
{
"msg": "操作成功",
"code": 200,
"data": {
"taskId": "2008805155734429696",
"title": "今日摘抄,不知道原创是谁,太多了",
"content": "今日摘抄,不知道原创是谁,太多了,可以在",
"videoUrl": "https://sns-video-qc.xhscdn.com/stream/79/258.mp4",
"videoUrlList": ["https://sns-video-qc.xhscdn.com/stream/79/258.mp4"],
"imageUrlList": ["https://ci.xiaohongshu.com/spectrum/1040g0k031qo"],
"cover": "https://ci.xiaohongshu.com/spectrum/1040g0k031qoj7pr9gm905",
"textContent": "",
"platform": "xhs",
"audioUrl": null,
"duration": null,
"workType": "video",
"status": "FAILURE",
"errorMessage": "任务执行失败",
"createBy": "60227",
"createTime": "2026-01-07 15:37:26"
}
}Response Codes
| 状态码 | 说明 | 场景 |
|---|---|---|
| 200 | Success | 任务创建成功或查询成功 |
| 500 | Failed | 并发任务已达上限或其他错误 |
Task Status
| 状态值 | 说明 | 处理建议 |
|---|---|---|
| WAITING | Waiting or Processing | 继续轮询查询任务状态 |
| SUCCESS | Task Succeeded | 可获取完整的提取结果数据 |
| FAILURE | Task Failed | 检查 errorMessage 字段获取失败原因 |
Usage Flow
Recommended API call flow and best practices
1
提交任务
调用 POST /video/extract 接口,传入作品链接。成功后会返回 taskId,用于后续查询。
2
轮询查询
使用返回的 taskId 调用 GET /video/query 接口。建议每隔 3-5秒 查询一次任务状态。
3
处理结果
当 status 为 SUCCESS 时,获取完整的提取结果(标题、正文、视频、音频等)。 若为 FAILURE,检查 errorMessage 了解失败原因。
最佳实践建议
- • 轮询间隔建议 3-5 秒,避免过于频繁请求
- • 设置最大轮询次数(如 60 次),避免无限轮询
- • 妥善保管 API Key 和 Secret,不要泄露到客户端
- • 处理好并发限制,合理安排任务提交
Response Fields
| 字段名 | 类型 | 说明 |
|---|---|---|
| taskId | String | 任务唯一标识 |
| title | String | 作品标题 |
| content | String | 作品正文内容 |
| textContent | String | 视频语音转文字文案(任务完成后) |
| videoUrl | String | 视频下载链接(无水印) |
| audioUrl | String | 音频文件链接(任务完成后) |
| imageUrlList | Array | 图片链接列表 |
| cover | String | 封面图片链接 |
| platform | String | 平台标识(如 xhs、short_video 等) |
| duration | Number | 视频时长(秒) |
| workType | String | 作品类型(video、image) |
| status | String | 任务状态(WAITING、SUCCESS、FAILURE) |
| errorMessage | String | 状态描述或错误信息 |
Quick Links