https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=
GET
JSON
正常启用
以下参数为接口所需调用信息
| 参数 | 是否必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
| msg | 是 | 是 | 歌曲名字/歌手名字 | |
| n | 是 | 是 | 选择对应歌曲,为空则返回列表 | |
| limit | 是 | 是 | 搜索返回最大数量,默认30 | |
| type | 是 | 是 | 返回格式,默认json,可填text |
https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1
{
"code": 200,
"msg": "当前歌曲为免费歌曲,已获取完整音频",
"data": {
"title": "无名的人(电影《雄狮少年》主题曲)",
"singer": "毛不易",
"lyric": "https://static-qianqian.taihe.com/0102/M00/9E/0B/ChR45GHWqjKAQih-AAAMc2PUtys112.lrc",
"cover": "https://img01.dmhmusic.com/0513/M00/79/9A/ChAKCGUkyaSAV1eLAAjIZzGP4cA083.jpg",
"link": "https://music.91q.com/song/T10062510854",
"music_url": "https://audio04.dmhmusic.com/71_53_T10062510854_128_4_1_0_sdk-cpm/cn/0101/M00/98/36/ChR45WG3Pk6AaMszAETo-PQb-1k462.mp3?xcode=d9950d8da680581fdf86c680a4d9c85c139f165"
}
}
// JavaScript调用示例
fetch("https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1", {
method: "GET",
headers: {
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
# Python调用示例
import requests
url = "https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1"
response = requests.get(url)
print(response.json())
// Java调用示例
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class ApiExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1"))
.build();
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.join();
}
}
<?php
// PHP调用示例
$url = "https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
?>
// C#调用示例
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
var url = "https://api.cenguigui.cn/api/music/qianqian_music.php?msg=毛不易&n=1";
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
// 响应结果将显示在这里