Skip to content

听歌足迹 - 本周/本月收听时长 ​

登录后调用此接口, 获取本周/本月收听时长

接口信息 ​

项目值
接口地址/listen/data/realtime/report
请求方式GET / POST
需要登录是
对应模块listen_data_realtime_report
文档分类听歌记录

请求参数 ​

参数类型必填默认值说明
typestring✅-维度类型 周 week 月 month; 今年没结束,不支持今年的数据

HTTP 示例 ​

bash
GET /listen/data/realtime/report?type=month

编程式调用 ​

ts
import { listenDataRealtimeReport } from 'hana-music-api';

const result = await listenDataRealtimeReport({
  type: 'month',
});

console.log(result.body);

返回内容 ​

body.code 和通到返回物的 body.data 收紧(data 是返回对象,不是某个时长字段);data 下的时长分布块、周维度的今日/好友块都是宽松字段,整块缺失或为 null 时原样返回。listenTimeDistributionBlock.durationDetails、月维度的 sleepTdBlock.sleepDurationDetails 等嵌套字段也全部宽松。录制覆盖 type=week 和 type=month,来自登录账号(context.viewer 是 authenticated);未登录时上游返回 code: 302(listen_data_realtime_report.anonymous.json)。

补充说明 ​

说明 : 登录后调用此接口, 获取本周/本月收听时长

必选参数 :

type: 维度类型 周 week 月 month; 今年没结束,不支持今年的数据

接口地址 : /listen/data/realtime/report

调用例子 : /listen/data/realtime/report?type=month

Released under the MIT License.