接口地址
https://api.vvhan.com/api/music
返回格式
JSON
请求方式:
GET
请求示例(网易云):
https://api.vvhan.com/api/music?id=557731988&type=song&media=netease
请求示例(QQ音乐 - 音乐地址失效):
https://api.vvhan.com/api/music?id=004dVfmS2hJXwJ&type=song&media=tencent
请求示例(百度音乐 - 失效):
https://api.vvhan.com/api/music?id=612645363&type=song&media=baidu
参数说明
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
id | 是 | string | 输入音乐ID |
返回数据
{ "name": "Afternoon", "mp3url": "https://m8.music.126.net/20180516012125/e5e98062acbc1bef22cc41affa9dfbb3/ymusic/5571/9394/f0be/3b76c8b85969d78a5e730c8949ac512c.mp3", "song_id": 557731988, "cover": "https://p3.music.126.net/aP5GBmTaagcovawaSfi-7A==/109951163282935203.jpg?param=300y300", "author": "SaMZIng"}
调用实例
自行调用
示例代码
<?php
header("Content-Type:text/json;charset=UTF-8"); date_default_timezone_set("PRC"); $id = $_GET['id']; $result = file_get_contents("https://api.vvhan.com/api/music?id=" . $id . "&type=song&media=netease"); echo $result;
?>