网易云音乐API

网易 音乐 解析 网易云
接口信息
API ID: 10
总调用: 95
添加时间: 2026-05-22
更新时间: 2026-06-09
访问权限: 需API密钥访问
请求信息
请求地址:
https://api.xkzil.com/API/music/wangyi/index.php
示例地址:
https://api.xkzil.com/API/music/wangyi/?action=song_url&id=28188263
请求参数
参数名 类型 必填 说明 示例值
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 服务器内部错误。服务器在执行请求时遇到了问题。
接口文档(点我展开)
## 支持的方法(action参数)

| 方法名 | 功能说明 | 必填参数 | 可选参数 |
|--------|----------|----------|----------|
| search | 搜索歌曲/专辑/歌手等 | keywords | type, limit, offset |
| song_url | 获取歌曲播放链接 | id | br |
| lyric | 获取歌词 | id | - |
| banner | 获取轮播图 | - | type |
| playlist | 获取歌单详情 | id | - |
| toplist | 获取排行榜 | - | - |
| album | 获取专辑详情 | id | - |
| user_detail | 获取用户详情 | - | - |

---

## 各方法详细参数

### 1. search - 搜索

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| keywords | string | ✅ | - | 搜索关键词 |
| type | int | ❌ | 1 | 搜索类型:1-单曲,10-专辑,100-歌手,1000-歌单,1002-用户,2000-声音搜索 |
| limit | int | ❌ | 30 | 返回数量 |
| offset | int | ❌ | 0 | 偏移量(分页) |

### 2. song_url - 获取歌曲链接

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| id | string | ✅ | - | 歌曲ID,多个用逗号分隔 |
| br | int | ❌ | 999000 | 码率(999000=无损,320000=高品质) |

### 3. lyric - 获取歌词

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| id | string | ✅ | - | 歌曲ID |

### 4. banner - 轮播图

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| type | int | ❌ | 0 | 客户端类型:0-pc,1-android,2-iphone,3-ipad |

### 5. playlist - 歌单详情

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| id | string | ✅ | - | 歌单ID |

### 6. toplist - 排行榜

无参数

### 7. album - 获取专辑详情

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| id | string | ✅ | - | 专辑ID |

### 8. user_detail - 获取用户详情

无参数(需在请求中传递uid参数)
返回示例
响应格式
{
  "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"
返回文本 = 网络操作对象.网页_获取(完整网址)

调试输出(返回文本)
API 接口列表