百度音乐API抓取

前段时间做了一个本地音乐的播放器 github地址,想实现在线播放的功能,于是到处寻找API,很遗憾,不是歌曲不全就是质量不高。在网上发现这么一个APIMRASONG博客,有“获取榜单,搜索歌词,下载地址,专辑”信息等等接口。

后来发现有些接口使用起来不是很方便,比如获取专辑信息,只能得到歌曲列表的id信息,所以自己决定用fiddler来对百度音乐安卓客户端抓包。

下面是一系列的接口:

一. 关键词建议:

GET:

 http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.catalogSug&format=json&query=%E4%B8%83%E9%87%8C%E9%A6%99

参数:

version   5.6.5.0    //版本
query   七里香//关键字
method  baidu.ting.search.catalogSug//method
fromandroid    //平台
formatjson   //format格式

返回:

{
  "song": [
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "周杰伦",
  "control": "0000000000",
  "songid": "15702101",
  "has_mv": "1",
  "encrypted_songid": "0806ef98550855dddac0"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香(live版)",
  "artistname": "周杰伦",
  "control": "0000000000",
  "songid": "18638327",
  "has_mv": "0",
  "encrypted_songid": "920711c65f70855e5be03"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "周玥178",
  "control": "0000000000",
  "songid": "121794230",
  "has_mv": "0",
  "encrypted_songid": ""
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "刘芳",
  "control": "0000000000",
  "songid": "2077664",
  "has_mv": "0",
  "encrypted_songid": "50061fb3e00854ce60db"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "网络歌手",
  "control": "0000000000",
  "songid": "28216714",
  "has_mv": "0",
  "encrypted_songid": "31071ae8d8a0854cc129e"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香(Live)",
  "artistname": "周杰伦",
  "control": "0000000000",
  "songid": "51981196",
  "has_mv": "0",
  "encrypted_songid": "58073192b8c0855ddd8da"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "汪东城",
  "control": "0000000000",
  "songid": "84961907",
  "has_mv": "0",
  "encrypted_songid": "08075106a730854cdd805"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "施艾敏",
  "control": "0000000000",
  "songid": "17565909",
  "has_mv": "0",
  "encrypted_songid": "420710c08d508559df21f"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "苏仨",
  "control": "0000000000",
  "songid": "84957626",
  "has_mv": "0",
  "encrypted_songid": "830751059ba08559df358"
},
{
  "bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
  "yyr_artist": "0",
  "songname": "七里香",
  "artistname": "陈淑桦",
  "control": "0000000000",
  "songid": "208828",
  "has_mv": "0",
  "encrypted_songid": "370532fbc0855e3ed63"
}
  ],
  "order": "song,album",
  "error_code": 22000,
  "album": [
    {
  "albumname": "七里香",
  "artistpic": "http:\/\/musicdata.baidu.com\/data2\/pic\/115430839\/115430839.jpg",
  "albumid": "67909",
  "artistname": "周杰伦"
},
{
  "albumname": "七里香(台湾正式版)",
  "artistpic": "http:\/\/a.hiphotos.baidu.com\/ting\/pic\/item\/3b292df5e0fe9925ff46084536a85edf8db17158.jpg",
  "albumid": "183906",
  "artistname": "周杰伦 "
}
  ]
}

二. 关键字搜索(包括歌曲,专辑,歌手,伴奏)

GET:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.merge&format=json&query=%E4%B8%83%E9%87%8C%E9%A6%99&page_no=1&page_size=50&type=-1&data_source=0&use_cluster=1 

参数:(下面应该很容易懂,就不具体解释了)

version     5.6.5.0
method   baidu.ting.search.merge
format   json
query    七里香
page_no  1
page_size 50
type        -1
data_source  0
use_cluster  1

返回值:

