https://api-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=1
GET
JSON
正常启用
以下参数为接口所需调用信息
| 参数 | 是否必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
| name | 是 | 是 | 搜索,默认null | |
| page | 否 | 是 | 翻页,默认1 | |
| limit | 否 | 是 | 返回数量,默认30 | |
| id | 是 | 是 | 解析歌曲,默认null |
https://api-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=1
歌曲链接:
https://api-v2.cenguigui.cn/api/tomato/changdunovel/?id=7025864327139688455&type=json
{
"code": 200,
"msg": "搜索成功",
"data": [
{
"id": "7127995579795246092",
"name": "绅士",
"artist": "薛之谦",
"pic": "https://p9-novelfm-sign.novelfmpic.com/novel-pic/0e90fe848a0dc9d5e9579561d7e711ea~tplv-y3bzr8ilui-cover_super_smart_resize-v1:800:800:800:800.jpeg?lk3s=b132c119&scene=search_v2&x-expires=1751729490&x-signature=8JHkkD0mpfbrPcaplBYfYIpsNaY%3D",
"play_num": "162295",
"duration": "4分钟51秒",
"create_time": "2022-08-04T20:23:19+08:00",
"tags": "国语,伤感,浪漫,00年代,轻柔,金曲,情歌"
}
]
}
// JavaScript调用示例
fetch("https://api-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=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-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=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-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=1"))
.build();
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.join();
}
}
<?php
// PHP调用示例
$url = "https://api-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=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-v2.cenguigui.cn/api/tomato/changdunovel/?name=薛之谦&page=3&limit=1";
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
// 响应结果将显示在这里