百度音乐免费API接口

隐身守侯 提交于 2019-12-28 23:42:52

音乐分类:

1、新歌榜,2、热歌榜,
11、摇滚榜,12、爵士,16、流行
21、欧美金曲榜,22、经典老歌榜,23、情歌对唱榜,24、影视金曲榜,25、网络歌曲榜


说明:
百度music web版全接口
http://tingapi.ting.baidu.com/v1/restserver/ting


获取方式:GET
参数:
format: json|xml
callback:
from: webapp_music
method:

//获取列表
baidu.ting.billboard.billList {type:1,size:10, offset:0}
type: //1、新歌榜,2、热歌榜,
11、摇滚榜,12、爵士,16、流行
21、欧美金曲榜,22、经典老歌榜,23、情歌对唱榜,24、影视金曲榜,25、网络歌曲榜
size: 10 //返回条目数量
offset: 0 //获取偏移

//貌似是推广,无用
baidu.ting.adv.showlist { _: (new Date)}
_: //时间戳

//搜索
baidu.ting.search.catalogSug { query: keyword }
query: '' //搜索关键字

//播放
baidu.ting.song.play {songid: id}
baidu.ting.song.playAAC {songid: id}

//LRC歌词
baidu.ting.song.lry {songid: id}

//推荐列表
baidu.ting.song.getRecommandSongList {song_id: id, num: 5 }
num: //返回条目数量

//下载
baidu.ting.song.downWeb {songid: id, bit:"24, 64, 128, 192, 256, 320, flac", _t: (new Date())}
songid: //歌曲id
bit: //码率
_t: //时间戳

//获取歌手信息
baidu.ting.artist.getInfo { tinguid: id }
tinguid: //歌手ting id

//获取歌手歌曲列表
baidu.ting.artist.getSongList { tinguid: id, limits:6, use_cluster:1, order:2}
tinguid: //歌手ting id
limits: //返回条目数量

json数据格式参考如下:
1.
获取榜单专辑:
http://tingapi.ting.baidu.com/v1/restserver/ting?size=20&type=2&callback=cb_list&_t=1468380543284&format=json&method=baidu.ting.billboard.billList