{
"error_code": 22000,
"result": {
    "query": "七里香",
    "syn_words": "",
    "rqt_type": 1,
    "song_info": {
        "total": 69,
        "song_list": [
            {
                "content": "",
                "copy_type": "1",
                "toneid": "0",
                "info": "",
                "all_rate": "320,128,flac,256,192,64,24",
                "resource_type": 2,
                "relate_status": 0,
                "has_mv_mobile": 1,
                "song_id": "18401298",
                "title": "七里香",
                "ting_uid": "7994",
                "author": "周杰伦",
                "album_id": "18394691",
                "album_title": "第五届百事音乐风云榜",
                "is_first_publish": 0,
                "havehigh": 2,
                "charge": 0,
                "has_mv": 0,
                "learn": 0,
                "song_source": "web",
                "piao_id": "0",
                "korean_bb_song": "0",
                "resource_type_ext": "0",
                "artist_id": "29",
                "all_artist_id": "29",
                "lrclink": "http://musicdata.baidu.com/data2/lrc/65094964/%E4%B8%83%E9%87%8C%E9%A6%99.lrc",
                "data_source": 0,
                "cluster_id": 93119037
            },
            {
                "content": "",
                "copy_type": "1",
                "toneid": "600902000006889283",
                "info": "",
                "all_rate": "128,64,256,192,320,flac,24",
                "resource_type": 2,
                "relate_status": 0,
                "has_mv_mobile": 1,
                "song_id": "290466",
                "title": "止战之殇.",
                "ting_uid": "7994",
                "author": "周杰伦",
                "album_id": "67909",
                "album_title": "",
                "is_first_publish": 0,
                "havehigh": 2,
                "charge": 0,
                "has_mv": 1,
                "learn": 1,
                "song_source": "web",
                "piao_id": "0",
                "korean_bb_song": "0",
                "resource_type_ext": "0",
                "artist_id": "29",
                "all_artist_id": "29",
                "lrclink": "http://musicdata.baidu.com/data2/lrc/13881596/%E6%AD%A2%E6%88%98%E4%B9%8B%E6%AE%87..lrc",
                "data_source": 0,
                "cluster_id": 93304629
            },
          ......
        ]
    },
    "album_info": {
        "total": 2,
        "album_list": [
            {
                "album_id": "67909",
                "author": "周杰伦",
                "hot": 22412,
                "title": "<em>七里香</em>",
                "artist_id": "29",
                "all_artist_id": "29",
                "company": "杰威尔JVR音乐有限公司",
                "publishtime": "2004-08-03",
                "album_desc": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《<em>七里香</em>》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“...",
                "pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg"
            },
            {
                "album_id": "183906",
                "author": "周杰伦 ",
                "hot": 10799,
                "title": "<em>七里香</em>(台湾正式版)",
                "artist_id": "29",
                "all_artist_id": "29",
                "company": "杰威尔JVR音乐有限公司",
                "publishtime": "2004-08-03",
                "album_desc": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《<em>七里香</em>》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“...",
                "pic_small": "http://c.hiphotos.baidu.com/ting/pic/item/b8389b504fc2d562b542b1f8e51190ef76c66c58.jpg"
            }
        ]
    }
}

}

三. 获取专辑详情:

GET

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.album.getAlbumInfo&format=json&album_id=67909

参数:

from  android
version   5.6.5.0
method    baidu.ting.album.getAlbumInfo
format    json
album_id  67909

返回:

