⚡ 快速开始
最简接入指南,3 分钟内完成第一次解析调用。
接口地址
https://api.f166.cn/api/parse
支持 GET 和 POST 请求,返回标准 JSON。
认证方式
在请求参数中携带
key
或 token、apikey(三选一,优先 key)。
最小示例
Shell / cURL
# GET 方式(最简) curl "https://api.f166.cn/api/parse?url=链接&key=YOUR_API_KEY" # POST 方式(推荐,支持特殊字符) curl -X POST "https://api.f166.cn/api/parse" \ -H "Content-Type: application/json" \ -d '{"url":"链接","key":"YOUR_API_KEY"}'
支持的平台
传入对应平台的分享链接,自动识别,无需手动指定平台。
抖音
douyin
快手
kuaishou
小红书
xiaohongshu
豆包
doubao
即梦
jimeng
今日头条
toutiao
皮皮虾
pipixia
微博
weibo
B站
bilibili
网易云音乐
netease
🔗 视频解析接口
传入分享链接,自动识别平台,返回无水印视频/图片地址。
GET
POST
/api/parse
🔒 需认证
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| url | string | ✔ 是 | 短视频/图文分享链接(支持 10+ 平台) |
| key | string | ✔ 是 | API Key(key / token / apikey 三选一,优先 key) |
| token | string | − 否 | 同 key,兼容写法 |
| apikey | string | − 否 | 同 key,兼容写法 |
返回参数
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,200=成功,其他=失败 |
| msg | string | 提示信息 |
| data.type | string | 内容类型:video / images |
| data.title | string | 视频/图文标题 |
| data.video_url | string | 无水印视频直链(type=video 时返回) |
| data.cover | string | 封面图地址 |
| data.platform | string | 识别到的平台代码,如 douyin / kuaishou |
| data.duration | int | 视频时长(秒),部分平台返回 |
| data.images | array | 无水印图集列表(type=images 时返回) |
返回示例
JSON
{
"code": 200,
"msg": "success",
"data": {
"type": "video",
"title": "一行代码不写搞定开发和上线",
"video_url": "https://v.douyin.com/xxx/xxx.mp4",
"cover": "https://p3-sign.douyinpic.com/xxx.webp",
"duration": 58,
"platform": "douyin"
}
}
JSON
{
"code": 403,
"msg": "无效的API Key"
}
⚠ 错误码参照
遇到错误时,根据状态码查阅此表获取处理建议。
| 状态码 | 说明 | 处理建议 |
|---|---|---|
| 200 | 请求成功 | ✓ 正常流程,解析结果在 data 字段中 |
| 400 | 缺少 url 参数 / 不支持的平台 | 检查链接格式是否正确、是否为支持的平台 |
| 401 | 请先登录 / Token 已过期 | 重新登录获取有效 token |
| 403 | 无效的 API Key / 账户禁用 | 检查 API Key 是否正确,或联系管理员 |
| 429 | 今日调用次数已达上限 | 等待次日配额重置,或升级套餐 |
| 500 | 服务器内部错误 | 稍后重试,持续失败请联系技术支持 |
| 500 | 平台反爬,暂时无法解析 | 该平台当前不可用,建议更换其他平台 |
💻 多语言代码示例
选择你的开发语言,直接复制代码接入。
Shell / cURL
# GET 方式 curl "https://api.f166.cn/api/parse?url=视频链接&key=YOUR_API_KEY" # POST 方式(推荐,链接含特殊字符时更稳定) curl -X POST "https://api.f166.cn/api/parse" \ -H "Content-Type: application/json" \ -d '{"url":"视频链接","key":"YOUR_API_KEY"}'
Node.js
const axios = require('axios'); async function parse(url, apiKey) { try { const { data } = await axios.get( 'https://api.f166.cn/api/parse', { params: { url, key: apiKey }, timeout: 30000 } ); if (data.code === 200) return data.data; throw new Error(data.msg || '解析失败'); } catch (err) { if (err.response) console.error('API错误:', err.response.data); else console.error('网络错误:', err.message); } } // 使用示例 parse('https://v.douyin.com/xxxxxx/', 'YOUR_API_KEY') .then(d => console.log(d.video_url || d.images));
Python
import requests def parse(url: str, api_key: str) -> dict: """调用奇云API解析视频/图文链接""" resp = requests.get( 'https://api.f166.cn/api/parse', params={'url': url, 'key': api_key}, timeout=30 ) resp.raise_for_status() result = resp.json() if result['code'] != 200: raise RuntimeError(f"解析失败: {result['msg']}") return result['data'] # 使用示例 data = parse('https://v.douyin.com/xxxxxx/', 'YOUR_API_KEY') if data['type'] == 'video': print('视频地址:', data['video_url']) else: print('图片列表:', data['images'])
Go
package main import ( "encoding/json" "fmt" "io" "net/http" "net/url" ) type ParseResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data map[string]interface{} `json:"data"` } func parse(videoURL, apiKey string) (*ParseResponse, error) { u := "https://api.f166.cn/api/parse?url=" + url.QueryEscape(videoURL) + "&key=" + apiKey resp, err := http.Get(u) if err != nil { return nil, err } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) var result ParseResponse if err := json.Unmarshal(body, &result); err != nil { return nil, err } if result.Code != 200 { return nil, fmt.Errorf("解析失败: %s", result.Msg) } return &result, nil }
PHP
<?php function parse($url, $apiKey) { $apiUrl = 'https://api.f166.cn/api/parse?url=' . urlencode($url) . '&key=' . urlencode($apiKey); $ctx = stream_context_create([ 'http' => ['timeout' => 30, 'ignore_errors' => true] ]); $json = file_get_contents($apiUrl, false, $ctx); if ($json === false) { throw new RuntimeException('请求失败'); } $result = json_decode($json, true); if ($result['code'] != 200) { throw new RuntimeException($result['msg'] ?? '解析失败'); } return $result['data']; } // 使用示例 $data = parse('https://v.douyin.com/xxxxxx/', 'YOUR_API_KEY'); echo $data['video_url'] ?? join("\n", $data['images']); ?>
Java (OkHttp)
import okhttp3.*; import org.json.JSONObject; import java.net.URLEncoder; public class QiyunApi { private static final OkHttpClient client = new OkHttpClient(); public static JSONObject parse(String videoUrl, String apiKey) throws Exception { String url = "https://api.f166.cn/api/parse?url=" + URLEncoder.encode(videoUrl, "UTF-8") + "&key=" + URLEncoder.encode(apiKey, "UTF-8"); Request request = new Request.Builder().url(url).build(); try (Response response = client.newCall(request).execute()) { String body = response.body().string(); JSONObject json = new JSONObject(body); if (json.getInt("code") != 200) { throw new RuntimeException(json.getString("msg")); } return json.getJSONObject("data"); } } }
🧪 在线调试
直接在浏览器中测试解析接口,无需写代码。