西格玛FM
接口信息
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| cookie | string | 否 | 自备CK,不传用内置(用户传入CK > 内置CK) | channel=ios-b1; 1&_device=... |
| action | string | 是 | 操作:system.ping/system.version/system.routes/search.universal/search.tabs/search.tracks/search.suggest/search.hotWords/album.detail/album.tracks/track.playUrl/playlist.tracks/user.homePage/user.verify/user.vipInfo/discovery.feed/discovery.vipTabs/discovery.vipContent/history.list/history.entrance/anchor.singerMore/anchor.subscribeStatus/crypto.x2mInfo/crypto.bruteKeys/music.search/music.playUrl/music.batchUrls/music.decryptUrl/wx.qrCode/wx.checkLogin/wx.loginByCode/cookie.verify/cookie.profile/tme.urls/tme.status | album.tracks |
| kw | string | 否 | 搜索词(search.universal/search.tracks/search.suggest/music.search) | 认真的雪 |
| type | string | 否 | 大类(search.universal/search.tabs):music/album/track/user/live/video/podcast | album |
| subTab | string | 否 | 小类(search.universal music 系):musicAll/musicTrack/musicPlaylist/musicSinger | musicTrack |
| rows | integer | 否 | 条数1-30(search.universal/search.tracks/music.search) | 10 |
| page | integer | 否 | 页码(search / album.tracks / playlist.tracks / music.search / anchor.singerMore) | 1 |
| albumId | integer | 否 | 专辑ID(album.detail / album.tracks / track.playUrl / discovery.feed / music.playUrl / music.batchUrls / anchor.subscribeStatus) | 61310701 |
| pageSize | integer | 否 | 每页1-50(album.tracks / playlist.tracks / anchor.singerMore) | 10 |
| trackId | integer | 否 | 声音/音乐ID(track.playUrl / discovery.feed / music.playUrl),2.1+ 可不传 albumId 自动解析 | 981952271 |
| quality | string | 否 | 音质(track.playUrl / music.playUrl / music.batchUrls):mp3_64/mp3_32/m4a_24/m4a_64/aac_164/aac_224/hq | mp3_64 |
| playlistId | integer | 否 | 听单ID(playlist.tracks) | 29306701 |
| channelId | integer | 否 | 频道ID(discovery.vipContent,从vipTabs获取) | 0 |
| syncPoint | integer | 否 | 同步点增量拉取(history.list) | 0 |
| anchorUid | integer | 否 | 主播UID(anchor.singerMore / anchor.subscribeStatus) | 597884260 |
| moduleType | string | 否 | 类型(anchor.singerMore):Album/Track | Album |
| path | string | 否 | 服务器上的x2m文件绝对路径(crypto.x2mInfo) | D:/xxx.x2m |
| b64 | string | 否 | base64密文(crypto.bruteKeys) | KHin1Buo3xjN... |
| trackIds | string | 否 | 音乐ID列表逗号分隔(music.batchUrls) | 981952271,982616628 |
| enc | string | 否 | v4/baseInfo 密文base64url(music.decryptUrl) | KX394bzbotvN-xx... |
| appid | string | 否 | 微信AppID(wx.qrCode / wx.loginByCode,默认wxb9371ecb5f0f05b1) | wxb9371ecb5f0f05b1 |
| qrId | string | 否 | 二维码会话ID(wx.checkLogin,来自wx.qrCode) | a485ee43284d50d9 |
| code | string | 否 | 微信授权code(wx.loginByCode 调试) | 023KswFa... |
| limit | integer | 否 | 返回条数1-100(tme.urls) | 20 |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "cookie",
"type": "string",
"required": false,
"description": "自备CK,不传用内置(用户传入CK > 内置CK)",
"example": "channel=ios-b1; 1&_device=..."
},
{
"name": "action",
"type": "string",
"required": true,
"description": "操作:system.ping/system.version/system.routes/search.universal/search.tabs/search.tracks/search.suggest/search.hotWords/album.detail/album.tracks/track.playUrl/playlist.tracks/user.homePage/user.verify/user.vipInfo/discovery.feed/discovery.vipTabs/discovery.vipContent/history.list/history.entrance/anchor.singerMore/anchor.subscribeStatus/crypto.x2mInfo/crypto.bruteKeys/music.search/music.playUrl/music.batchUrls/music.decryptUrl/wx.qrCode/wx.checkLogin/wx.loginByCode/cookie.verify/cookie.profile/tme.urls/tme.status",
"example": "album.tracks"
},
{
"name": "kw",
"type": "string",
"required": false,
"description": "搜索词(search.universal/search.tracks/search.suggest/music.search)",
"example": "认真的雪"
},
{
"name": "type",
"type": "string",
"required": false,
"description": "大类(search.universal/search.tabs):music/album/track/user/live/video/podcast",
"example": "album"
},
{
"name": "subTab",
"type": "string",
"required": false,
"description": "小类(search.universal music 系):musicAll/musicTrack/musicPlaylist/musicSinger",
"example": "musicTrack"
},
{
"name": "rows",
"type": "integer",
"required": false,
"description": "条数1-30(search.universal/search.tracks/music.search)",
"example": "10"
},
{
"name": "page",
"type": "integer",
"required": false,
"description": "页码(search / album.tracks / playlist.tracks / music.search / anchor.singerMore)",
"example": "1"
},
{
"name": "albumId",
"type": "integer",
"required": false,
"description": "专辑ID(album.detail / album.tracks / track.playUrl / discovery.feed / music.playUrl / music.batchUrls / anchor.subscribeStatus)",
"example": "61310701"
},
{
"name": "pageSize",
"type": "integer",
"required": false,
"description": "每页1-50(album.tracks / playlist.tracks / anchor.singerMore)",
"example": "10"
},
{
"name": "trackId",
"type": "integer",
"required": false,
"description": "声音/音乐ID(track.playUrl / discovery.feed / music.playUrl),2.1+ 可不传 albumId 自动解析",
"example": "981952271"
},
{
"name": "quality",
"type": "string",
"required": false,
"description": "音质(track.playUrl / music.playUrl / music.batchUrls):mp3_64/mp3_32/m4a_24/m4a_64/aac_164/aac_224/hq",
"example": "mp3_64"
},
{
"name": "playlistId",
"type": "integer",
"required": false,
"description": "听单ID(playlist.tracks)",
"example": "29306701"
},
{
"name": "channelId",
"type": "integer",
"required": false,
"description": "频道ID(discovery.vipContent,从vipTabs获取)",
"example": "0"
},
{
"name": "syncPoint",
"type": "integer",
"required": false,
"description": "同步点增量拉取(history.list)",
"example": "0"
},
{
"name": "anchorUid",
"type": "integer",
"required": false,
"description": "主播UID(anchor.singerMore / anchor.subscribeStatus)",
"example": "597884260"
},
{
"name": "moduleType",
"type": "string",
"required": false,
"description": "类型(anchor.singerMore):Album/Track",
"example": "Album"
},
{
"name": "path",
"type": "string",
"required": false,
"description": "服务器上的x2m文件绝对路径(crypto.x2mInfo)",
"example": "D:/xxx.x2m"
},
{
"name": "b64",
"type": "string",
"required": false,
"description": "base64密文(crypto.bruteKeys)",
"example": "KHin1Buo3xjN..."
},
{
"name": "trackIds",
"type": "string",
"required": false,
"description": "音乐ID列表逗号分隔(music.batchUrls)",
"example": "981952271,982616628"
},
{
"name": "enc",
"type": "string",
"required": false,
"description": "v4/baseInfo 密文base64url(music.decryptUrl)",
"example": "KX394bzbotvN-xx..."
},
{
"name": "appid",
"type": "string",
"required": false,
"description": "微信AppID(wx.qrCode / wx.loginByCode,默认wxb9371ecb5f0f05b1)",
"example": "wxb9371ecb5f0f05b1"
},
{
"name": "qrId",
"type": "string",
"required": false,
"description": "二维码会话ID(wx.checkLogin,来自wx.qrCode)",
"example": "a485ee43284d50d9"
},
{
"name": "code",
"type": "string",
"required": false,
"description": "微信授权code(wx.loginByCode 调试)",
"example": "023KswFa..."
},
{
"name": "limit",
"type": "integer",
"required": false,
"description": "返回条数1-100(tme.urls)",
"example": "20"
}
]
{
"code": 0,
"msg": "音乐播放地址(多通道:album直链→v3签名→TME frida捕获)",
"data": {
"trackId": 2725352,
"albumId": 0,
"title": "雪中悍刀行 01(张若昀剧版后续请从336集开始听)",
"quality": "mp3_64",
"url": "https://audiopay.cos.tx.xmcdn.com/download/1.0.0/storages/80bc-audiopay/99/98/GKwRIW4OIul0AIdfrgSy902d.mp3?sign=54b2f3c2b09a19c056b06e1ba867a812&buy_key=FM×tamp=1788932506682000&token=3577&duration=1108",
"duration": 1108,
"isPaid": true,
"via": "v3+xm-sign"
},
"cost": "0.209s"
}
详细文档
西格玛FM
接口说明
西格玛FM 是一个聚合型音频服务接口,面向需要多平台音乐与有声内容能力的开发者,统一提供搜索、专辑详情、播放地址获取、歌单/主播管理等能力。支持喜马拉雅、QQ音乐、网易云等平台的操作入口,可接入搜索、解析、解密、微信登录等扩展功能,适用于音频应用、智能助手及第三方内容聚合场景。
调用地址
接口统一入口地址为:
/api/book/xmly/index.php
所有操作通过该地址发起,具体行为由请求参数 action 字段指定。
请求方式
接口使用 GET 方法调用。所有业务参数通过 URL Query 字符串传递,无需请求体。
标准请求模板如下:
/api/book/xmly/index.php?key=YOUR_KEY&action=xxx&...
鉴权说明
本接口采用 Query 参数鉴权,为全站首选且唯一支持的密钥传递方式。
每次请求必须在 URL 的查询参数中携带 key 字段,值为已分配的接口调用密钥:
/api/book/xmly/index.php?key=YOUR_API_KEY&action=album.tracks&page=1
未携带 key 或密钥无效时,接口将拒绝响应。密钥由服务平台分配,请妥善保管,禁止公开分享。
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,通过 Query 参数传递 |
| action | string | 是 | 操作类型,详见下方取值说明 |
| cookie | string | 否 | 自备 CK,不传使用内置账号 |
| kw | string | 否 | 搜索关键词,适用于 search 相关 action |
| type | string | 否 | 大类筛选,适用于 search.universal / search.tabs |
| subTab | string | 否 | 小类筛选,适用于 search.universal music 系 |
| rows | integer | 否 | 返回条数,范围 1-30 |
| page | integer | 否 | 页码,从 1 开始 |
| albumId | integer | 否 | 专辑 ID,适用于 album / discovery / music 相关操作 |
| pageSize | integer | 否 | 每页条数,范围 1-50 |
| trackId | integer | 否 | 声音或音乐 ID,2.1+ 版本可不传 albumId |
| quality | string | 否 | 音质格式,适用于播放 URL 相关操作 |
| playlistId | integer | 否 | 听单 ID |
| channelId | integer | 否 | 频道 ID,从 vipTabs 接口获取 |
| syncPoint | integer | 否 | 同步点增量拉取游标 |
| anchorUid | integer | 否 | 主播 UID |
| moduleType | string | 否 | 内容类型:Album / Track |
| path | string | 否 | x2m 文件服务器绝对路径 |
| b64 | string | 否 | base64 编码的密文数据 |
| trackIds | string | 否 | 多个音乐 ID 逗号分隔 |
| enc | string | 否 | v4/baseInfo 密文的 base64url 编码 |
| appid | string | 否 | 微信 AppID,默认 wxb9371ecb5f0f05b1 |
| qrId | string | 否 | 二维码会话 ID,来自 wx.qrCode 接口 |
| code | string | 否 | 微信授权临时 code |
| limit | integer | 否 | 返回条数,范围 1-100 |
action 取值说明
系统类:system.ping / system.version / system.routes
搜索类:search.universal / search.tabs / search.tracks / search.suggest / search.hotWords
专辑类:album.detail / album.tracks
播放类:track.playUrl / music.playUrl / music.batchUrls / music.decryptUrl
播放列表类:playlist.tracks
用户类:user.homePage / user.verify / user.vipInfo
发现类:discovery.feed / discovery.vipTabs / discovery.vipContent
历史类:history.list / history.entrance
主播类:anchor.singerMore / anchor.subscribeStatus
解密类:crypto.x2mInfo / crypto.bruteKeys
音乐类:music.search
微信类:wx.qrCode / wx.checkLogin / wx.loginByCode / cookie.verify / cookie.profile
其他类:tme.urls / tme.status
quality 取值说明
mp3_64 / mp3_32 / m4a_24 / m4a_64 / aac_164 / aac_224 / hq
type 取值说明
music / album / track / user / live / video / podcast
subTab 取值说明
musicAll / musicTrack / musicPlaylist / musicSinger
成功响应示例
{
"code": 0,
"msg": "音乐播放地址(多通道:album直链→v3签名→TME frida捕获)",
"data": {
"trackId": 2725352,
"albumId": 0,
"title": "雪中悍刀行 01(张若昀剧版后续请从336集开始听)",
"quality": "mp3_64",
"url": "https://audiopay.cos.tx.xmcdn.com/download/1.0.0/storages/80bc-audiopay/99/98/GKwRIW4OIul0AIdfrgSy902d.mp3?sign=54b2f3c2b09a19c056b06e1ba867a812&buy_key=FM×tamp=1788932506682000&token=3577&duration=1108",
"duration": 1108,
"isPaid": true,
"via": "v3+xm-sign"
},
"cost": "0.209s"
}
响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| msg | string | 响应消息说明 |
| cost | string | 接口耗时,单位秒 |
| data | object | 业务数据体,随 action 不同结构有差异 |
data 通用字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| trackId | integer | 音频/音乐 ID |
| albumId | integer | 专辑 ID |
| title | string | 标题 |
| quality | string | 当前解析音质,如 mp3_64、m4a_24、hq 等 |
| url | string | 播放直链,含签名字段 |
| duration | integer | 时长,单位秒 |
| isPaid | boolean | 是否为付费内容 |
| via | string | 来源通道标识,如 v3+xm-sign、frida 等 |
search.universal / search.tracks / music.search 数据字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| rows | integer | 返回条数 |
| page | integer | 当前页码 |
| list | array | 结果列表 |
album.detail 数据字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| albumId | integer | 专辑 ID |
| title | string | 专辑标题 |
| cover | string | 封面图 URL |
| totalCount | integer | 总曲目数 |
| isPaid | boolean | 是否付费专辑 |
album.tracks / playlist.tracks 数据字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| total | integer | 总条数 |
| page | integer | 当前页 |
| pageSize | integer | 每页条数 |
| list | array | 曲目列表 |
track.playUrl / music.playUrl / music.batchUrls 专属字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| url | string | 播放地址直链 |
| quality | string | 请求音质 |
| isPaid | boolean | 是否付费 |
| via | string | 解析通道 |
错误响应示例
{
"code": 1,
"msg": "密钥错误",
"errcode": 11002
}
业务错误码说明
| 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 | 令牌分配积分不足 |
调用示例
终端 curl(bash)
curl -G "https://api.example.com/api/book/xmly/index.php" \
--data-urlencode "key=YOUR_KEY" \
--data-urlencode "action=album.tracks" \
--data-urlencode "albumId=61310701" \
--data-urlencode "pageSize=10"
PHP
// PHP
$params = [
'key' => 'YOUR_KEY',
'action' => 'album.tracks',
'albumId' => '61310701',
'pageSize' => '10',
];
$url = 'https://api.example.com/api/book/xmly/index.php?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
注意事项
- 调用密钥
key请妥善保管,严禁直接暴露在前端代码或公开仓库中,避免未授权滥用导致配额损失。 - 本接口仅支持 Query 方式传递密钥,格式为
?key=你的密钥,请勿与其他鉴权方式混用。 - 建议所有请求均通过 HTTPS 发起,防止密钥及敏感参数在传输过程中被窃听。
- 接口频率限制约为 60 次/分钟,超过限制可能触发限流或临时封禁,请在业务层做好并发控制与重试退避。
cookie为可选参数,用户自备的 CK 优先级高于内置 CK;如传入过期或失效的 CK,可能导致部分需要登录态的操作返回异常。action参数决定具体操作,取值必须严格匹配文档列表,大小写敏感,错误值将直接返回参数错误。- 涉及搜索的参数
rows取值范围为 1-30,pageSize取值范围为 1-50,超出范围将被截断或拒绝。 - 付费内容接口(如
track.playUrl、music.playUrl)返回的播放链接带有时效签名,请勿长期缓存,建议按需实时获取。 - 音质字段
quality支持mp3_64、m4a_24、aac_224等档位,不同音质对应不同费用,请根据实际需求选择。 crypto.x2mInfo与crypto.bruteKeys涉及文件路径与密文处理,传入的path与b64参数格式错误可能导致解密失败。- 微信相关接口(
wx.qrCode、wx.loginByCode)依赖外部服务状态,偶发超时属正常现象,建议设置合理超时阈值并适当重试。 - 本接口为 收费接口,请留意账户余额与单次调用成本,批量操作建议合并请求以降低开销。
快速上手
暂无代码示例。管理员可在后台用 AI 生成或手动编写。
在线测试
// 结果将在此处显示