{
"albumInfo": {
    "album_id": "67909",
    "author": "周杰伦",
    "title": "七里香",
    "publishcompany": "杰威尔JVR音乐有限公司",
    "prodcompany": "",
    "country": "港台",
    "language": "国语",
    "songs_total": "9",
    "info": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《七里香》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“之所以要把新专辑定名为《七里香》,是因为对这一次专辑的音乐充满自信,希望大家能把注意力焦点放在音乐上,将话题回归到音乐上。 这张《七里香》仍是周杰伦与最佳拍档方文山合作的作品。在炎热的夏天听《七里香》,有一种如沐清风的凉爽",
    "styles": "流行",
    "style_id": "3",
    "publishtime": "2004-08-03",
    "artist_ting_uid": "7994",
    "all_artist_ting_uid": null,
    "gender": "0",
    "area": "1",
    "pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg",
    "pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg",
    "hot": "",
    "favorites_num": null,
    "recommend_num": null,
    "artist_id": "29",
    "all_artist_id": "29",
    "pic_radio": "http://musicdata.baidu.com/data2/pic/115430799/115430799.jpg",
    "pic_s500": "http://musicdata.baidu.com/data2/pic/115430794/115430794.jpg",
    "pic_s1000": "http://musicdata.baidu.com/data2/pic/115430787/115430787.jpg"
},
"songlist": [
    {
        "artist_id": "29",
        "all_artist_id": "29",
        "all_artist_ting_uid": "7994",
        "language": "国语",
        "publishtime": "2004-08-03",
        "album_no": "0",
        "versions": "",
        "pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg",
        "pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg",
        "hot": "1020",
        "file_duration": "261",
        "del_status": "0",
        "resource_type": "2",
        "copy_type": "1",
        "has_mv_mobile": 0,
        "all_rate": "320,128,256,64,flac,24,192",
        "toneid": "600902000006889316",
        "country": "其他",
        "area": "4",
        "lrclink": "http://musicdata.baidu.com/data2/lrc/34239973/%E5%80%9F%E5%8F%A3..lrc",
        "song_id": "23744596",
        "title": "借口.",
        "ting_uid": "7994",
        "author": "周杰伦",
        "album_id": "67909",
        "album_title": "",
        "is_first_publish": 0,
        "havehigh": 2,
        "charge": 0,
        "has_mv": 1,
        "learn": 1,
        "song_source": "web",
        "piao_id": "0",
        "korean_bb_song": "0",
        "resource_type_ext": "0"
    },
    {
        "artist_id": "29",
        "all_artist_id": "29",
        "all_artist_ting_uid": "7994",
        "language": "国语",
        "publishtime": "2004-08-03",
        "album_no": "1",
        "versions": "",
        "pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg",
        "pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg",
        "hot": "3005",
        "file_duration": "246",
        "del_status": "0",
        "resource_type": "2",
        "copy_type": "1",
        "has_mv_mobile": 1,
        "all_rate": "64,320,128,flac,256,192,24",
        "toneid": "600902000006889292",
        "country": "其他",
        "area": "4",
        "lrclink": "http://musicdata.baidu.com/data2/lrc/13859215/%E6%88%91%E7%9A%84%E5%9C%B0%E7%9B%98-.lrc",
        "song_id": "271627",
        "title": "我的地盘-",
        "ting_uid": "7994",
        "author": "周杰伦",
        "album_id": "67909",
        "album_title": "",
        "is_first_publish": 0,
        "havehigh": 2,
        "charge": 0,
        "has_mv": 1,
        "learn": 1,
        "song_source": "web",
        "piao_id": "0",
        "korean_bb_song": "0",
        "resource_type_ext": "0"
    },
    ......
]

}

下面的只发简要说明:

1). 获取歌曲列表:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getSongList&format=json&order=2&tinguid=7994&artistid=7994&offset=0&limits=50

2). 获取专辑列表:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getAlbumList&format=json&order=1&tinguid=7994&offset=0&limits=30

3). 获取歌手信息:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getinfo&format=json&tinguid=7994&artistid=7994

4). 获取歌词以及图片:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.lrcpic&format=json&query=Apollo%27s%2BTriumph%2B%28Paul%2BDinletir%2BRemix%29$$Audio%2BMachine&ts=1444316027469&e=6Wwvzqnijq08Nrv0qI%2BN3Thp9GuKdV82ZxAS3UrvifMc%2FoVWLyZ8dSolFUF5r4W3SB2tm4z5TWT95sihhOG7qeqvjhThJWnh6h745kRGSTI%3D&type=2

1)搜索建议
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.search.catalogSug&format=json&query=%E5%B0%8F%E8%8B%B9%E6%9E%9C
搜索建议:只有歌名
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.suggestion&query=%E5%B0%8F%E8%8B%B9%E6%9E%9C&format=json&from=ios&version=2.1.1
2)搜索结果
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.search.common&format=json&query=%E5%B0%8F%E8%8B%B9%E6%9E%9C&page_no=1&page_size=30
3)
 http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.artist.getList&format=jsonℴ=1&offset=0&limit=5
 4)新歌榜
 http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.billboard.billList&format=json&type=1&offset=0&size=50
 5)热歌榜
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.billboard.billList&format=json&type=2&offset=0&size=50  注意这个和上边的区别,type=1
 6)Billboard
 http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.billboard.billList&format=json&type=8&offset=0&size=507)Hito中文榜
