网易云歌曲播放信息
查询网易云歌曲播放信息
接口信息
GET
mini10.top/api/privilege.php
Method
GET
分类
音乐
Calls
5
KEY
无需 KEY
计费
免费
QPM
不限制
鉴权方式
无需密钥
作者
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| ids | string | 是 | 歌曲id(可批量查询,用`,`隔开即可) | 21233962 |
[
{
"name": "ids",
"type": "string",
"required": true,
"description": "歌曲id(可批量查询,用`,`隔开即可)",
"example": "21233962"
}
]
{"openapi":"3.1.1","info":{"title":"网易云歌曲播放信息","description":"查询网易云歌曲播放信息","version":"1.0.0"},"paths":{"/api/privilege.php":{"get":{"summary":"网易云歌曲播放信息","description":"查询网易云歌曲播放信息","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","example":"21233962"},"description":"歌曲id(可批量查询,用`,`隔开即可)"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"servers":[{"url":"https://mini10.top","description":"当前访问入口(https)"}]}
返回示例
{
"data": [
{
"id": 21233962,
"fee": 0,
"payed": 0,
"st": -100,
"pl": 0,
"dl": 0,
"sp": 7,
"cp": 0,
"subp": 1,
"cs": false,
"maxbr": 999000,
"fl": 0,
"toast": false,
"flag": 4,
"preSell": false,
"playMaxbr": 999000,
"downloadMaxbr": 999000,
"maxBrLevel": "lossless",
"playMaxBrLevel": "lossless",
"downloadMaxBrLevel": "lossless",
"plLevel": "none",
"dlLevel": "none",
"flLevel": "none",
"rscl": 0,
"freeTrialPrivilege": {
"resConsumable": true,
"userConsumable": false,
"listenType": null,
"cannotListenReason": 1,
"playReason": null,
"freeLimitTagType": null
},
"rightSource": 0,
"chargeInfoList": [
{
"rate": 128000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 192000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 320000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 999000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
}
],
"code": 0,
"message": null,
"plLevels": null,
"dlLevels": null,
"ignoreCache": null,
"bd": null
}
],
"code": 200
}
接口反馈
网易云歌曲播放信息
接口说明
查询指定网易云歌曲的播放信息,用于获取歌曲的可播放状态与音质相关权限数据。适合需要展示或判断歌曲播放条件的音乐类应用调用。
调用地址
https://mini10.top/api/privilege.php
请求方式
GET
鉴权说明
本接口无需密钥,可直接调用,且不产生费用。
请求参数
调用地址:https://mini10.top/api/privilege.php,请求方式:GET。本接口无需密钥,可直接调用。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | string | 是 | 歌曲 id,支持批量查询,多个 id 之间用英文逗号 , 分隔,如 21233962 或 21233962,12345678 |
参数取值说明:
ids必须是纯数字的歌曲 id,不要包含空格或中文逗号。- 批量查询时建议单次传入数量不宜过多,以免请求地址过长。
- 返回结果中的歌曲顺序与传入 id 的顺序不一定一致,可按返回项中的
id字段对应。
成功响应示例
{
"data": [
{
"id": 21233962,
"fee": 0,
"payed": 0,
"st": -100,
"pl": 0,
"dl": 0,
"sp": 7,
"cp": 0,
"subp": 1,
"cs": false,
"maxbr": 999000,
"fl": 0,
"toast": false,
"flag": 4,
"preSell": false,
"playMaxbr": 999000,
"downloadMaxbr": 999000,
"maxBrLevel": "lossless",
"playMaxBrLevel": "lossless",
"downloadMaxBrLevel": "lossless",
"plLevel": "none",
"dlLevel": "none",
"flLevel": "none",
"rscl": 0,
"freeTrialPrivilege": {
"resConsumable": true,
"userConsumable": false,
"listenType": null,
"cannotListenReason": 1,
"playReason": null,
"freeLimitTagType": null
},
"rightSource": 0,
"chargeInfoList": [
{
"rate": 128000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 192000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 320000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
},
{
"rate": 999000,
"chargeUrl": null,
"chargeMessage": null,
"chargeType": 1
}
],
"code": 0,
"message": null,
"plLevels": null,
"dlLevels": null,
"ignoreCache": null,
"bd": null
}
],
"code": 200
}
响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| code | number | 接口返回状态,200 表示请求成功 |
| data | array | 歌曲播放信息列表,按请求的 ids 顺序返回,每个元素对应一首歌曲 |
data 数组元素字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| id | number | 歌曲 id |
| fee | number | 歌曲收费类型标识 |
| payed | number | 是否已付费标识 |
| st | number | 歌曲状态值 |
| pl | number | 播放码率权限标识 |
| dl | number | 下载码率权限标识 |
| sp | number | 歌曲音质相关标识 |
| cp | number | 版权相关标识 |
| subp | number | 是否存在替代版本标识 |
| cs | boolean | 是否为云盘歌曲 |
| maxbr | number | 可获取的最高码率 |
| fl | number | 免费试听相关标识 |
| toast | boolean | 是否需提示文案 |
| flag | number | 权限标记值 |
| preSell | boolean | 是否为预售歌曲 |
| playMaxbr | number | 可播放的最高码率 |
| downloadMaxbr | number | 可下载的最高码率 |
| maxBrLevel | string | 最高码率对应音质等级,如 lossless |
| playMaxBrLevel | string | 可播放音质等级 |
| downloadMaxBrLevel | string | 可下载音质等级 |
| plLevel | string | 当前播放权限等级,无权限时为 none |
| dlLevel | string | 当前下载权限等级,无权限时为 none |
| flLevel | string | 免费试听音质等级,无权限时为 none |
| rscl | number | 资源相关标识 |
| freeTrialPrivilege | object | 免费试听权限信息 |
| rightSource | number | 权限来源标识 |
| chargeInfoList | array | 各码率档位的收费信息列表 |
| code | number | 单首歌曲的返回状态 |
| message | string | 单首歌曲的附加信息,无内容时为 null |
| plLevels | string | 播放等级扩展信息,无内容时为 null |
| dlLevels | string | 下载等级扩展信息,无内容时为 null |
| ignoreCache | string | 缓存忽略相关标记,无内容时为 null |
| bd | string | 扩展字段,无内容时为 null |
freeTrialPrivilege 对象字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| resConsumable | boolean | 资源是否可消费(可试听) |
| userConsumable | boolean | 用户是否可消费 |
| listenType | string | 试听类型,无内容时为 null |
| cannotListenReason | number | 不可收听的原因标识 |
| playReason | string | 播放原因说明,无内容时为 null |
| freeLimitTagType | string | 免费限制标签类型,无内容时为 null |
chargeInfoList 数组元素字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| rate | number | 码率,如 128000、192000、320000、999000 |
| chargeUrl | string | 购买地址,无内容时为 null |
| chargeMessage | string | 收费提示信息,无内容时为 null |
| chargeType | number | 收费方式标识 |
错误响应示例
接口在参数缺失、接口不存在或服务异常等情况下,会返回统一的 JSON 错误结构。响应体固定包含 code、msg、errcode 三个字段:code 为响应状态标识,msg 为可读的错误说明,errcode 为业务错误码。
{
"code": 0,
"msg": "请求参数错误",
"errcode": 11012
}
当所请求的接口处于维护状态时,返回示例:
{
"code": 0,
"msg": "接口维护中",
"errcode": 11006
}
当服务整体暂不可用时,返回示例:
{
"code": 0,
"msg": "服务暂不可用",
"errcode": 11017
}
业务错误码说明
以下为本站全部业务错误码。返回体中 code 为 0 且携带 errcode 字段时,即表示调用未成功,请根据 errcode 对照下表排查。
| errcode | 含义 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | ***地址无效 |
| 11015 | ***地址不允许 |
| 11016 | ***请求失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
| 11019 | 当前IP不在白名单内 |
| 11020 | 启用出口代理须提供有效密钥 |
| 11021 | 未配置可用出口代理 |
| 11022 | 出口代理不可用 |
| 11023 | 密钥已过期 |
| 11024 | 令牌分配积分不足 |
| 11025 | 该密钥无权调用此接口 |
说明:本接口为免费接口,无需提供密钥即可调用,因此通常不会返回与密钥、积分相关的错误码;若出现此类错误码,表示请求经由需鉴权的调用方式发起或接口配置发生变更,可对照上表定位。参数缺失或格式不正确时,一般返回 11012;调用地址拼写错误时返回 11013;请求方式与本接口要求的 GET 不一致时返回 11018;接口数据获取异常时返回 11016 或 11017。
调用示例
终端 curl(bash)
curl "https://mini10.top/api/privilege.php?ids=21233962"
批量查询多首歌曲时,使用英文逗号分隔歌曲 id:
curl "https://mini10.top/api/privilege.php?ids=21233962,1824020872"
PHP
// PHP 调用示例
$url = "https://mini10.top/api/privilege.php?ids=21233962";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
echo "请求失败: " . curl_error($ch);
} else {
echo "HTTP 状态码: " . $httpCode . PHP_EOL;
$data = json_decode($response, true);
print_r($data);
}
curl_close($ch);
注意事项
- 本接口无需密钥,调用地址中不携带任何鉴权参数;请勿自行附加来源不明的密钥或身份参数,以免请求被拒绝。
ids为必填参数,取值为歌曲数字 ID 的字符串形式。批量查询时多个 ID 使用英文半角逗号,分隔,逗号前后不要加空格,也不要使用中文逗号或其它分隔符。- 单次批量查询的 ID 数量建议控制在 100 个以内。一次传入过多 ID 会增加响应时间并可能触发限流;需要查询大量歌曲时,请分批请求,并在批次之间留出间隔。
- 请使用 HTTPS 访问。GET 请求的参数需按 URL 规范进行编码;
ids虽以数字为主,仍建议统一编码,避免拼接异常。 - 接口免费,但请合理控制调用频率,避免高频轮询或并发压测。相同 ID 的重复查询建议在本地做短时缓存,以减少不必要的请求。
- 返回
code为 200 仅表示本次请求处理成功;具体到每首歌曲的可播放状态,需结合data数组中该条目的多项字段综合判断,不要只依赖单一字段下结论。 - 歌曲的版权与可播放状态会随时间变化,返回结果具有时效性,不宜作为长期固定的数据源缓存或对外承诺。个别 ID 不存在或已下架时,对应位置可能缺少有效信息,调用方需做空值与异常容错。
- 请勿将本接口返回的数据用于侵犯版权或违反相关平台条款的用途,转载或展示时请遵守内容来源方的要求。
快速上手
curl "https://mini10.top/api/privilege.php?ids=21233962"
在线测试
请求地址
mini10.top/api/privilege.php
参数
Response
// 结果将在此处显示