返回首页

【点歌】网抑云点歌

浏览: 3282 最后更新: 2024-12-18 18:40:26

接口说明

【点歌】网抑云点歌

接口基本信息

API地址

https://api.cenguigui.cn/api/music/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n=

请求方式

GET

返回格式

JSON

接口状态

正常启用

参数说明

以下参数为接口所需调用信息

参数 是否必填 类型 说明 示例
msg歌曲名字/歌手名字
n选择对应歌曲序号,为空则返回列表
num返回数量,默认10条
type返回格式,可填json,默认text
id可直接使用歌曲id解析
br1(标准音质)/2(极高音质)/3(无损音质)/4(Hi-Res音质)/5(高清环绕声)/6(沉浸环绕声)/7(超清母带)/ 默认输出标准音质

请求示例

HTTP请求

https://api.cenguigui.cn/api/music/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n=

调用示例

代码示例

返回结果

HTTP 200 OK
1、泡沫 -- G.E.M.邓紫棋
2、泡沫 -- Swang多雷
3、泡沫 (Live) -- G.E.M.邓紫棋
4、泡沫(Cover邓紫棋)(Cover 邓紫棋) -- 李瑨瑶
5、泡沫(Remix说唱版) -- 李可以
6、泡沫(杨树人) -- 藤井树
7、泡沫 (PÀO MÒ Remix) -- G.E.M.邓紫棋
8、泡沫 (Live) -- G.E.M.邓紫棋
9、泡沫(伤感版) -- 陶江平
10、泡沫(翻自 简弘亦) -- 仓生/唇釉

调用示例

// JavaScript调用示例
fetch("https://api.cenguigui.cn/api/music/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n=", {
  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/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n="

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/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n="))
                .build();
                
        client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
                .thenApply(HttpResponse::body)
                .thenAccept(System.out::println)
                .join();
    }
}
<?php
// PHP调用示例
$url = "https://api.cenguigui.cn/api/music/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n=";

$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/netease/WyY_Dg.php?type=text&msg=邓紫棋&num=10&n=";
        
        var response = await client.GetAsync(url);
        
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}