7)Hito中文榜
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.billboard.billList&format=json&type=18&offset=0&size=50
8)KTV热歌榜
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.billboard.billList&format=json&type=6&offset=0&size=50
9)电台列表
 http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.radio.getCategoryList&format=json
 10)获取某个电台下的歌曲列表
 http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.radio.getChannelSong&format=json&pn=0&rn=10&channelname=public_tuijian_ktv
 11)获取songid的歌曲信息
  http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.song.getInfos&format=json&songid=8059247&ts=1408284347323&e=JoN56kTXnnbEpd9MVczkYJCSx%2FE1mkLx%2BPMIkTcOEu4%3D&nw=2&ucf=1&res=1 
  12)获取登陆用户的喜爱歌曲列表,其中bduss参数用来标示唯一的用户
  http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.favorite.getFavoriteSong&format=json&pn=0&rn=50&bduss=UlXZ1dWbm9icDBrMm13aFcwZ282ejlTM1dyS1NEd2JPWXpQcDgyT0w0Vn5SUmhVQVFBQUFBJCQAAAAAAAAAAAEAAAB0L~cOeHl3MDQzNzM1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH-48FN~uPBTd
  13)歌手列表
  http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.artist.get72HotArtist&format=jsonℴ=1&offset=0&limit=50
  14)歌手简介,tinguid为歌手id
  http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.artist.getinfo&format=json&tinguid=7994
  15)歌手歌曲列表,tinguid为歌手id
  http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.artist.getSongList&format=jsonℴ=2&tinguid=7994&offset=0&limits=50
16)新碟上架
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.plaza.getRecommendAlbum&format=json&offset=0&limit=50
17)专辑信息
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.album.getAlbumInfo&format=json&album_id=122314357
18)新歌速递
http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.plaza.getNewSongs&format=json&limit=50
 

虾米音乐 / 网易云音乐 API 接口

云豆有限,请勿将该接口用于批量抓取。

虾米和网易云音乐到目前为止还没有开放 API ,网上也有一些获取的方法。这里提供一个简单的 API 接口,方便大家使用。

音乐版权归原网站所有。该 API 接口仅供个人学习研究使用,请勿用作各种商业用途。

提供了歌词/单曲/歌手/专辑/精选集(网易的歌单) 5 种接口,以下做简要介绍。

API 地址

根地址为 http://api.lostg.com

  • 虾米歌词 /music/xiami/lyrics/{id}
  • 虾米单曲 /music/xiami/songs/{id}
  • 虾米专辑 /music/xiami/albums/{id}
  • 虾米歌手 /music/xiami/artists/{id}
  • 虾米精选集 /music/xiami/collections/{id}
  • 网易歌词 /music/163/lyrics/{id}
  • 网易单曲 /music/163/songs/{id}
  • 网易专辑 /music/163/albums/{id}
  • 网易歌手 /music/163/artists/{id}
  • 网易歌单 /music/163/collections/{id}

省略网站名称,默认调用虾米音乐
例如 虾米歌词 /music/lyrics/{id}

省略接口类别,默认调用单曲音乐
例如 虾米单曲 /music/xiamis/{id}

全部省略,默认调用虾米单曲音乐
即 虾米单曲 /musics/{id}

在获取歌手,歌单,专辑时,由于歌曲数量可能出现过多的情况,返回值会比较大,因此建议通过以下方式仅获取歌曲 ID,然后通过 ID 再获取具体的歌曲信息。

  • 虾米专辑歌曲 ID /music/xiami/albums/ids/{id}
  • 虾米歌手歌曲 ID /music/xiami/artists/ids/{id}
  • 虾米精选集歌曲 ID /music/xiami/collections/ids/{id}
  • 网易专辑歌曲 ID /music/163/albums/ids/{id}
  • 网易歌手歌曲 ID /music/163/artists/ids/{id}
  • 网易歌单歌曲 ID /music/163/collections/ids/{id}

参数

  • id: 必选参数,值为单曲/专辑/歌手/精选集的 ID,歌词接口中的参数 id 为单曲 ID
  • lyric: 可选参数,值可为任意值,若包含该参数,则返回值中将包含歌词信息

建议:当歌手/专辑/精选集中包含的歌曲数目较多时,请关闭歌词信息的获取,改用歌词接口获取歌词,可节约获取时间。