[
{
"artist_id": "88",
"language": "\u56fd\u8bed",
"pic_big": "http:\/\/musicdata.baidu.com\/data2\/pic\/8ed6c0b266f41eacdf69c9018c52ec1e\/241838023\/241838023.jpg",
"pic_small": "http:\/\/musicdata.baidu.com\/data2\/pic\/cf635d76f825044a19656e990dda77d5\/241838026\/241838026.jpg",
"country": "\u5185\u5730",
"area": "0",
"publishtime": "2015-05-20",
"album_no": "1",
"lrclink": "http:\/\/musicdata.baidu.com\/data2\/lrc\/ac66a881bd5cb97ad351936606c37495\/266097259\/266097259.lrc",
"copy_type": "1",
"hot": "1471582",
"all_artist_ting_uid": "2517",
"resource_type": "0",
"is_new": "0",
"rank_change": "0",
"rank": "1",
"all_artist_id": "88",
"style": "\u6d41\u884c",
"del_status": "0",
"relate_status": "0",
"toneid": "0",
"all_rate": "64,128,192,256,320,flac",
"sound_effect": "0",
"file_duration": 0,
"has_mv_mobile": 0,
"versions": "",
"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
"song_id": "242078437",
"title": "\u6f14\u5458",
"ting_uid": "2517",
"author": "\u859b\u4e4b\u8c26",
"album_id": "241838068",
"album_title": "\u7ec5\u58eb",
"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",
"mv_provider": "0000000000",
"artist_name": "\u859b\u4e4b\u8c26"
},
{
"artist_id": "88",
"language": "\u56fd\u8bed",
"pic_big": "http:\/\/musicdata.baidu.com\/data2\/pic\/14c544e32bef326d54e0de16f0e3858f\/266259604\/266259604.jpg",
"pic_small": "http:\/\/musicdata.baidu.com\/data2\/pic\/e3ed2790a7eba2e7f7b0e85880a0e99e\/266259607\/266259607.jpg",
"country": "\u5185\u5730",
"area": "0",
"publishtime": "2016-06-07",
"album_no": "1",
"lrclink": "http:\/\/musicdata.baidu.com\/data2\/lrc\/a4014c4e7937cc48cc79bf77d42a4e0e\/266259963\/266259963.lrc",
"copy_type": "1",
"hot": "940241",
"all_artist_ting_uid": "2517",
"resource_type": "0",
"is_new": "0",
"rank_change": "0",
"rank": "2",
"all_artist_id": "88",
"style": "\u6d41\u884c",
"del_status": "0",
"relate_status": "0",
"toneid": "0",
"all_rate": "64,128,256,320,flac",
"sound_effect": "0",
"file_duration": 0,
"has_mv_mobile": 0,
"versions": "",
"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}",
"song_id": "266259728",
"title": "\u521a\u521a\u597d",
"ting_uid": "2517",
"author": "\u859b\u4e4b\u8c26",
"album_id": "266259670",
"album_title": "\u521a\u521a\u597d",
"is_first_publish": 0,
"havehigh": 2,
"charge": 0,
"has_mv": 1,
"learn": 0,
"song_source": "web",
"piao_id": "0",
"korean_bb_song": "0",
"resource_type_ext": "0",
"mv_provider": "1000000000",
"artist_name": "\u859b\u4e4b\u8c26"
}
],
"billboard": {
"billboard_type": "2",
"billboard_no": "1895",
"update_date": "2016-07-13",
"billboard_songnum": "588",
"havemore": 1,
"name": "\u70ed\u6b4c\u699c",
"comment": "\u8be5\u699c\u5355\u662f\u6839\u636e\u767e\u5ea6\u97f3\u4e50\u5e73\u53f0\u6b4c\u66f2\u6bcf\u5468\u64ad\u653e\u91cf\u81ea\u52a8\u751f\u6210\u7684\u6570\u636e\u699c\u5355\uff0c\u7edf\u8ba1\u8303\u56f4\u4e3a\u767e\u5ea6\u97f3\u4e50\u5e73\u53f0\u4e0a\u7684\u5168\u90e8\u6b4c\u66f2\uff0c\u6bcf\u65e5\u66f4\u65b0\u4e00\u6b21",
"pic_s640": "http:\/\/b.hiphotos.baidu.com\/ting\/pic\/item\/5d6034a85edf8db1194683910b23dd54574e74df.jpg",
"pic_s444": "http:\/\/d.hiphotos.baidu.com\/ting\/pic\/item\/c83d70cf3bc79f3d98ca8e36b8a1cd11728b2988.jpg",
"pic_s260": "http:\/\/a.hiphotos.baidu.com\/ting\/pic\/item\/838ba61ea8d3fd1f1326c83c324e251f95ca5f8c.jpg",
"pic_s210": "http:\/\/business.cdn.qianqian.com\/qianqian\/pic\/bos_client_58c1700bf56062108d8d622a95708032.jpg",
"web_url": "http:\/\/music.baidu.com\/top\/dayhot"
},
"error_code": 22000
});

2.
获取榜单播放地址:
http://music.baidu.com/data/music/fmlink?rate=320&songIds=242078437&type=&callback=cb_download&_t=1468380564513&format=json


cb_download({
"errorCode": 22000,
"data": {
"xcode": "6b3f423c71d7cd622a7250ec29f7e010",
"songList": [
{
"queryId": "242078437",
"songId": 242078437,
"songName": "\u6f14\u5458",
"artistId": "2517",
"artistName": "\u859b\u4e4b\u8c26",
"albumId": 241838068,
"albumName": "\u7ec5\u58eb",
"songPicSmall": "http:\/\/musicdata.baidu.com\/data2\/pic\/cf635d76f825044a19656e990dda77d5\/241838026\/241838026.jpg",
"songPicBig": "http:\/\/musicdata.baidu.com\/data2\/pic\/8ed6c0b266f41eacdf69c9018c52ec1e\/241838023\/241838023.jpg",
"songPicRadio": "http:\/\/musicdata.baidu.com\/data2\/pic\/ac965fb4d028ee0557512c8e93f99e6c\/241838020\/241838020.jpg",
"lrcLink": "http:\/\/musicdata.baidu.com\/data2\/lrc\/ac66a881bd5cb97ad351936606c37495\/266097259\/266097259.lrc",
"version": "",
"copyType": 0,
"time": 261,
"linkCode": 22000,
"songLink": "http:\/\/yinyueshiting.baidu.com\/data2\/music\/242078559\/242078437133200128.mp3?xcode=6b3f423c71d7cd6221ec55f2ef944ac8",
"showLink": "http:\/\/yinyueshiting.baidu.com\/data2\/music\/242078559\/242078437133200128.mp3?xcode=6b3f423c71d7cd6221ec55f2ef944ac8",
"format": "mp3",
"rate": 128,
"size": 4181731,
"relateStatus": "0",
"resourceType": "0",
"source": "web"
}
]
}
})

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!