| code | 描述 |
|---|---|
| -400 | 没有ask或search请求,或者其值为空 |
| -200 | 有ask,值错误 |
| -300 | 有search,值错误 |
| 200 | banner请求成功 |
| 201~210 | banner请求成功,根据id返回201~210 |
| 301 | search请求成功,id有结果 |
| 302 | search请求成功,name有结果 |
| 303 | search请求成功,atrist有结果 |
| 304 | search请求成功,typee有结果 |
| 350 | musicList请求成功 |
| 360 | musicAll请求成功 |
| 500 | lrcs请求成功 |
| -500 | lrcs请求失败,id错误 |
| 250 | todayMusic请求成功 |
| 260 | todayList请求成功 |
说明 : 调用此接口 , 可获取 banner( 轮播图 ) 数据
必选参数 : ask: 请求类型, 如 ask=banner
可选参数 : n或者id(两者二选一,如果同时设定n优先度高于id,可省略,默认显示5张图)。n表示要显示几张图的banner,n 取值 (2~10)之间,n不做设置或者设置错误则默认随机显示5张图。id表示要显示第几张图。当n和id同时被设置,并且都符合条件时,n的优先度大于id,即展示的是多图而非单图。只有n未设定或者n设定值不符合条件时,单独设定id展示对应banner。
接口地址 : /api.php
调用例1 : /api.php?ask=banner
返回JSON数据:
1{2 "code": 200,3 "success": true,4 "data": {5 "banners": [6 {7 "id": 2,8 "title": "True",9 "artist": "黄龄",10 "describe": "《崩坏3》印象曲",11 "pic": "banner02.jpg",12 "router": ""13 },14 {15 "id": 3,16 "title": "2014S\/S",17 "artist": "韩国男子组合WINNER",18 "describe": "首张专辑发行八周年",19 "pic": "banner03.jpg",20 "router": ""21 },22 {23 "id": 4,24 "title": "三联赛主题歌曲",25 "artist": "NINEONE",26 "describe": "这样的我,不凡且耀眼",27 "pic": "banner04.jpg",28 "router": ""29 },30 {31 "id": 8,32 "title": "银盐之地",33 "artist": "胶片摄影音乐企划",34 "describe": "影像与音乐互通共感8支乐队的自我表达",35 "pic": "banner08.jpg",36 "router": ""37 },38 {39 "id": 9,40 "title": "退潮",41 "artist": "法老",42 "describe": "那镇海塔已经成为每个退潮者的信仰",43 "pic": "banner09.jpg",44 "router": ""45 }46 ]47 }48}
调用例2 : /api.php?ask=banner&n=2
返回JSON数据:
xxxxxxxxxx241{2 "code": 200,3 "success": true,4 "data": {5 "banners": [6 {7 "id": 1,8 "title": "慢冷",9 "artist": "李荣浩",10 "describe": "每周五20:30起综艺《2022中国好声音》节目音频上云村",11 "pic": "banner01.jpg",12 "router": ""13 },14 {15 "id": 6,16 "title": "启示录",17 "artist": "邓紫棋",18 "describe": "HELLREVELATION",19 "pic": "banner06.jpg",20 "router": ""21 }22 ]23 }24}
调用例3 : /api.php?ask=banner&id=8
返回JSON数据:
xxxxxxxxxx161{2 "code": 208,3 "success": true,4 "data": {5 "banners": [6 {7 "id": 8,8 "title": "银盐之地",9 "artist": "胶片摄影音乐企划",10 "describe": "影像与音乐互通共感8支乐队的自我表达",11 "pic": "banner08.jpg",12 "router": ""13 }14 ]15 }16}
说明 : 调用此接口 , 可获取每日推荐播放列表todayList 数据
必选参数 : ask: 请求类型,如 ask=todayMusic
可选参数:n 请求数量,如 n=3,n的范围(2~5之间)没有定义或者不符合要求的n默认n=5.
接口地址 : /api.php
调用例子 : /api.php?ask=todayMusic&n=2
返回JSON数据:
xxxxxxxxxx261{2 "code": 250,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 31,8 "typee": "流行歌曲",9 "name": "平凡之路",10 "mp3": "3090647956.mp3",11 "artist": "沈腾",12 "pic": "3191513648.jpg",13 "lyric": "pfzl.json"14 },15 {16 "id": 45,17 "typee": "经典老歌",18 "name": "茉莉花",19 "mp3": "3729481986.mp3",20 "artist": "蔡琴",21 "pic": "757611618.jpg",22 "lyric": "mlh.json"23 }24 ]25 }26}
说明 : 调用此接口 , 可获取 播放列表musicList 数据
必选参数 : ask: 请求类型, 如 ask=musicList
接口地址 : /api.php
调用例子 : /api.php?ask=musicList
返回JSON数据:
x1{2 "code": 350,3 "success": true,4 "data": {5 "lists": [6 {7 "id": 1,8 "title": "爱国歌曲",9 "describe": "爱国歌曲即红色歌曲,就是赞扬和歌颂革命和祖国的歌曲,它们普遍具有浓韵的感情基调,有较强的节奏感。",10 "pic": "face01.jpg",11 "router": ""12 },13 14 {15 "id": 6,16 "title": "民歌",17 "describe": "具有民族独特文化的歌曲,是劳动人民的诗歌创作,一般是口头创作,口头流传,并在流传过程中不断经过集体的加工。是各民族文艺中的一个重要组成部分。",18 "pic": "face06.jpg",19 "router": ""20 }21 ]22 }23}
说明 : 调用此接口 , 可获取每日推荐播放列表todayList 数据
必选参数 : ask: 请求类型,如 ask=todayList,根据请求会随机返回今日推荐列表数组
接口地址 : /api.php
调用例子 : /api.php?ask=todayList
返回JSON数据:
x
1{2 "code": 260,3 "success": true,4 "data": {5 "lists": [6 {7 "id": 1,8 "title": "爱国歌曲",9 "describe": "爱国歌曲即红色歌曲,就是赞扬和歌颂革命和祖国的歌曲,它们普遍具有浓韵的感情基调,有较强的节奏感。",10 "pic": "face01.jpg",11 "router": ""12 },13 {14 "id": 2,15 "title": "流行歌曲",16 "describe": "流行歌曲popularsong缩写pop又有大众音乐之称。其结构短小、内容通俗、形式活泼、情感真挚,具有很强的时代性。",17 "pic": "face02.jpg",18 "router": ""19 },20 {21 "id": 6,22 "title": "民歌",23 "describe": "具有民族独特文化的歌曲,是劳动人民的诗歌创作,一般是口头创作,口头流传,并在流传过程中不断经过集体的加工。是各民族文艺中的一个重要组成部分。",24 "pic": "face06.jpg",25 "router": ""26 }27 ]28 }29}
说明 : 调用此接口 , 可获取 播放列表musicList 数据
必选参数 : ask: 请求类型, 如 ask=musicAll
接口地址 : /api.php
调用例子 : /api.php?ask=musicAll
返回JSON数据:
xxxxxxxxxx361{2 "code": 360,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 1,8 "typee": "爱国歌曲",9 "name": "我和我的祖国",10 "mp3": "311539060.mp3",11 "artist": "韩红&王菲",12 "pic": "3225959101.jpg",13 "lyric": "whwdzg.json"14 },15 {16 "id": 2,17 "typee": "爱国歌曲",18 "name": "我和我的祖国",19 "mp3": "a3aac97ac907d43cf547922ea2c54b68.mp3",20 "artist": "中央乐团合唱团",21 "pic": "20220328151201328031.jpg",22 "lyric": "whwdzg.json"23 },24 25 {26 "id": 50,27 "typee": "经典老歌",28 "name": "梦驼铃",29 "mp3": "23934367.mp3",30 "artist": "费玉清",31 "pic": "430813536.jpg",32 "lyric": "mtl.json"33 }34 ]35 }36}
说明 : 调用此接口 , 歌曲数据
必选参数 : search: 要查找的内容,可以是:id、歌名、演唱者、歌曲类型,id需要精准匹配,其它可以模糊匹配。 如:search=5、 search=祖国、 search=宋、search=爱国
| typee类型 | 爱国歌曲、流行歌曲、经典老歌、儿歌、纯音乐、民歌 |
|---|
接口地址 : /api.php
调用例1 : /api.php?search=爱国
返回JSON数据:
xxxxxxxxxx361{2 "code": 304,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 1,8 "typee": "爱国歌曲",9 "name": "我和我的祖国",10 "mp3": "311539060.mp3",11 "artist": "韩红&王菲",12 "pic": "3225959101.jpg",13 "lyric": "whwdzg.json"14 },15 {16 "id": 2,17 "typee": "爱国歌曲",18 "name": "我和我的祖国",19 "mp3": "a3aac97ac907d43cf547922ea2c54b68.mp3",20 "artist": "中央乐团合唱团",21 "pic": "20220328151201328031.jpg",22 "lyric": "whwdzg.json"23 },24 25 {26 "id": 13,27 "typee": "爱国歌曲",28 "name": "东方之珠",29 "mp3": "d8601426637ddf39a8eb9a27b04431b4.mp3",30 "artist": "龚玥",31 "pic": "20210114212120546258.jpg",32 "lyric": "dfzz.json"33 }34 ]35 }36}
调用例2 : /api.php?search=祖国
返回JSON数据:
xxxxxxxxxx351{2 "code": 302,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 1,8 "typee": "爱国歌曲",9 "name": "我和我的祖国",10 "mp3": "311539060.mp3",11 "artist": "韩红&王菲",12 "pic": "3225959101.jpg",13 "lyric": "whwdzg.json"14 },15 {16 "id": 2,17 "typee": "爱国歌曲",18 "name": "我和我的祖国",19 "mp3": "a3aac97ac907d43cf547922ea2c54b68.mp3",20 "artist": "中央乐团合唱团",21 "pic": "20220328151201328031.jpg",22 "lyric": "whwdzg.json"23 },24 {25 "id": 6,26 "typee": "爱国歌曲",27 "name": "歌唱祖国",28 "mp3": "3404500136.mp3",29 "artist": "中央乐团合唱团",30 "pic": "3113519207.jpg",31 "lyric": "gczg.json"32 }33 ]34 }35}调用例3 : /api.php?search=宋
返回JSON数据:
xxxxxxxxxx261{2 "code": 303,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 15,8 "typee": "经典老歌",9 "name": "难忘今宵",10 "mp3": "4103235727.mp3",11 "artist": "宋祖英",12 "pic": "3456103312.jpg",13 "lyric": "nwjx.json"14 },15 {16 "id": 42,17 "typee": "民歌",18 "name": "茉莉花",19 "mp3": "3080775735.mp3",20 "artist": "宋祖英",21 "pic": "344384746.jpg",22 "lyric": "mlh.json"23 }24 ]25 }26}调用例4 : /api.php?search=5
返回JSON数据:
xxxxxxxxxx171{2 "code": 301,3 "success": true,4 "data": {5 "songs": [6 {7 "id": 5,8 "typee": "流行歌曲",9 "name": "送你一朵小红花",10 "mp3": "3225940556.mp3",11 "artist": "小石头和孩子们",12 "pic": "3545077176.jpg",13 "lyric": "snydxhh.json"14 }15 ]16 }17}当数据不存在返回-300报错结果
调用例5 : /api.php?search=100
返回JSON数据:
xxxxxxxxxx61{2 "errMsg": "没有要查询的结果",3 "code": -300,4 "success": false,5 "data": null6}
说明 : 调用此接口 , 可获取 banner( 轮播图 ) 数据
必选参数 : ask: 请求类型, 如 ask=lrcs
必选参数 : id=n 显示id为n的歌曲歌词,如果n值错误则返回错误码
接口地址 : /api.php
调用例1 : /api.php?ask=lrcs&id=10
返回JSON数据:
xxxxxxxxxx251{2 "code": 500,3 "success": true,4 "data": {5 "lrycs": {6 "sgc": false,7 "sfy": false,8 "qfy": false,9 "lrc": {10 "version": 56,11 "lyric": "[00:00.000] 作词 : 公木\n[00:00.431] 作曲 : 刘炽\n[00:00.862]风烟滚滚唱英雄,\n[00:11.441]四面青山侧耳听 侧耳听;\n[00:22.106]晴天响雷敲金鼓,12 13 },14 "klyric": {15 "version": 0,16 "lyric": ""17 },18 "tlyric": {19 "version": 0,20 "lyric": ""21 },22 "code": 20023 }24 }25}
调用例2 : /api.php?ask=lrcs&id=100
返回JSON数据:
xxxxxxxxxx61{2 "errMsg": "id值错误",3 "code": -500,4 "success": false,5 "data": null6}