返回值

返回 json 格式数据,包含以下几个字段:

  • id: 歌曲 ID
  • title: 歌曲名
  • singer: 歌手
  • album: 专辑名
  • album_pic: 专辑图片(一般尺寸)
  • album_pic_m: 专辑图片(小尺寸)
  • album_pic_l: 专辑图片(原始尺寸)
  • lyric: 歌词
  • location: 歌曲链接

网易云音乐的专辑图片仅有一种大小,三个字段的值均相同。
歌词接口返回值中仅包含歌词信息。

使用方式

建议使用 AJAX 跨域请求

例如获取虾米音乐《Mockingbird》的信息


$.ajax({
	type: "get",
	dataType: "jsonp",
	jsonp: "callback",
	url: "https://api.lostg.com/music/2088114", //默认接口为虾米单曲
	data: {
		lyric: 1
	},
	async: !1,
	success: function(b) {
				console.log(b)
			}
	});
 

演示:https://api.lostg.com/music/2088114?callback=jQuery110106158943774644285_1438935727679&&lyric=1&_=1438935727681



网易云音乐常用API浅析 | Moonlib

 

话不多说

PC客户端抓包而来

0.说明

关于头部信息

12Cookie: os=pc; deviceId=B55AC773505E5606F9D355A1A15553CE78B89FC7D8CB8A157B84; osver=Microsoft-Windows-8-Professional-build-9200-64bit; appver=1.5.0.75771; usertrack=ezq0alR0yqJMJC0dr9tEAg==; MUSIC_A=088a57b553bd8cef58487f9d01aeUser-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.138 Safari/537.36\r\n

上面是抓到的信息,其中必要的只有cookie中的appver。而且如果要调用api,必须加上Referer,只要是music.163.com的就可以

12Cookie: appver=1.5.0.75771;Referer: http://music.163.com/

以上两条即可

返回的格式均为json

 

1.搜索

抓取到的信息如下

123456789101112131415Full request URI:http://music.163.com/api/search/pcKey: hlpretagValue: Key: hlposttagValue: Key: sValue: \345\226\234\346\254\242\344\275\240Key: offsetValue: 0Key: totalValue: trueKey: limitValue: 100Key: typeValue: 1

URL:

POST http://music.163.com/api/search/pc

必要参数:

s:搜索的内容

offset:偏移量(分页用)

limit:获取的数量

type:搜索的类型

歌曲 1

专辑 10

歌手 100

歌单 1000

用户 1002

mv 1004

歌词 1006

主播电台 1009

 

2.歌曲信息

1Full request URI: http://music.163.com/api/song/detail/?id=28377211&ids=%5B28377211%5D

URL:

GET  http://music.163.com/api/song/detail/

必要参数:

id:歌曲ID

ids:不知道干什么用的,用[]括起来的歌曲ID

 

3.歌手专辑

1Full request URI: http://music.163.com/api/artist/albums/166009?id=166009&offset=0&total=true&limit=5

URL:

GET http://music.163.com/api/artist/albums/歌手ID

必要参数:

limit:获取的数量(不知道为什么这个必须加上)

 

4.专辑信息

1Full request URI: http://music.163.com/api/album/2457012?ext=true&id=2457012&offset=0&total=true&limit=10

URL:

GET http://music.163.com/api/album/专辑ID

 

5.歌单

1Full request URI: http://music.163.com/api/playlist/detail?id=37880978&updateTime=-1

URL:

GET http://music.163.com/api/playlist/detail

必要参数:

id:歌单ID

 

6.歌词

1Full request URI: http://music.163.com/api/song/lyric?os=pc&id=93920&lv=-1&kv=-1&tv=-1

URL:

GET http://music.163.com/api/song/lyric

必要参数:

id:歌曲ID

lv:值为-1,我猜测应该是判断是否搜索lyric格式

kv:值为-1,这个值貌似并不影响结果,意义不明

tv:值为-1,是否搜索tlyric格式

 

7.MV

1Full request URI: http://music.163.com/api/mv/detail?id=319104&type=mp4

URL:

GET http://music.163.com/api/mv/detail

必要参数:

id:mvid

type:值为mp4,视频格式,不清楚还有没有别的格式