{"id":18738251,"url":"https://github.com/xiaomengxinx/music163api-go","last_synced_at":"2025-06-30T05:04:02.948Z","repository":{"id":46635798,"uuid":"400563243","full_name":"XiaoMengXinX/Music163Api-Go","owner":"XiaoMengXinX","description":"网易云音乐 API Golang 实现","archived":false,"fork":false,"pushed_at":"2025-05-28T09:42:10.000Z","size":171,"stargazers_count":50,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T12:53:47.693Z","etag":null,"topics":["cloudmusic","go","golang","music","neteasecloud"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XiaoMengXinX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-27T15:58:28.000Z","updated_at":"2025-06-25T04:58:32.000Z","dependencies_parsed_at":"2024-06-18T21:27:16.816Z","dependency_job_id":"98171b44-0c31-41fb-b53e-0ab280910718","html_url":"https://github.com/XiaoMengXinX/Music163Api-Go","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/XiaoMengXinX/Music163Api-Go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMengXinX%2FMusic163Api-Go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMengXinX%2FMusic163Api-Go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMengXinX%2FMusic163Api-Go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMengXinX%2FMusic163Api-Go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XiaoMengXinX","download_url":"https://codeload.github.com/XiaoMengXinX/Music163Api-Go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMengXinX%2FMusic163Api-Go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262714507,"owners_count":23352463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudmusic","go","golang","music","neteasecloud"],"created_at":"2024-11-07T15:28:48.622Z","updated_at":"2025-06-30T05:04:02.899Z","avatar_url":"https://github.com/XiaoMengXinX.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 网易云音乐 API-Go\n\n网易云音乐 Golang API 实现\n\n## 灵感来自\n\n[Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)\n\n## 说明\n\n与 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 不同的是，本项目将全部采用\nEapi(即网易云音乐客户端使用的API)\n\n本项目可能会很咕，欢迎各位的 issue 与 pr\n\n## API 列表\n\n目前仅实现了少部分API：\n\n- 批处理\n- 获取音乐 URL\n- 获取音乐歌词\n- 获取音乐详细信息\n- 获取专辑详细信息\n- 获取歌单详细信息\n- 获取日推歌曲\n- 获取资源评论\n- 获取用户歌单\n- 新建歌单\n- 发送私信（支持图片）\n- 发送/删除动态（支持图片）\n- 发送/删除 Mlog（仅支持图片）\n- 发送/删除评论\n- 添加/删除歌单歌曲\n- 红心/取消红心歌曲\n- 获取 NosToken 以及 上传文件\n- QR 登录 (获取 unikey, 检测登录状态)\n- 搜索 API (复杂搜索, 多重匹配搜索, 获取搜索建议, 歌曲搜索)\n- 短链接生成\n- 用户签到\n- 获取账号登录状态\n- 获取音乐人云豆数量\n- 音乐人领取云豆\n- 音乐人签到\n- 获取音乐人任务列表/周任务列表\n- 获取用户详细\n- 获取用户信息\n- 获取用户设置\n- 获取 VIP 信息\n- 获取 VIP 成长值\n- 领取 VIP 成长值奖励\n- 获取/设置用户状态\n- 获取歌手详细\n- 获取云圈动态\n- 获取电台节目\n- 分享歌曲回调\n- 动态资源分享\n\n## API 调用文档\n\n#### GetSongDetail 获取歌曲详细信息\n\n[在 replit 上试试](https://replit.com/@xibaole2333/Music163Api-Go-demo1)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/XiaoMengXinX/Music163Api-Go/api\"\n\t\"github.com/XiaoMengXinX/Music163Api-Go/utils\"\n)\n\nfunc main() {\n\tdata := utils.RequestData{}\n\n\tresult, _ := api.GetSongDetail(data, []int{1295601353}) // 获取 ID:1295601353 的详细信息\n\n\tfmt.Println(result.Songs[0].Name) // 打印歌曲名称\n}\n```\n\n返回\n\n```\n生而为人，我很抱歉（VOCALOID）\n```\n\n#### GetSongURL 获取歌曲 URL\n\n[在 replit 上试试](https://replit.com/@xibaole2333/Music163Api-Go-demo2)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/XiaoMengXinX/Music163Api-Go/api\"\n\t\"github.com/XiaoMengXinX/Music163Api-Go/utils\"\n)\n\nfunc main() {\n\tdata := utils.RequestData{\n\t\tCookies: []*http.Cookie{\n\t\t\t{\n\t\t\t\tName:  \"MUSIC_U\", // 获取无损音质需填写 Cookies 中的 MUSIC_U\n\t\t\t\tValue: \"8bc6da9b916433c064c742a9ca02f1405cccf02062aac31cdfea4eb6024e0d2248eecaa9668dfe7f43124f3fcebe94e446b14e3f0c3f8af929f5e126cc9926cbc3061cd18d77b7a0\",\n\t\t\t},\n\t\t},\n\t}\n\n\tresult, _ := api.GetSongURL(data, api.SongURLConfig{Ids: []int{1295601353}}) // 获取 ID:1295601353 的歌曲 URL\n\n\tfmt.Println(result.Data[0].Url) // 打印歌曲 URL\n}\n```\n\n返回\n\n```\nhttp://m8.music.126.net/20211031014702/3ace83970e99ef576e4fc350f095382f/ymusic/0edd/e4e3/4eaf/d2db5cbbef195ff34812eb8c82c83d67.flac\n```\n\n#### Batch 批处理\n\n示例：获取当前 Cookie 的用户 ID、获取歌曲ID:1416956209 的详细信息\n\n[在 replit 上试试](https://replit.com/@xibaole2333/Music163Api-Go-demo3)\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/XiaoMengXinX/Music163Api-Go/api\"\n\t\"github.com/XiaoMengXinX/Music163Api-Go/types\"\n\t\"github.com/XiaoMengXinX/Music163Api-Go/utils\"\n)\n\nfunc main() {\n\tdata := utils.RequestData{\n\t\tCookies: []*http.Cookie{\n\t\t\t{\n\t\t\t\tName:  \"MUSIC_U\",\n\t\t\t\tValue: \"8bc6da9b916433c064c742a9ca02f1405cccf02062aac31cdfea4eb6024e0d2248eecaa9668dfe7f43124f3fcebe94e446b14e3f0c3f8af929f5e126cc9926cbc3061cd18d77b7a0\",\n\t\t\t},\n\t\t},\n\t}\n\n\tbatch := api.NewBatch(api.BatchAPI{Key: api.UserSettingAPI})                                          // 创建初始化 Batch 对象并添加 API\n\tbatch.Add(api.BatchAPI{Key: api.SongDetailAPI, Json: api.CreateSongDetailReqJson([]int{1416956209})}) // 继续添加要批处理的 API\n\n\t_, result := batch.Do(data).Parse() // 请求 Batch API 并解析返回的 Json\n\n\tvar userData types.UserSettingData\n\t_ = json.Unmarshal([]byte(result[api.UserSettingAPI]), \u0026userData) // 解析 Json 到 struct\n\n\tvar songDetail types.SongsDetailData\n\t_ = json.Unmarshal([]byte(result[api.SongDetailAPI]), \u0026songDetail) // 解析 Json 到 struct\n\n\tfmt.Println(songDetail.Songs[0].Al.Name) // 打印歌曲专辑名称\n\tfmt.Println(userData.Setting.UserId)     // 打印 UserID\n}\n```\n\nBatch 可用的 API 列表详见 https://pkg.go.dev/github.com/XiaoMengXinX/Music163Api-Go/api#pkg-constants\n\n## 已知问题\n\n#### 已解决：\n\n- API 的返回内容解密是多余的，理论上可以移除所有解密相关代码\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomengxinx%2Fmusic163api-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaomengxinx%2Fmusic163api-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomengxinx%2Fmusic163api-go/lists"}