Skip to content

数字专辑&数字单曲-榜单 ​

获取数字专辑或数字单曲的日榜、周榜、年榜和总榜。

接口信息 ​

项目值
接口地址/album/songsaleboard
请求方式GET / POST
需要登录否
对应模块album_songsaleboard
文档分类专辑
上游路径/api/feealbum/songsaleboard/${type}/type

请求参数 ​

参数类型必填默认值说明
albumTypenumber—0榜单对象类型,0 为数字专辑,1 为数字单曲
typestring—daily榜单周期,可选 daily、week、year、total
yearnumber—-当 type=year 时使用,表示年份

HTTP 示例 ​

bash
GET /album/songsaleboard
GET /album/songsaleboard?type=year&year=2020&albumType=0

编程式调用 ​

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

const result = await albumSongsaleboard({
  type: 'year',
  year: 2020,
  albumType: 0,
});

console.log(result.body);

返回内容 ​

body.code、body.products 和每条记录的 products[].albumId 收紧;albumName、saleNum、rank、rankIncr、salesCertificationSystemLevelCode 等其余字段宽松,hasMore 只有 year/total 榜单才有,同样是宽松字段。未来年份(如 year=2030)是真实空榜:products: []、hasMore: false;albumType=99 的周榜也是空榜,但连 hasMore 都没有。daily/week 不带 hasMore(album_songsaleboard.week.json),两种形态写进同一个结构。结构定义和类型是 AlbumSongsaleboardBody,见 返回体结构。

Released under the MIT License.