# 全平台视频解析 API Documentation

> 传入抖音、快手、小红书、B站、微博、YouTube、TikTok、豆包、千问等分享链接或口令，返回标题、封面、无水印直链、图集与作者信息。同步接口，成功解析扣 1 点。

## Overview

This document describes how to call the **全平台视频解析** API.

- **Model / path slug**: `video/videoparse`
- **Task type**: `sync` (`sync` = synchronous, `async` = create task then poll / callback)
- **HTML docs**: `/doc/43`

## Authentication

All API requests require your platform API key as the query parameter `key`:

```
?key=YOUR_API_KEY
```

Get API Key:
1. Sign in to the console
2. Open [API Key Management](/user/key) and create or copy your key
3. Append `key=YOUR_API_KEY` to the request URL (or pass it in form/JSON when the endpoint accepts it)

---

## API Information

- **URL**: `GET|POST https://apis.xiaobao.ink/api/video/videoparse`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `GET / POST`
- **Note**: This endpoint accepts both GET query parameters and POST form/JSON body.

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `url` | Yes | 待解析的视频/图文分享链接，完整URL或分享短链，也可直接粘贴带链接的分享口令 |
| `flat` | No | 可选，0=双层data，1=单层data，2=单层且type只出视频\|图集\|实况图集，默认2 |

> **Note**: `key` (API key) is required for authenticated calls even if omitted from the parameter list above.

### Request Example

```
/api/video/videoparse?key=你的key&url=https://v.douyin.com/xxxxx/
```

## Details

*

*

*

## 接口说明：

同步解析视频/图文分享链接，立即返回标题、描述、封面、无水印视频直链、图集、作者与互动数据。支持完整 URL、短链，以及带链接的分享口令（自动提取其中的 http(s) 地址）。解析失败不扣费。

支持平台：抖音、快手、小红书、哔哩哔哩、微博、皮皮虾、西瓜视频、好看视频、TikTok、YouTube、Instagram、Twitter/X、Facebook、豆包、千问、可灵。

本接口仅提供链接元数据解析，不存储、不复制、不分发原始内容。解析结果版权归原作者及原平台所有，仅供个人备份、内容审核、数据分析、学术研究等合理使用；禁止公开传播他人作品、二次商业转售或集成到下载分发站点。

## 请求HEADER：

| 名称 | 值 |
| --- | --- |
| Content-Type | application/x-www-form-urlencoded;charset:utf-8; 或 application/json |

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 35kj5jnlj53453kl5j43nj5 | 接口密钥,在控制台->密钥管理查看 |
| url | 是 | string | https://v.douyin.com/xxxxx/ | 待解析链接，完整 URL 或分享短链，最大 2048 字符。兼容 content、link；可直接粘贴带网址的分享口令，接口会自动提取链接 |
| flat | 否 | int | 2 | 出参结构。2=单层 data，type 只出 视频 / 图集 / 实况图集（默认，推荐）；1=单层 data，保留平台原始 type；0=兼容旧版双层 data |

