| 参数名 | 类型 | 必填 | 说明 | 示例值 |
|---|---|---|---|---|
| action | string | 必填 | 接口方法名:search/song_url/lyric/banner/playlist/toplist/album/user_detail | |
| keywords | string | 否 | 搜索关键词,用于search方法 | |
| id | string | 否 | 用于song_url/lyric/playlist/album/comment方法歌曲/歌单/专辑/评论的ID,多个用逗号分隔 | |
| type | string | 否 | search方法:1-单曲/10-专辑/100-歌手/1000-歌单;comment方法:0-歌曲/1-MV/2-专辑/3-歌单;banner方法:0-pc/1-android/2-iphone | |
| limit | string | 否 | 每页返回数量 | |
| offset | string | 否 | 分页偏移量 | |
| br | string | 否 | 歌曲码率,999000=无损,320000=高品质,默认值 (999000) | |
| beforeTime | string | 否 | comment方法的分页参数 | |
| apikey | string | 必填 | 你的密钥 | |
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功,服务器已成功处理了请求。 |
| 403 | 服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。 |
| 404 | 请求的资源未找到。请检查您的请求地址是否正确。 |
| 429 | 请求过于频繁。您已超出速率限制,请稍后再试。 |
| 500 | 服务器内部错误。服务器在执行请求时遇到了问题。 |
{
"code": 200,
"message": "success",
"data": {
"code": 200,
"data": [
{
"id": 28188263,
"url": "http://m8.music.126.net/20260522174825/bdceac141c3ef75a3e48752433fc41df/ymusic/5307/5c9a/4657/bc6b5182da32a9f758d7007207247c48.mp3?vuutv=XVmu4iLgpjDp2DuAf2LSrN0DFKaAc7Qex03QR8HrmSS0yF3Rw3w6WcL3PSKuddtLITmTclMkkKy4BdpFzIQy63UfgYfwNxb3nPMA1op0DPc=",
"br": 320000,
"size": 8047942,
"md5": "bc6b5182da32a9f758d7007207247c48",
"code": 200,
"expi": 1200,
"type": "mp3",
"gain": -10.6358,
"peak": 1,
"closedGain": -6,
"closedPeak": 1.0235,
"fee": 8,
"uf": null,
"payed": 0,
"flag": 1343492,
"canExtend": false,
"freeTrialInfo": null,
"level": "exhigh",
"encodeType": "mp3",
"channelLayout": null,
"freeTrialPrivilege": {
"resConsumable": false,
"userConsumable": false,
"listenType": null,
"cannotListenReason": null,
"playReason": null,
"freeLimitTagType": null
},
"freeTimeTrialPrivilege": {
"resConsumable": false,
"userConsumable": false,
"type": 0,
"remainTime": 0
},
"urlSource": 0,
"rightSource": 0,
"podcastCtrp": null,
"effectTypes": null,
"time": 201000,
"message": null,
"levelConfuse": null,
"musicId": "64785866",
"accompany": null,
"sr": 44100,
"auEff": null,
"immerseType": null,
"beatType": 0
}
]
},
"api_source": "星空知API:api.xkzil.com"
}
<?php
$url = 'https://api.xkzil.com/API/music/wangyi/index.php';
$params = ['action' => 'YOUR_VALUE', 'keywords' => 'YOUR_VALUE', 'id' => 'YOUR_VALUE', 'type' => 'YOUR_VALUE', 'limit' => 'YOUR_VALUE', 'offset' => 'YOUR_VALUE', 'br' => 'YOUR_VALUE', 'beforeTime' => 'YOUR_VALUE', 'apikey' => 'YOUR_VALUE', ];
$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.xkzil.com/API/music/wangyi/index.php"
params = {
'action': 'YOUR_VALUE',
'keywords': 'YOUR_VALUE',
'id': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
'limit': 'YOUR_VALUE',
'offset': 'YOUR_VALUE',
'br': 'YOUR_VALUE',
'beforeTime': 'YOUR_VALUE',
'apikey': 'YOUR_VALUE',
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://api.xkzil.com/API/music/wangyi/index.php');
const params = {
'action': 'YOUR_VALUE',
'keywords': 'YOUR_VALUE',
'id': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
'limit': 'YOUR_VALUE',
'offset': 'YOUR_VALUE',
'br': 'YOUR_VALUE',
'beforeTime': 'YOUR_VALUE',
'apikey': 'YOUR_VALUE',
};
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));
const axios = require('axios');
const url = 'https://api.xkzil.com/API/music/wangyi/index.php';
const params = {
'action': 'YOUR_VALUE',
'keywords': 'YOUR_VALUE',
'id': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
'limit': 'YOUR_VALUE',
'offset': 'YOUR_VALUE',
'br': 'YOUR_VALUE',
'beforeTime': 'YOUR_VALUE',
'apikey': 'YOUR_VALUE',};
axios.get(url, { params })
.then(res => console.log(res.data))
.catch(err => console.error(err));
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.xkzil.com/API/music/wangyi/index.php"
params := url.Values{}
params.Add("action", "YOUR_VALUE")
params.Add("keywords", "YOUR_VALUE")
params.Add("id", "YOUR_VALUE")
params.Add("type", "YOUR_VALUE")
params.Add("limit", "YOUR_VALUE")
params.Add("offset", "YOUR_VALUE")
params.Add("br", "YOUR_VALUE")
params.Add("beforeTime", "YOUR_VALUE")
params.Add("apikey", "YOUR_VALUE")
reqURL := baseURL + "?" + params.Encode()
resp, err := http.Get(reqURL)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.xkzil.com/API/music/wangyi/index.php" + "?" +
"action=YOUR_VALUE" + "&" +\n "keywords=YOUR_VALUE" + "&" +\n "id=YOUR_VALUE" + "&" +\n "type=YOUR_VALUE" + "&" +\n "limit=YOUR_VALUE" + "&" +\n "offset=YOUR_VALUE" + "&" +\n "br=YOUR_VALUE" + "&" +\n "beforeTime=YOUR_VALUE" + "&" +\n "apikey=YOUR_VALUE";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System.Net;
var client = new HttpClient();
var url = "https://api.xkzil.com/API/music/wangyi/index.php" + "?" +
string.Join("&",
new (string, string)[] {
("action", "YOUR_VALUE"),
("keywords", "YOUR_VALUE"),
("id", "YOUR_VALUE"),
("type", "YOUR_VALUE"),
("limit", "YOUR_VALUE"),
("offset", "YOUR_VALUE"),
("br", "YOUR_VALUE"),
("beforeTime", "YOUR_VALUE"),
("apikey", "YOUR_VALUE"),
}.Select(p => $"{WebUtility.UrlEncode(p.Item1)}={WebUtility.UrlEncode(p.Item2)}")
);
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
char *url = "https://api.xkzil.com/API/music/wangyi/index.php" + '?' +
"action=YOUR_VALUE&keywords=YOUR_VALUE&id=YOUR_VALUE&type=YOUR_VALUE&limit=YOUR_VALUE&offset=YOUR_VALUE&br=YOUR_VALUE&beforeTime=YOUR_VALUE&apikey=YOUR_VALUE";
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
int res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
#include <iostream>
#include <httplib.h>
int main() {
httplib::Client cli("https://api.xkzil.com");
httplib::Params params{
{"action", "YOUR_VALUE"},
{"keywords", "YOUR_VALUE"},
{"id", "YOUR_VALUE"},
{"type", "YOUR_VALUE"},
{"limit", "YOUR_VALUE"},
{"offset", "YOUR_VALUE"},
{"br", "YOUR_VALUE"},
{"beforeTime", "YOUR_VALUE"},
{"apikey", "YOUR_VALUE"},
};
auto res = cli.Get("/API/music/wangyi/index.php", params);
if(res) std::cout << res->body << std::endl;
return 0;
}
.版本 2
.子程序 _按钮_调用_被单击
.局部变量 网络操作对象, 网络操作类
.局部变量 返回文本, 文本型
.局部变量 完整网址, 文本型
完整网址 = "https://api.xkzil.com/API/music/wangyi/index.php" + "?"
完整网址 = 完整网址 + " + "&" + "action" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "keywords" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "id" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "type" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "limit" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "offset" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "br" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "beforeTime" + "=" + "YOUR_VALUE"
完整网址 = 完整网址 + "apikey" + "=" + "YOUR_VALUE"
返回文本 = 网络操作对象.网页_获取(完整网址)
调试输出(返回文本)