网易云新歌榜
# 接口信息
- 接口状态 : 正常
- 请求方式 :
GET
- 返回格式 :
JSON
- 扣除Gong币数 :
1
# 请求地址
http://gateway.gtcbaba.icu/api/wyy
1
# 请求参数
参数名 | 必选 | 类型 | 描述 |
---|---|---|---|
无 | 否 | 无 | 直接请求 |
# 响应参数
参数名称 | 类型 | 描述 |
---|---|---|
code | int | 响应码 |
data.sort | string | 来源 |
data.info.id | string | 歌曲id |
data.info.name | string | 歌名 |
data.info.author | string | 歌手 |
data.info.picUrl | string | 封面 |
data.info.url | string | 歌曲播放地址 |
message | string | 响应描述 |
# 代码示例
注意 🔔️
没有开发者调用凭证无法调用接口哦!!! 前往个人中心获取开发者凭证 (opens new window)
注入Manager
@Resource
private GtcApiManager gtcApiManager;
1
2
2
- 示例一 :推荐👍
通过yml配置开发者调用凭证
public BasicResponse getWyy() {
BasicResponse wyyInfo = null;
try {
wyyInfo = gtcApiManager.getWyy();
System.out.println("得到歌曲信息: " + wyyInfo);
} catch (ApiException e) {
log.error(e.getMessage());
}
return wyyInfo;
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
- 示例二:不推荐👎
手动实例化
public BasicResponse getWyy() {
GtcApiClient client = new GtcApiClient("您的AccessKey", "您的SecretKey");
GtcApiManager gtcApiManager = new GtcApiManager();
gtcApiManager.setGtcApiClient(client);
BasicResponse wyyInfo = null;
try {
wyyInfo = gtcApiManager.getWyy();
System.out.println("得到歌曲信息: " + wyyInfo);
} catch (ApiException e) {
log.error(e.getMessage());
}
return wyyInfo;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
响应示例:
{
"sort": "新歌榜",
"info": {
"id": 2608471890,
"name": "守村人",
"author": "薛之谦",
"pic_url": "https://p2.music.126.net/rOG1a5E2VX2KknLbFGz9Jg==/109951169787102690.jpg",
"url": "https://music.163.com/song/media/outer/url?id=2608471890"
}
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10