Baidu Music API

Source: Internet
Author: User
Tags cdata

1, through the keyword, get the list.
http://mp3.baidu.com/dev/Api/?tn=getinfo&ct=0&ie=utf-8&word=<word>&format=<format >
Parameters:
Word: "Song name",//song name encodeURI

Format: "JSON",//Return data format, XML | JSON, default XML

Callback: "Pub.music.searchResult",//fixed value, return JSONP format


As in XML format:
Http://mp3.baidu.com/dev/api/?tn=getinfo&ct=0&word=%E6%B5%81%E6%B5%AA%E8%AE%B0&ie=utf-8&format =xml

Return:

<res>
<song><! [Cdata[Wandering Kee]]></song>
<song_id><! [cdata[38233821]]></song_id>
<singer><! [Cdata[Aska]]></singer>
<album><! [Cdata[I am the singer 11th issue]]></album>
<singerpiclarge><! [cdata[http://qukufile2.qianqian.com/data2/pic/36218335/36218335.jpg]]></singerpiclarge>
<singerpicsmall><! [cdata[http://qukufile2.qianqian.com/data2/pic/36218344/36218344.jpg]]></singerpicsmall>
<albumpiclarge><! [cdata[]]></albumpiclarge>
<albumpicsmall><! [cdata[]]></albumpicsmall>
</res>

JSON format: Http://mp3.baidu.com/dev/api/?tn=getinfo&ct=0&word=%E6%B5%81%E6%B5%AA%E8%AE%B0&ie=utf-8 &format=json

Return:

{"Song": "\u6d41\u6d6a\u8bb0","SONG_ID": "38233821","Singer": "\u6768\u5b97\u7eac","Album":  "\u6211\u662f\u6b4c\u624b \u7b2c\u5341\u4e00\u671f" , "Singerpicsmall" :  "Http:\/\/qukufile2.qianqian.com\/data2\/pic\/36218344\/36218344.jpg" ,< span class= "str" > "Singerpiclarge" :  http:\/\/ Qukufile2.qianqian.com\/data2\/pic\/36218335\/36218335.jpg ", "Albumpiclarge" :  ",< Span class= "PLN" > "Albumpicsmall" : }            



2. Get the song by Song ID (song_id):
Http://ting.baidu.com/data/music/links?songids=<songids>
Get mode get:
Parameters:

Songids: "38233821"//song ID, the song ID obtained from the 1th list

Callback: "Callback"//Is not empty, returns JSONP format data

such as: http://ting.baidu.com/data/music/links?songIds=38233821

Return:

{"ErrorCode": 22000,"Data": {"Xcode": "808f67065a7ea25b17e77954bed13215","SongList": [{"Queryid": "38233821","SongID": 38233821,"Songname": "\u6d41\u6d6a\u8bb0","ArtistID": "8477","Artistname": "\u6768\u5b97\u7eac","albumID": 38233662,"Albumname": "\u6211\u662f\u6b4c\u624b \u7b2c\u5341\u4e00\u671f","Songpicsmall": "Http:\/\/c.hiphotos.baidu.com\/ting\/pic\/item\/29381f30e924b899d068ee4b6f061d950a7bf669.jpg","Songpicbig": "Http:\/\/c.hiphotos.baidu.com\/ting\/pic\/item\/2f738bd4b31c8701d1e22595267f9e2f0708ff69.jpg","Songpicradio": "Http:\/\/c.hiphotos.baidu.com\/ting\/pic\/item\/b21bb051f81986185f1378f74bed2e738bd4e669.jpg","Lrclink": "\/DATA2\/LRC\/38238568\/38238568.LRC ","Version": "\U73B0\U573A","Copytype": 1,"Time": 309,"Linkcode": 22000,"Songlink": "Http:\/\/zhangmenshiting.baidu.com\/data2\/music\/38542270\/382338211365422461.mp3","ShowLink": "Http:\/\/zhangmenshiting.baidu.com\/data2\/music\/38542270\/382338211365422461.mp3?xcode= 808f67065a7ea25b17e77954bed13215 ", "format" :  " MP3 "," rate ":  128, "size" :  4984113, "relatestatus" :   "0" , "ResourceType" Span class= "pun" >:  "0" }] }}       /span>                

Note: MP3 is songlink, followed by the Xcode parameter, and Xcode is automatically updated once per second.

Such as:

HTTP://zhangmenshiting.baidu.com/data2/music/38542270/382338211365422461.  Mp3? xcode=808f67065a7ea25b17e77954bed13215    

Baidu Music API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.