注:公益密钥的账号 10011 某易云音乐的接口 如果下方文档看不懂请点击 接口详细说明 查看完整的调用示例
| 参数名 | 类型 | 描述 | 可选值 | 默认值 |
|---|---|---|---|---|
id |
string | 歌曲真实ID(type=lyric时必填;type=url已废弃,改用uid) | - |
|
uid |
string | 歌曲映射序号(type=url时必填,通过search返回的uid获取) | - |
|
type |
string | 业务类型:getqrcode-获取二维码;cookie-轮询并提取登录cookie;search-搜索歌曲;url-获取播放链接+歌词;lyric-获取歌词;logout-退出登录并删除本地凭证 | getqrcode |
|
level |
string | 音质等级(type=url时可选) | standard |
|
limit |
integer | 返回条数上限(type=search时可选,默认2,最大10) | 2 |
|
flower |
string | 是否直接返回二维码图片:true-直接输出PNG;false-返回JSON(仅type=getqrcode时有效) | false |
|
number |
string | 用户编号:纯数字字符串,用于生成或查找本地unikey/cookie文件(getqrcode|cookie|url|logout必填) | - |
|
keywords |
string | 搜索关键词(type=search时必填) | - |
/s/netease?type=getqrcode&number=10086&flower=true
{
"code":200,
"number":"00",
"qrimg":"data:image/png;base64,EGDAAAAAElFTkSuQmCC.......",
"qrurl":"https://music.163.com/login?codekey=......"
}
| 场景 | HTTP 状态 | 错误码 | 消息 | JSON 结构预览 |
|---|---|---|---|---|
| type 参数缺失或为空 | 400 |
400 |
type 不能为空 | {
"error": {
"code": 400,
"message": "type 不能为空",
"type": {
"desc": "业务类型",
"enum": [
"getqrcode",
"cookie",
"search",
"url",
"lyric",
"logout"
],
"type": "string",
"default": "getqrcode"
}
}
} |
| type 取值非法 | 400 |
400 |
type 参数无效 | {
"error": {
"code": 400,
"message": "type 参数无效",
"type": {
"desc": "业务类型",
"enum": [
"getqrcode",
"cookie",
"search",
"url",
"lyric",
"logout"
],
"type": "string",
"default": "getqrcode"
}
}
} |
| number 参数缺失或非数字 | 400 |
400 |
number 必须是数字 | {
"error": {
"code": 400,
"message": "number 必须是数字",
"number": {
"desc": "用户编号",
"enum": [],
"type": "string",
"default": ""
}
}
} |
| logout 缺少 number 参数或非数字 | 400 |
400 |
number 必须是数字 | {
"error": {
"code": 400,
"message": "number 必须是数字",
"number": {
"desc": "用户编号",
"enum": [],
"type": "string",
"default": ""
}
}
} |
| logout 用户文件不存在 | 404 |
404 |
用户文件不存在 | {
"error": {
"code": 404,
"message": "用户文件不存在"
}
} |
| logout 删除文件失败(服务器异常) | 500 |
500 |
删除文件失败 | {
"error": {
"code": 500,
"message": "删除文件失败"
}
} |
| uid 参数缺失或非数字(url 场景) | 400 |
400 |
uid 必须是数字 | {
"error": {
"code": 400,
"message": "uid 必须是数字",
"uid": {
"desc": "歌曲映射序号",
"enum": [],
"type": "string",
"default": ""
}
}
} |
| uid 未搜索过(本地映射不存在) | 404 |
404 |
uid 不存在,请先搜索 | {
"error": {
"code": 404,
"message": "uid 不存在,请先搜索"
}
} |
| keywords 缺失或为空(search 场景) | 400 |
400 |
keywords 不能为空 | {
"error": {
"code": 400,
"message": "keywords 不能为空",
"keywords": {
"desc": "搜索关键词",
"type": "string"
}
}
} |
| id 参数缺失或非数字(lyric 场景) | 400 |
400 |
id 必须是数字 | {
"error": {
"code": 400,
"message": "id 必须是数字",
"id": {
"desc": "歌曲真实 id",
"type": "string"
}
}
} |
| unikey 文件不存在(未先请求二维码) | 404 |
404 |
未找到对应 unikey,请先请求二维码 | {
"error": {
"code": 404,
"message": "未找到对应 unikey,请先请求二维码"
}
} |
| cookie 文件不存在(未扫码) | 404 |
404 |
未找到对应 cookie,请先完成扫码 | {
"error": {
"code": 404,
"message": "未找到对应 cookie,请先完成扫码"
}
} |
| 上游网易云接口异常/超时 | 502 |
502 |
上游接口异常 | {
"error": {
"code": 502,
"message": "上游接口异常"
}
} |
| QPS 超限被封禁 | 429 |
429 |
请求频繁,请10秒后重试 | {
"error": {
"code": 429,
"message": "请求频繁,请10秒后重试",
"retry_after": 10
}
} |
| 接口状态异常(数据库状态≠正常) | 503 |
503 |
接口异常,请联系管理员修复! | {
"error": {
"code": 503,
"message": "接口异常,请联系管理员修复!",
"status": "异常"
}
} |
| 接口维护中 | 503 |
503 |
接口维护中,请稍后再试 | {
"error": {
"code": 503,
"message": "接口维护中,请稍后再试",
"status": "维护"
}
} |
| 接口已下架 | 410 |
410 |
接口已下架 | {
"error": {
"code": 410,
"message": "接口已下架",
"status": "下架"
}
} |
| 服务器内部错误(代码异常) | 500 |
500 |
服务器内部错误 | {
"error": {
"code": 500,
"message": "服务器内部错误"
}
} |