GET / POST / JSON 均可。同步接口，一般 2～5 秒返回。每次成功解析扣 1 点（约 0.01 元）；参数错误或解析失败不扣费。

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| code | int | 状态码，200 表示成功 |
| msg | string | 状态信息 |
| data | object | 解析结果 |
| data.platform | string | 平台标识：douyin / kuaishou / xiaohongshu / bilibili / weibo / pipixia / xigua / haokan / tiktok / youtube / instagram / twitter / facebook / doubao / qianwen / kling |
| data.type | string | flat=2 时为：视频、图集、实况图集（含动图即为实况图集）。flat=1 时可能为平台原始类型 |
| data.title | string | 标题；没有则为空字符串 |
| data.desc | string | 正文 / 描述；没有则为空字符串 |
| data.video_url | string | 最优画质视频直链；纯图集时为空字符串 |
| data.cover_url | string | 封面；没有时可能回落到第一张静图 |
| data.audio_url | string | 音频直链；没有则为空字符串 |
| data.imagelist | array | 静图 URL 字符串数组。元素就是字符串，不是对象。动图不在这里 |
| data.images | array | 同 imagelist，便于直接使用 |
| data.author | string | 作者昵称（从 stats / source 提升到顶层） |
| data.author_avatar | string | 作者头像 URL |
| data.author_id | string | 作者平台 ID |
| data.author_account | string | 作者账号 / 短 ID |
| data.video_format | string | 视频格式：mp4 / hls，无法判断时为空字符串 |
| data.request_url | string | 本次实际解析的链接 |
| data.stats | object | 互动与作者信息；缺项为 0 或空字符串 |
| data.stats.author_name | string | 作者昵称 |
| data.stats.author_avatar | string | 作者头像 URL |
| data.stats.author_account | string | 作者账号 / 短 ID |
| data.stats.author_id | string | 作者平台 ID |
| data.stats.like_count | int | 点赞数；没有为 0 |
| data.stats.comment_count | int | 评论数；没有为 0 |
| data.stats.share_count | int | 转发数；没有为 0 |
| data.stats.play_count | int | 播放数；没有为 0 |
| data.stats.collect_count | int | 收藏数；没有为 0 |
| data.stats.publish_time | string | 发布时间；没有为空字符串 |
| data.video_list | array | 全部可下载视频。普通视频是清晰度档，动图 quality 为 动图1/2… |
| data.video_list[].quality | string | 清晰度，或动图序号（动图1/2…） |
| data.video_list[].url | string | 该档直链 |
| data.video_list[].size | string | 文件大小；没有为空字符串 |
| data.video_list[].resolution | string | 分辨率，如 1080x1920；没有为空字符串 |
| data.source | object | 来源、作者与版权说明。调用方应在最终用户可见界面展示来源信息 |
| data.source.platform | string | 平台标识，与顶层 platform 相同 |
| data.source.platform_label | string | 平台中文名，如 抖音 / 小红书 |
| data.source.original_url | string | 原始分享链接 |
| data.source.author_name | string | 作者昵称 |
| data.source.author_account | string | 作者账号 |
| data.source.author_id | string | 作者平台 ID |
| data.source.copyright_notice | string | 版权说明 |
| data.source.usage_restriction | string | 使用限制 |
| exec_time | float | 执行耗时 |
| ip | string | 客户端IP |

## Response Example

```json
{
    "code": 200,
    "msg": "success",
    "data": {
        "platform": "xiaohongshu",
        "type": "视频",
        "title": "一年级同学你好！！！",
        "desc": "这个小朋友真的成为小学生了，送到校门口老母亲就飙泪",
        "video_url": "https://sns-video-hs.xhscdn.com/example.mp4",
        "cover_url": "https://sns-img-hw.xhscdn.com/example",
        "audio_url": "",
        "imagelist": [
            "https://sns-img-hw.xhscdn.com/example"
        ],
        "images": [
            "https://sns-img-hw.xhscdn.com/example"
        ],
        "author": "示例作者",
        "author_avatar": "https://sns-avatar-qc.xhscdn.com/avatar/example",
        "author_id": "",
        "author_account": "",
        "video_format": "mp4",
        "request_url": "https://www.xiaohongshu.com/discovery/item/example",
        "stats": {
            "author_name": "示例作者",
            "author_avatar": "https://sns-avatar-qc.xhscdn.com/avatar/example",
            "author_account": "",
            "author_id": "",
            "like_count": 40,
            "comment_count": 23,
            "share_count": 4,
            "play_count": 0,
            "collect_count": 9,
            "publish_time": "2026-08-30 08:59:24"
        },
        "video_list": [
            {
                "quality": "高清",
                "url": "https://sns-video-hs.xhscdn.com/example.mp4",
                "size": "",
                "resolution": "1080x1920"
            }
        ],
        "source": {
            "platform": "xiaohongshu",
            "platform_label": "小红书",
            "original_url": "https://www.xiaohongshu.com/discovery/item/example",
            "author_name": "示例作者",
            "author_account": "",
            "author_id": "",
            "copyright_notice": "本内容版权归原作者及原平台所有；本服务仅提供 URL 解析技术服务，不存储、不复制、不分发任何原始视频/图片/音频内容。",
            "usage_restriction": "仅供个人备份、内容审核、数据分析、学术研究等合理使用场景；禁止公开传播他人作品、二次商业转售、集成到下载分发站点或用于任何侵犯原作者权益的行为。",
            "disclaimer_url": ""
        }
    },
    "exec_time": 2.18,
    "ip": "1.2.3.4"
}
```

## Error Codes

| 错误码 | 类型 | 说明 |
| --- | --- | --- |
| 403 | int | 没有权限 / 密钥无效 |
| 400 | int | 参数错误、链接无法访问或未能解析到有效内容；点数不足也会返回 400 |
| 500 | int | 服务内部错误，请稍后重试。此类错误不扣费 |

## Usage Flow

1. Obtain your API Key from the console
2. Call the endpoint with `key` and required parameters
3. Parse the JSON (or binary) response according to the examples above

---

_Generated for AI / LLM consumption. Source of truth: `api_list` (same as HTML `/doc/{id}`)._
