调用示例
$url = 'https://api.bugpk.com/api/xhs';
$params = [
'key' => 'value' // 请替换实际参数
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
url = "https://api.bugpk.com/api/xhs"
params = {
"key": "value" # 请替换实际参数
}
response = requests.get(url, params=params)
print(response.text)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class ApiTest {
public static void main(String[] args) {
try {
String url = "https://api.bugpk.com/api/xhs?key=value";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
const url = 'https://api.bugpk.com/api/xhs';
const params = new URLSearchParams({
key: 'value' // 请替换实际参数
});
fetch(`${url}?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
返回结果示例
{
"code": 200,
"msg": "解析成功",
"data": {
"author": "YOMeeDoll小企鹅窝窝",
"authorID": "63410809000000001802f905",
"title": "小企鹅滑雪,帅不过三秒,但可以萌一辈子‼️",
"desc": "YOMee小企鹅的可爱,每一帧都在我心趴上…
它真的是一个宝宝啊啊!!!谁懂啊…
#企鹅[话题]# #治愈系[话题]# #yomeedoll企鹅[话题]# #yomeedoll手作[话题]# #yomee企鹅[话题]# #关节玩偶[话题]# #萌宠[话题]# #这也太可爱了吧[话题]# #萌化了[话题]# #YOMeeDoll企鹅全国首展[话题]#",
"avatar": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31or3t46vgu005oq1104m5u85v748nl8?imageView2/2/w/120/format/jpg",
"cover": "http://sns-webpic-qc.xhscdn.com/202601181712/ca0ca8726ff03fca5c584ad1a18dea37/1040g00831rbrin4cn4005oq1104m5u85dmlu3j0!h5_1080jpg",
"url": "http://sns-video-hw.xhscdn.com/stream/1/110/114/01e9689f39048f04010370019bc0ae91d0_114.mp4"
}
}
返回参数说明
| 参数名 |
类型 |
说明 |
示例 |
| code |
string |
状态码 |
|
| msg |
string |
提示信息 |
|
| data |
object |
结果信息 |
|