这个接口是以JSON和XML做返回值处理的,默认为返回JSON。
API接口返回值为JSON:
返回为 JSON 请求地址是:
http://www.sojson.com/api/qqmusic/8446666
REST 风格 API ,后面的数字是QQ号,默认返回 JSON ,也可以这样:
http://www.sojson.com/api/qqmusic/8446666/json
请求 JSON 的返回值如下,带一个状态status,如果错误会返回500,成功返回200:
{
"status": 200,
"data": {
"curtime": "1469025820",
"issmarter": "0",
"xmusicnum": "3",
"picurl": [],
"playlist": [
{
"xqusic_mid": "000aB5HG4dioBi ",
"xqusic_id": "4831024",
"xctype": "3",
"xexpire_time": "0",
"xdesc": " ",
"xsong_name": "海誓山盟亦会分开 ",
"xsinger_name": "本兮 ",
"xsong_url": "http://stream6.qqmusic.qq.com/16831024.wma ",
"xsong_size": "2496570",
"xsong_playtime": "289",
"xsong_diskname": "无底线 ",
"xsong_dissmid": [
"004LrhoF44bRf2 ",
"004LrhoF44bRf2 "
],
"xsong_dissid": "193826",
"xis_word": "0",
"xcopy_right": "0",
"xsinger_id": "4545",
"xsinger_mid": "003LaMHm42u7qS "
},
{
"xqusic_mid": "0019kz9c1QBWNA ",
"xqusic_id": "2633764432",
"xctype": "1",
"xexpire_time": "0",
"xdesc": " ",
"xsinger_name": "文艺范电台 ",
"xsong_name": "文艺范电台 ",
"xsong_url": "http://img.wenyifan.net/20131221/5/1387627094890.mp3 ",
"xsong_size": "0",
"xsong_playtime": "0",
"xsong_diskname": "0",
"xsong_dissmid": "0047airw212ppN ",
"xsong_dissid": "0",
"xis_word": "-999",
"xcopy_right": "-999",
"xsinger_id": "-999"
},
{
"xqusic_mid": "001rVHgt15aRmM ",
"xqusic_id": "699379606",
"xctype": "5",
"xexpire_time": "0",
"xdesc": " ",
"xsinger_name": "soso ",
"xsong_name": "8446666.mp3 ",
"xsong_url": "http://streamrdt.music.qq.com/8138.83a798500d5cb2b63f442ec3ee215a8d/1081067841469025820/8138.83a798500d.html ",
"xsong_size": "0",
"xsong_playtime": "0",
"xsong_diskname": "0",
"xsong_dissmid": "0047airw212ppN ",
"xsong_dissid": "0",
"xis_word": "-999",
"xcopy_right": "-999",
"xsinger_id": "-999"
}
],
"systemtime": "1469025820"
},
"type": "json"
}
API接口返回值为XML:
如果需要返回 XML :
http://www.sojson.com/api/qqmusic/8446666/xml
请求 XML 的返回值如下,带一个状态status,如果错误会返回500,成功返回200:
{
"status": 200,
"data": "\n\n1469025922 \n0 \n3 \n4831024 \n3 \n0 \n \n \n \n \n2496570 \n289 \n \n \n193826 \n0 \n0 \n4545 \n \n \n \n2633764432 \n1 \n0 \n \n \n \n \n0 \n0 \n0 \n \n0 \n-999 -999 -999 \n699379606 \n5 \n0 \n \n \n \n \n0 \n0 \n0 \n \n0 \n-999 -999 -999 1469025922 \n \n",
"type": "xml"
}
返回也是 JSON 的,只不过 XML 在 data 里。
恩,虽然没啥用,但是可以看看你的女/男神最近在听什么歌。。。。。聊胜于无。。。。
注:点我查看原网页。