XiamiMusicAPI

虾米音乐 API,PHP 版
基于虾米音乐 web 端接口改写的 PHP 版本,已经对低版本 PHP 进行兼容, 建议 PHP 5.6 以上环境
本 API 为个人学习作品,请支持正版音乐,勿滥用

Function

关键字搜索 歌手热门单曲 歌曲详细信息 专辑解析 歌单解析 歌曲地址获取 歌词解析

Get Started

<?php # just download the XiamiMusicAPI.php into directory, require it with the correct path. require_once 'XiamiMusicAPI.php'; # Initialize $api = new XiamiMusicAPI(); # Get data $result = $api->search('hello'); // $result = $api->artist('23485'); // $result = $api->detail('1774998338'); // $result = $api->album('2100226190'); // $result = $api->playlist('123020403'); // $result = $api->url('1774998338'); # return JSON, just use it $data=json_decode($result); header('Content-type: application/json; charset=UTF-8'); echo json_encode($data,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);

{ "state": 0, "message": "", "request_id": "0ab6004714812906866643578e", "data": { "songs": [ { "song_id": 1774998338, "song_name": "Hello", "album_id": 2100226190, "album_name": "Hello", "album_logo": "http://img.58codes.com/202401/reavi2puho32070.jpeg", "artist_id": 23485, "artist_name": "Adele", "artist_logo": "http://img.58codes.com/202401/5vi2yu3ccan2071.jpg", "listen_file": "http://m5.file.xiami.com/485/23485/2100226190/1774998338_59030550_l.mp3?auth_key=2fb54d67cd0fae78af85c02a40e41c20-1481857200-0-null", "demo": 0, "need_pay_flag": 0, "purview_roles": [ { "quality": "l", "operation_list": [ { "purpose": 1, "upgrade_role": 0 }, { "purpose": 2, "upgrade_role": 0 } ] }, { "quality": "h", "operation_list": [ { "purpose": 1, "upgrade_role": 0 }, { "purpose": 2, "upgrade_role": 0 } ] }, { "quality": "s", "operation_list": [ { "purpose": 1, "upgrade_role": 1 }, { "purpose": 2, "upgrade_role": 1 } ] } ], "is_play": 0, "lyric": "", "play_counts": 0, "singer": "" }, ... ], "total": 14855, "previous": 0, "next": 0 } }

Link

METO Blog DEMO

License

XiamiMusicApi is under the MIT license.

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。