网易云音乐获取APINetease Music API
封装好的网易云音乐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可以从云音乐网页版获取。点开歌单或歌曲,查看浏览器地址栏,如下图:
请求地址
1 | GET https://api.yimian.xyz/msc/ |
示例
1 | //获取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"}