网易云音乐歌词
根据音乐 ID 获取网易云音乐歌词(LRC 格式)。
接口路径
/api/wy_lyrics
◆ 接口信息
接口地址
/api/wy_lyrics
请求方式
GET
返回格式
JSON
请求示例
https://cloud.xgiao.cn/api/wy_lyrics?key=ABCDEF0123456789ABCDEF0123456789&id=426852063
◆ 请求参数
| 参数名 | 参数值 | 参数类型 | 是否必填 | 默认值 | 取值范围 | 参数描述 |
|---|---|---|---|---|---|---|
key |
YOUR_API_KEY | string | 必选 | - | 32位大写字母数字 | API Key,登录后在个人中心获取 |
id |
426852063 | number | 必选 | - | 网易云音乐ID | 音乐ID |
◆ 返回参数
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
version |
number | 歌词版本 |
lyric |
string | 歌词内容(LRC时间轴格式) |
◆ 返回示例
获取音乐 ID 426852063 的歌词
curl
curl "https://cloud.xgiao.cn/api/wy_lyrics?key=ABCDEF0123456789ABCDEF0123456789&id=426852063"JSON
{
"code": 200,
"msg": "获取成功",
"data": {
"version": 19,
"lyric": "[00:00.00] 作词 : Finale\n[00:33.35]我总是轻描淡写告诉你我的愿望\n[01:02.49]你笑得像光芒\n"
}
}◆ 错误示例
以下为常见请求错误时的返回结果:
缺少 API Key
code 40001
curl
curl "https://cloud.xgiao.cn/api/wy_lyrics?id=426852063"返回
{"code":40001,"msg":"缺少API Key","data":null}
API Key 无效
code 40002
curl
curl "https://cloud.xgiao.cn/api/wy_lyrics?key=WRONG&id=426852063"返回
{"code":40002,"msg":"API Key无效","data":null}
id 参数格式不正确
code 40005
curl
curl "https://cloud.xgiao.cn/api/wy_lyrics?key=ABCDEF0123456789ABCDEF0123456789&id=abc"返回
{"code":40005,"msg":"id参数格式不正确","data":null}
服务器内部错误
code 500
curl
curl "https://cloud.xgiao.cn/api/wy_lyrics?key=ABCDEF0123456789ABCDEF0123456789&id=1"返回
{"code":500,"msg":"服务器内部错误","data":null}