网易云音乐获取APINetease Music API
Contents
封装好的网易云音乐API,欢迎大家调用━(`∀´)ノ亻!
The packaged NetEase Cloud Music API, welcome everyone to use ━(`∀´)ノ亻!
参数
type
: (必填)模式类型type
=single
单曲信息/playlist
歌单歌曲信息/url
获取歌曲/cover
获取封面/lrc
获取歌词id
: (必填,搭配type使用)歌单或歌曲id e.g.id
=198401123
random
: 仅对playlist有效,返回的歌曲是否打乱顺序,默认false
. e.g.random
=true
limit
: 返回歌单最大长度 e.g.limit
=10
歌单和歌曲的id可以从云音乐网页版获取。点开歌单或歌曲,查看浏览器地址栏,如下图:
2021-6-23起”我喜欢的音乐”歌单不再受支持。如有需求,请创建一个公开的歌单,并将“我喜欢的音乐”中的歌曲移入。
请求地址
1 | GET https://api.yimian.xyz/msc/ |
示例
获取id为36308263的歌曲信息
https://api.yimian.xyz/msc/?type=single&id=36308263
获取id为2675649523的歌单所有歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=2675649523
获取2675649523歌单前14首歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=2675649523&limit=14
随机从2675649523歌单获取14首歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=2675649523&limit=14&random=true
获取36308263的mp3音乐文件
https://api.yimian.xyz/msc/?type=url&id=36308263
获取id为3384296792803059的封面图片
https://api.yimian.xyz/msc/?type=cover&id=3384296792803059
获取36308263歌曲的lrc歌词文件
https://api.yimian.xyz/msc/?type=lrc&id=36308263
返回值(json格式)
single单曲模式:
1
2
3
4
5
6
7
8
9{
id: "歌曲id",
name: "歌曲名称",
artist: "第一作者",
album: "专辑名称",
url: "单曲地址",
cover: "封面地址",
lrc: "歌词地址"
}playlist歌单模式:
1
2
3
4
5
6
7
8
9
10
11
12
13[
{
id: "歌曲id",
name: "歌曲名称",
artist: "第一作者",
album: "专辑名称",
url: "单曲地址",
cover: "封面地址",
lrc: "歌词地址"
},
{歌曲2..},
{歌曲3..}
]错误:
1
{code: 500, err: "错误信息"}
Parameters
type
: (Required) Mode typetype
=single
single information/playlist
song information/url
get song/cover
get cover/lrc
get lyricsid
: (Required, used with type) Playlist or song id e.g.id
=198401123
random
: Only valid for playlist, whether the returned songs are out of order, the default isfalse
. e.g.random
=true
limit
: return the maximum length of the playlist e.g.limit
=10
Playlist and song id can be obtained from Cloud Music Web Version. Click to open a playlist or song, and check the browser address bar, as shown below:
Request address
1 | GET https://api.yimian.xyz/msc/ |
Example
1 | //Get song information with id 36308263 |
Return value (json format)
single mode:
1
2
3
4
5
6
7
8
9{
id: "Song id",
name: "Song name",
artist: "First Author",
album: "Album Name",
url: "Single address",
cover: "Cover Address",
lrc: "Lyrics address"
}Playlist playlist mode:
1
2
3
4
5
6
7
8
9
10
11
12
13[
{
id: "Song id",
name: "Song name",
artist: "First Author",
album: "Album Name",
url: "Single address",
cover: "Cover Address",
lrc: "Lyrics address"
},
{Song 2..},
{Song 3..}
]Error:
1
{code: 500, err: "error message"}