此接口会根据接入用户的平台音乐使用数据、音乐行业热度数据综合计算,向接入平台推荐符合平台调性的热门音乐内容。
GET
以下请求参数列表仅列出了部分公共参数,完整公共参数列表见 公共参数列表
参数名 | 类型 | 是否必传 | 说明 |
---|
X-HF-Action | String | 是 | 操作的接口名称,本接口取值:BaseHot。 |
X-HF-Version | String | 是 | 操作的 API 的版本,本接口取值:V4.1.1。 |
参数名 | 类型 | 是否必传 | 说明 | 可选值 | 示例 |
---|
StartTime | Long | 是 | 10位秒级时间戳 | - | 1591696315 |
Duration | Int | 是 | 距离StartTime过去的天数 | 1~365 | 365 |
Page | Int | 否 | 当前页码,默认为1 | 大于0的整数 | 1 |
PageSize | Int | 否 | 每页显示条数,默认为10 | 1~100 | 10 |
HFClient client = new DefaultHFClient(url, appkey, secret);
HFBaseHotRequest request = new HFBaseHotRequest();
request.setMethod(HFRequest.METHOD_GET);
request.setPage(1);
request.setPageSize(10);
request.setStartTime(1594639058L);
request.setDuration(183);
request.setClientId("hf2y7jk19a56qetq05");
try {
HFBaseHotResponse response = client.execute(request);
System.out.println(JSON.toJSON(response));
} catch (ApiException e) {
e.printStackTrace();
}
字段 | 名称 | 重要性 | 说明 |
---|
code | 状态 | 必须 | 200-成功 |
msg | 消息描述 | 必须 | 消息描述 |
data | 统一的数据对象 | 必须 | json格式 |
record | 推荐音乐 | - | json数组 |
musicId | 音乐id | - | 1D61C690142 |
musicName | 音乐名 | - | The Gift Of Christmas |
albumId | 专辑id | - | 1D61C681B4F |
albumName | 专辑名 | - | A Hint Of Christmas |
artist | 此字段可能返回为[],表演者 | - | json数组 |
name | 表演者 | - | 王大 |
code | 表演者编号 | - | 1D61C690142 |
avatar | 表演者头像 | - | https://url.jpg |
author | 此字段可能返回为[],作词者 | - | json数组 |
name | 作词者 | - | 王大 |
code | 作词者编号 | - | 1D61C690142 |
avatar | 作词者头像 | - | https://url.jpg |
composer | 此字段可能返回为[],作曲者 | - | json数组 |
name | 作曲者 | - | 王大 |
code | 作曲者编号 | - | 1D61C690142 |
avatar | 作曲者头像 | - | https://url.jpg |
arranger | 此字段可能返回为[],编曲者 | - | json数组 |
name | 编曲者 | - | 王大 |
code | 编曲者 | - | 1D61C690142 |
avatar | 编曲者头像 | - | https://url.jpg |
cover | 封面 | - | json数组 |
url | 封面地址 | - | https://url.jpg |
size | 封面尺寸,该字段可能为"",代表没有设置尺寸 | - | 200 |
duration | 时长(秒),此字段可能和播放器读取时长有一定误差 | - | 120 |
auditionBegin | 推荐试听开始时间 | - | 46 |
auditionEnd | 推荐试听结束时间 | - | 90 |
bpm | 每分钟节拍 | - | 108 |
tag | 标签数组 | - | json数组 |
tagId | 标签ID | - | 1 |
tagName | 标签名称 | - | 20 |
child | 子标签数组[],属性同tag | - | json数组 |
version | 版本信息 | - | json数组 |
musicId | 音乐id | - | 1D61C690142 |
name | 版本名称 | - | The Gift Of Christmas |
majorVersion | 是否为主版本,1:是 0:否 | - | 1 |
free | 1:免费0:收费 | - | 1 |
price | 音乐价格(分) | - | 0 |
duration | 时长(秒) | - | 120 |
auditionBegin | 推荐试听开始时间 | - | 46 |
auditionEnd | 推荐试听结束时间 | - | 90 |
meta | 分页数据 | - | json数组 |
totalCount | 总记录数 | - | 80 |
currentPage | 当前页数 | - | 1 |
taskId | 任务id | 必须 | - |
curl -G https://gateway-open.haifanwu.com -H "Authorization:HF3-HMAC-SHA1 Signature=4D05EB0F4B66D92B18A07FA742AE6A8A" -H "X-HF-ClientId:hf2y7jk19a56qetq05" -H "X-HF-AppId:170ae316b9b14c1b9c185988771bde16" -H "X-HF-Action:BaseHot" -H "X-HF-Timestamp:1595820874901" -H "X-HF-Version:V4.1.1" -H "X-HF-Nonce:rmwSKNTGoqqBVauyldrugnWyKXroAfRz"
-X GET -d "Duration=183&Page=1&PageSize=20&StartTime=1594639058"
{
"code": 10200,
"msg": "操作成功",
"data": {
"record": [{
"musicId": "4B40E8CB4",
"musicName": "碇元初步",
"albumId": "242016",
"albumName": "EVA 芬克家族",
"duration": 0,
"bpm": 0,
"auditionBegin": 0,
"auditionEnd": 0,
"tag": [{
"tagId": 5439,
"tagName": "流行 Pop",
"child": []
}, {
"tagId": 5440,
"tagName": "-",
"child": []
}],
"cover": [{
"url": "https://static-hifiveai-open.haifanwu.com/artwork/COPYRIGHT/4B40E8C95/4B40E8C95.jpg",
"size": ""
}],
"artist": [{
"name": "杰西",
"code": "1D652A73C86",
"avatar": "https://static-hifiveai-open.haifanwu.com/artist/default.png?sign=d321bfd394d017371f0da506aa4b3550&t=1595818666"
}],
"author": [],
"composer": [{
"name": "杰西",
"code": "1D652A73C86",
"avatar": "https://static-hifiveai-open.haifanwu.com/artist/default.png?sign=d321bfd394d017371f0da506aa4b3550&t=1595818666"
}],
"arranger": [],
"version": [{
"name": "主版本",
"musicId": "4B40E8CB4",
"free": 0,
"price": 48000,
"majorVersion": true,
"duration": 0,
"auditionBegin": 0,
"auditionEnd": 0
}]
}, {
"musicId": "4B40E8CBD",
"musicName": "风吹玉米田",
"albumId": "242016",
"albumName": "EVA 芬克家族",
"duration": 0,
"bpm": 0,
"auditionBegin": 0,
"auditionEnd": 0,
"tag": [{
"tagId": 5439,
"tagName": "流行 Pop",
"child": []
}, {
"tagId": 5440,
"tagName": "-",
"child": []
}],
"cover": [{
"url": "https://static-hifiveai-open.haifanwu.com/artwork/COPYRIGHT/4B40E8C95/4B40E8C95.jpg",
"size": ""
}],
"artist": [{
"name": "杰西",
"code": "1D652A73C86",
"avatar": "https://static-hifiveai-open.haifanwu.com/artist/default.png?sign=d321bfd394d017371f0da506aa4b3550&t=1595818666"
}],
"author": [],
"composer": [{
"name": "杰西",
"code": "1D652A73C86",
"avatar": "https://static-hifiveai-open.haifanwu.com/artist/default.png?sign=d321bfd394d017371f0da506aa4b3550&t=1595818666"
}],
"arranger": [],
"version": [{
"name": "主版本",
"musicId": "4B40E8CBD",
"free": 0,
"price": 48000,
"majorVersion": true,
"duration": 0,
"auditionBegin": 0,
"auditionEnd": 0
}]
}],
"meta": {
"totalCount": 2,
"currentPage": 1
}
},
"taskId": "11ac24b6f8714833ad74e988367697b9"
}