# 短视频提取文案解析 API Documentation

> 视频提取文案api接口、视频提取文案接口、短视频链接转文案api接口、视频音频转文本接口、视频转文字api接口、视频语音文件转文本接口、视频提取文字接口、抖音文案提取api接口开放平台。

## Overview

This document describes how to call the **短视频提取文案解析** API.

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

## 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**: `POST https://apis.xiaobao.ink/api/video/text`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `POST`

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `content` | Yes | 短视频分享链接 |
| `taskId` | Yes | 查询任务ID，不填是提交任务，填写任务ID是查询任务 |
| `language` | Yes | 语言 |

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

### Request Example

```
https://apis.xiaobao.ink/api/video/text?key=你的密钥
```

## Details

## 请求HEADER：

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

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 35kj5jnlj53453kl5j43nj5 | 接口密钥,在控制台->密钥管理查看 |
| content | 是 | string |  https://#/# | 视频或音频url，支持格式：mp3、mp4、wav、webm、aac、flac、m4a、mov、mkv、ogg、opus、amr、avi、flv、mpeg、wma、wmv等链接，若失败可通过录屏获取视频，最大2GB，最大时长12小时。请确认您拥有该内容的权利： 使用您不拥有的视频可能违反版权法。继续操作即表示您确认此内容是您自己的原创作品。 |
| taskId | 否 | string | 3c1d56f8-bd7e-4d15-8112-f212222cd4a6 | 查询任务ID，不填是提交任务，填写任务ID是查询任务 |
| language | 否 | string | zh-CN | 选填默认自动识别语言，支持语言：zh: 中文、en: 英文、ja: 日语、yue: 粤语、ko: 韩语、de：德语、fr：法语、ru：俄语等 |

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| code | int | 状态码 |
| msg | string | 状态信息 |
| data | string | 请求结果数据集 |
| -taskId | string | 任务 ID |
| -status | string |  状态 |
| -resultText | string | 视频文案 |
| -author | string | 作者 |
| -duration | string | 时长 |
| -videoDesc | string | 视频描述 |
| -creditCost | string | 积分 |
| debug | string/array | 调试数据 |
| exec_time | float | 执行耗时 |
| user_ip | string | 客户端IP |

## Response Example

```json
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "792b1cd3-a474-4f59-9344-cd02efe724fd",
        "status": "completed",
        "resultText": "美国狂砸7,000亿搞 AI，发现电网撑不住了。短短三个交易日，美国太空探索技术公司 Spacex 的股价上涨了近50%，市值一路狂飙，跻身全球前五。但美国科技巨头对 AI 算力的渴求面临严峻的现实掣肘。数据显示，2026年，美国科技巨头用于 AI、基础设施等在内的资本支出超过7,000亿美元。专家表示，目前美国发展人工智能的最大瓶颈是急剧膨胀的算力需求与落后的电网基础设施之间的矛盾。",
        "author": "长江云新闻",
        "videoDesc": "美国狂砸7000亿搞AI，发现电网撑不住了",
        "duration": 0.5,
        "creditCost": 0.5
    },
    "exec_time": 2.015858,
    "ip": "112.49.185.70"
}
```

## Error Codes

| Status / code | Description |
|---------------|-------------|
| 200 / success | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, please check API Key |
| 402 | Insufficient account balance / points |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |

## 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}`)._
