首页 全部接口 API文档 文章 贡献者 友链 关于
登录/注册

网易云歌词

GET https://api.xunjinlu.fun/api/wyy/gc.php

网易云歌词API接口文档

1. 接口简介

网易云歌词API是一个基于落月API(vkeys.cn)构建的API,用于获取网易云音乐平台上的歌曲歌词信息。通过提供歌曲ID,可以获取对应歌曲的LRC格式歌词和YRC格式(逐字歌词)数据。

2. 请求说明

3. 请求参数

参数名类型是否必填说明
:---::---::---::---:
idstring/int网易云音乐歌曲ID

4. 返回参数

字段名说明
:---::---:
code状态码,200表示成功
message返回信息,如请求成功或失败的原因
data包含歌词信息的对象
data.lrcLRC格式歌词数据
data.yrcYRC格式歌词数据
time请求响应时间

5. 返回示例

成功示例

{
  "code": 200,
  "message": "请求成功!",
  "data": {
    "lrc": "[00:00.00]作词: 乐仔\n[00:01.00]作曲: 徐肖@Alnova\n[00:02.00]编曲: 徐肖@Alnova\n...",
    "yrc": "{\"t\":0,\"c\":[{\"tx\":\"作词: \"},{\"tx\":\"乐仔\"}]}\n{\"t\":3105,\"c\":[{\"tx\":\"作曲: \"},{\"tx\":\"徐肖@Alnova\"}]}\n..."
  },
  "time": "2024-01-12 15:28:59"
}

失败示例

{
  "code": 400,
  "message": "无效的歌曲ID",
  "data": null,
  "time": "2024-01-12 15:29:01"
}

6. 错误码说明

状态码说明
:---::---:
200请求成功
400无效的请求,如无效的歌曲ID
其他其他错误,如服务器错误等

7. 调用示例

直接访问链接

https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140

cURL命令示例

curl -X GET "https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140" -H "accept: application/json"

JavaScript (fetch) 示例

fetch('https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

jQuery AJAX 示例

$.ajax({
  url: 'https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140',
  type: 'GET',
  dataType: 'json',
  success: function(data) {
    console.log(data);
  },
  error: function(error) {
    console.error(error);
  }
});

Python (requests) 示例

import requests
import json

url = "https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140"
response = requests.get(url)
data = response.json()
print(data)

PHP (curl) 示例

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
echo json_encode($response, JSON_PRETTY_PRINT);

HTML (iframe) 示例

<iframe src="https://api.xunjinlu.fun/api/wyy/gc.php?id=1345872140" style="width:100%; height:300px;"></iframe>