网易音乐API
本次分析的是网易音乐API
歌曲搜索API:http://music.163.com/api/search/get/web?csrf_token=
需要用POST来获取
参数:
Referer=http://music.163.com/search/
hlposttag=</span>
hlpretag=<span class=\”s-fc7\”>
limit=返回结果数量
offset=(当前页码-1)*返回结果数量
s=需要搜索的歌曲或歌手
total=如果是第一页就是True否则Flase
type=1
返回结果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | { "result" : { "songCount" : 200, "songs" : [ { "id" : 186001, "name" : "七里香" , "artists" : [ { "id" : 6452, "name" : "周杰伦" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 } ], "album" : { "id" : 18903, "name" : "七里香" , "artist" : { "id" : 0, "name" : "" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 }, "publishTime" : 1091462400000, "size" : 10, "copyrightId" : 1007, "status" : 1, "picId" : 102254581384072 }, "duration" : 299000, "copyrightId" : 1007, "status" : 3, "alias" : [], "fee" : 0, "mvid" : 185014, "rtype" : 1, "rUrl" : "http://wap.118100.cn/ca/ps/5347/1150000019" , "ftype" : 1 }, { "id" : 186125, "name" : "开不了口" , "artists" : [ { "id" : 6452, "name" : "周杰伦" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 } ], "album" : { "id" : 18915, "name" : "范特西" , "artist" : { "id" : 0, "name" : "" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 }, "publishTime" : 1000915200000, "size" : 10, "copyrightId" : 1007, "status" : 1, "picId" : 59373627912203 }, "duration" : 285000, "copyrightId" : 1007, "status" : 3, "alias" : [], "fee" : 0, "mvid" : 143050, "rtype" : 1, "rUrl" : "http://wap.118100.cn/ca/ps/5347/1150000040" , "ftype" : 1 }, { "id" : 186055, "name" : "回到过去" , "artists" : [ { "id" : 6452, "name" : "周杰伦" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 } ], "album" : { "id" : 18907, "name" : "八度空间" , "artist" : { "id" : 0, "name" : "" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 }, "publishTime" : 1026921600000, "size" : 10, "copyrightId" : 1007, "status" : 1, "picId" : 5953855464827125 }, "duration" : 231000, "copyrightId" : 1007, "status" : 3, "alias" : [], "fee" : 0, "mvid" : 154014, "rtype" : 1, "rUrl" : "http://wap.118100.cn/ca/ps/5347/1150000008" , "ftype" : 1 }, { "id" : 185815, "name" : "蒲公英的约定" , "artists" : [ { "id" : 6452, "name" : "周杰伦" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p3.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 } ], "album" : { "id" : 18886, "name" : "我很忙" , "artist" : { "id" : 0, "name" : "" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 }, "publishTime" : 1193846400000, "size" : 10, "copyrightId" : 1007, "status" : 1, "picId" : 60473139533046 }, "duration" : 247000, "copyrightId" : 1007, "status" : 3, "alias" : [], "fee" : 0, "mvid" : 0, "rtype" : 1, "rUrl" : "http://wap.118100.cn/ca/ps/5347/1150000036" , "ftype" : 1 }, { "id" : 186109, "name" : "世界末日" , "artists" : [ { "id" : 6452, "name" : "周杰伦" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 } ], "album" : { "id" : 18914, "name" : "Fantasy Plus" , "artist" : { "id" : 0, "name" : "" , "picUrl" : null, "alias" : [], "albumSize" : 0, "picId" : 0, "trans" : null, "img1v1Url" : "http://p4.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg" , "img1v1" : 0 }, "publishTime" : 1009468800000, "size" : 3, "copyrightId" : 1007, "status" : 1, "picId" : 130841883712118 }, "duration" : 265000, "copyrightId" : 1007, "status" : 1, "alias" : [], "fee" : 0, "mvid" : 154013, "rtype" : 1, "rUrl" : "http://wap.118100.cn/ca/ps/5347/1150000011" , "ftype" : 1 } ] }, "code" : 200 } |
这样就可以获取到歌曲播放地址和图片地址了
歌词API:http://music.163.com/api/song/lyric/
POST形式发送
参数
os=pc
id=歌曲ID
lv=-1
kv=-1
tv=-1
直接返回歌词内容
大家可以利用这个接口做一个可以微信点歌的类似微点歌:vdiange
这样的微信公众号
大家可以添加微点歌:vdiange
大家可以添加微点歌:vdiange

测试一下音乐接口效果。
本文来自博客园,作者:大象已无形,转载请注明原文链接:https://www.cnblogs.com/mmm/p/163_music_api.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库