接口详情
GET/POST
JSON
接口状态
调用频率
无限制
响应时间
测速中
稳定性
稳定
请求参数
参数名 | 是否必填 | 类型 | 说明 | 示例 |
---|---|---|---|---|
url | 是 | string | 需要填的链接 | https://m.toutiao.com/is/oEe4HwA2dRY/ |
示例代码
https://api.bugpk.com/api/toutiao?url=https://m.toutiao.com/is/oEe4HwA2dRY/
// 使用 Fetch API 调用接口
const apiUrl = 'https://api.bugpk.com/api/toutiao';
// 准备请求参数
const params = {
key1: 'value1',
key2: 'value2',
// 根据实际参数添加
};
// GET 请求示例
async function getRequest() {
try {
const queryParams = new URLSearchParams(params).toString();
const url = `${apiUrl}?${queryParams}`;
const response = await fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('响应数据:', data);
return data;
} catch (error) {
console.error('请求失败:', error);
throw error;
}
}
// POST 请求示例
async function postRequest() {
try {
const response = await fetch(apiUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(params),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('响应数据:', data);
return data;
} catch (error) {
console.error('请求失败:', error);
throw error;
}
}
// 根据请求方法调用对应的函数
const method = 'GET/POST';
if (method === 'GET') {
getRequest();
} else if (method === 'POST') {
postRequest();
}
// 使用 cURL 调用接口
$apiUrl = 'https://api.bugpk.com/api/toutiao';
$method = 'GET/POST';
// 准备请求参数
$params = [
'key1' => 'value1',
'key2' => 'value2',
// 根据实际参数添加
];
function callApi($url, $method, $params = []) {
$ch = curl_init();
// 设置 cURL 选项
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
// 设置请求头
$headers = [
'Content-Type: application/json',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if ($method === 'GET') {
// GET 请求
$queryString = http_build_query($params);
$fullUrl = $url . '?' . $queryString;
curl_setopt($ch, CURLOPT_URL, $fullUrl);
} else {
// POST/PUT/DELETE 请求
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
if (!empty($params)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
}
}
// 执行请求
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_error($ch)) {
throw new Exception('cURL Error: ' . curl_error($ch));
}
curl_close($ch);
// 解析响应
$data = json_decode($response, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new Exception('JSON 解析错误: ' . json_last_error_msg());
}
return [
'status' => $httpCode,
'data' => $data
];
}
try {
$result = callApi($apiUrl, $method, $params);
echo "请求成功:\n";
print_r($result['data']);
} catch (Exception $e) {
echo "请求失败: " . $e->getMessage() . "\n";
}
import requests
import json
# API 配置
api_url = 'https://api.bugpk.com/api/toutiao'
method = 'get/post'
# 准备请求参数
params = {
'key1': 'value1',
'key2': 'value2',
# 根据实际参数添加
}
# 设置请求头
headers = {
'Content-Type': 'application/json',
'User-Agent': 'API-Client/1.0'
}
def call_api():
try:
if method == 'get':
# GET 请求
response = requests.get(
api_url,
params=params,
headers=headers,
timeout=30
)
else:
# POST/PUT/DELETE 请求
data = json.dumps(params)
if method == 'post':
response = requests.post(api_url, data=data, headers=headers, timeout=30)
elif method == 'put':
response = requests.put(api_url, data=data, headers=headers, timeout=30)
elif method == 'delete':
response = requests.delete(api_url, data=data, headers=headers, timeout=30)
else:
raise ValueError(f"不支持的请求方法: {method}")
# 检查响应状态
response.raise_for_status()
# 解析 JSON 响应
result = response.json()
print("请求成功!")
print(f"状态码: {response.status_code}")
print("响应数据:")
print(json.dumps(result, indent=2, ensure_ascii=False))
return result
except requests.exceptions.RequestException as e:
print(f"请求失败: {e}")
return None
except json.JSONDecodeError as e:
print(f"JSON 解析失败: {e}")
return None
# 调用接口
if __name__ == "__main__":
result = call_api()
import java.io.*;
import java.net.*;
import java.util.HashMap;
import java.util.Map;
public class ApiClient {
private static final String API_URL = "https://api.bugpk.com/api/toutiao";
private static final String METHOD = "GET/POST";
public static void main(String[] args) {
try {
// 准备请求参数
Map params = new HashMap<>();
params.put("key1", "value1");
params.put("key2", "value2");
// 根据实际参数添加
String response = callApi(API_URL, METHOD, params);
System.out.println("响应结果: " + response);
} catch (Exception e) {
System.err.println("请求失败: " + e.getMessage());
}
}
public static String callApi(String url, String method, Map params) throws IOException {
HttpURLConnection connection = null;
try {
if (method.equals("GET")) {
// GET 请求
String queryString = buildQueryString(params);
String fullUrl = url + "?" + queryString;
URL apiUrl = new URL(fullUrl);
connection = (HttpURLConnection) apiUrl.openConnection();
connection.setRequestMethod("GET");
} else {
// POST/PUT/DELETE 请求
URL apiUrl = new URL(url);
connection = (HttpURLConnection) apiUrl.openConnection();
connection.setRequestMethod(method);
connection.setDoOutput(true);
// 设置请求体
String requestBody = buildJsonBody(params);
try (OutputStream os = connection.getOutputStream()) {
byte[] input = requestBody.getBytes("utf-8");
os.write(input, 0, input.length);
}
}
// 设置请求头
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("User-Agent", "API-Client/1.0");
connection.setConnectTimeout(30000);
connection.setReadTimeout(30000);
// 获取响应
int status = connection.getResponseCode();
StringBuilder response = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), "utf-8"))) {
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
}
if (status != 200) {
throw new IOException("HTTP 错误代码: " + status);
}
return response.toString();
} finally {
if (connection != null) {
connection.disconnect();
}
}
}
private static String buildQueryString(Map params) throws UnsupportedEncodingException {
StringBuilder result = new StringBuilder();
for (Map.Entry entry : params.entrySet()) {
if (result.length() > 0) {
result.append("&");
}
result.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
result.append("=");
result.append(URLEncoder.encode(entry.getValue(), "UTF-8"));
}
return result.toString();
}
private static String buildJsonBody(Map params) {
StringBuilder json = new StringBuilder();
json.append("{");
boolean first = true;
for (Map.Entry entry : params.entrySet()) {
if (!first) {
json.append(",");
}
json.append("\"").append(entry.getKey()).append("\":\"").append(entry.getValue()).append("\"");
first = false;
}
json.append("}");
return json.toString();
}
}
# API 配置
API_URL="https://api.bugpk.com/api/toutiao"
METHOD="GET/POST"
# GET/POST 请求示例
curl -X GET/POST \
"$API_URL" \
-H "Content-Type: application/json" \
-H "User-Agent: API-Client/1.0" \
-d '{
"key1": "value1",
"key2": "value2"
}'
# 带详细输出的 cURL 命令
curl -v \
-X GET/POST \
"$API_URL" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"key1":"value1","key2":"value2"}' \
--connect-timeout 30 \
--max-time 60
# 将响应保存到文件
curl -X GET/POST \
"$API_URL" \
-H "Content-Type: application/json" \
-d '{"key1":"value1","key2":"value2"}' \
-o response.json
# 使用变量参数的示例
KEY1="value1"
KEY2="value2"
curl -X GET/POST \
"$API_URL" \
-H "Content-Type: application/json" \
-d "{\"key1\":\"$KEY1\",\"key2\":\"$KEY2\"}"
返回示例
{
"code": 200,
"msg": "解析成功",
"data": {
"itemId": 7529785681066295332,
"videoType": "short_video",
"author": "暖阳",
"userID": 1363807420024653,
"avatar": "https://sf6-cdn-tos.bdxiguastatic.com/img/user-avatar/d1205317ecc8e01a2d93b0f5046956bb~300x300.image",
"description": "来自河北的一枚90后
喜欢追剧 听歌 看综艺……
很高兴认识大家,多多交流呀
❤️~",
"title": "看完电影,才发现这荔枝原本就不是贵妃想吃的#长安的荔枝# ",
"cover": "https://p3-sign.toutiaoimg.com/tos-cn-i-3qtffzwd0j/oobtwoA8IEBF1zAByLQifDCEfQ1YE6AfAUAFDD~tplv-tt-profile_shortvideo:720:1280.jpeg?_iz=3710&bid=8&from=shortvideo&gid=7529785681066295332&lk3s=06827d14&x-expires=1758817516&x-signature=BpUK%2Fy%2B9rk5s7IcwEKn15cqxgd4%3D",
"url": "https://v6-web.toutiaovod.com/4c420551c70ca19633bd475d71be2880/68cc4096/video/tos/cn/tos-cn-ve-0eace5/oQnfDy0OQQEEiKBhLCfF0rvEIQDgsFUtFAfQEd/?a=24&ch=0&cr=0&dr=0&er=0&lr=unwatermarked&net=5&cd=0%7C0%7C0%7C0&cv=1&br=652&bt=652&cs=0&ds=3&ft=twOWrJLxBBkq8Zmo8dIG-_vjVQWw&mime_type=video_mp4&qs=0&rc=NGczOTtnNDU5NGQ3Mzc3Z0BpM200Nmo5cmtsNDUzNDM8M0AwMjEtYV40XmMxYTVgNmEuYSNxYWlvMmRja3NhLS1kLi9zcw%3D%3D&btag=c0000e00010000&dy_q=1758212716&feature_id=f0150a16a324336cda5d6dd0b69ed299&l=202509190025162D528EB793A04B423CC6",
"music": {
"musicID": 7529786609068215078,
"title": "头条用户原声",
"author": "头条用户",
"album": "",
"albumName": "@暖阳",
"albumCover": {
"url": "https://p3-sign.toutiaoimg.com/toutiao-video/music_detail_cover~tplv-tt-cs0:1080:1080.jpg?_iz=30575&from=toutiao_music&lk3s=5834e554&x-expires=1758817516&x-signature=onHq137DuoAz4f6V2aryVxmiktI%3D"
},
"albumCreatorID": 1363807420024653,
"playURL": "https://v3-web.toutiaovod.com/084d7b934c581971ca3ac98c2c16a856/68cd8406/video/tos/cn/tos-cn-v-0eace5/oUMh7WofApAVAGMMAIWSfLIMd8rkfQlQCEEDfI/?a=24&ch=0&cr=0&dr=0&er=0&lr=default&cd=0%7C0%7C0%7C0&br=126&bt=126&ds=5&ft=twOWrJLxBBkq8Zmo8dIG-_vjVQWw&mime_type=video_mp4&qs=13&rc=amx5c2w5cjZsNDUzNDM8M0Bpamx5c2w5cjZsNDUzNDM8M0Axc19oMmRrbnNhLS1kLi9zYSMxc19oMmRrbnNhLS1kLi9zcw%3D%3D&btag=c0000e00010000&dy_q=1758212716&l=202509190025162D528EB793A04B423CC6"
}
}
}
响应参数
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
code | string | 状态码 | |
msg | string | 结果信息 | |
data | string | 视频数据信息 |
在线请求
该接口支持多种请求方式
响应结果
发送请求后,响应结果将显示在这里...
友情链接

短视频解析
可以解析各大平台短视频
https://sv.bugpk.com九魂刷步
这是一个免费刷步数的网站!
https://api.jiuhunwl.cn/九魂博客
这是一个分享资源,交流学习的博客站!
https://www.jiuhunwl.cn/
资源库导航
你的专属网址标签站
https://www.zykdh.com/时空邮局
给未来写封信
https://skyj.jiuhunwl.cn/妙藏API
稳定、快速的免费API数据接口服务
https://api.tinise.cn/
IT睿行
编程技术,软件开发,人工智能,大数据,云计算,前端开发,后端开发,移动应用,算法设计,开源项目,个人博客,创意写作,生活随笔,读书笔记,旅行故事,摄影分享,美食体验,手工制作,灵感记录,生活感悟
https://itrf.cn/稳定API
免费高效稳定的API站
https://api.xingchenfu.xyz
小渡api
小渡API是一个免费的接口平台,致力于让数据传输更加快捷、高效,助力开发者轻松实现信息互通。
https://api.dwo.cc/