<?php
$url = 'https://api.xiaoyu17love.top/API/wyydg_new.php';
$params = [
'apikey' => 'API密钥,注册账号免费获取',
'type' => '类型,可选search:搜索、choose:选歌、lyric:歌词、rmpl:歌曲热门评论、playlist:获取歌单',
'word' => '关键词或区分歌曲歌名,仅限type为search或choose',
'id' => '歌曲的id,仅限type为lyric或rmpl时',
'order' => '歌单类型,仅限type为playlist,可选hot(最热门)、new(最新)',
'choose' => '选择编号,仅限type为choose时',
];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = "https://api.xiaoyu17love.top/API/wyydg_new.php"
params = {
"apikey": "API密钥,注册账号免费获取",
"type": "类型,可选search:搜索、choose:选歌、lyric:歌词、rmpl:歌曲热门评论、playlist:获取歌单",
"word": "关键词或区分歌曲歌名,仅限type为search或choose",
"id": "歌曲的id,仅限type为lyric或rmpl时",
"order": "歌单类型,仅限type为playlist,可选hot(最热门)、new(最新)",
"choose": "选择编号,仅限type为choose时",
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://api.xiaoyu17love.top/API/wyydg_new.php');
const params = {
'apikey': 'API密钥,注册账号免费获取',
'type': '类型,可选search:搜索、choose:选歌、lyric:歌词、rmpl:歌曲热门评论、playlist:获取歌单',
'word': '关键词或区分歌曲歌名,仅限type为search或choose',
'id': '歌曲的id,仅限type为lyric或rmpl时',
'order': '歌单类型,仅限type为playlist,可选hot(最热门)、new(最新)',
'choose': '选择编号,仅限type为choose时',
};
Object.keys(params).forEach(key => {
url.searchParams.append(key, params[key]);
});
fetch(url)
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));