网易云API接口

HTTPS

稳定、快速、免费的 API 接口服务

调用地址:http(s)://163.catni.cn/api/163-api.php
返回类型:JSON
请求方式:GET

请求参数说明:

名称 必填 类型 说明
id int 网易云歌曲id
uid int 网易云歌单ID

返回参数说明:

名称 类型 说明
code string 返回的状态码
tips string 返回提示信息
data dict 返回返回数据

返回示例:

                                
                                {
                                    "code": 200,
                                    "tips": "获取成功!",
                                    "data": {
                                        "basic": {
                                            "id": 546723298,
                                            "name": "Lonely Day",
                                            "author": "Jurrivh",
                                            "url": "https://m10.music.126.net/xxxxxx.mp3",
                                            "pic": "http://p3.music.126.net/QBpWaqmA_U4gg9p873okmA==/109951163201490261.jpg"
                                        },
                                        "lyric": {
                                            "nolyric": true,
                                            "lyric": ""
                                        },
                                        "hotComments": {
                                            "nocomments": false,
                                            "comments": [{
                                                "nickName": "nano92",
                                                "avatarUrl": "http://p1.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg",
                                                "comment": "听了病变的过来支持一下,希望不是我一个人"
                                            }]
                                        }
                                    }
                                }
                                
                            

系统级错误码参照:

错误码 类型 说明
code string 返回的状态码 -1/1 失败/成功
tips string 返回提示信息

curl

                                
                                    curl https://163.catni.cn/api/163-api.php?id=3778678
                                
                            

python

                            
                                import requests

                                url = 'https://163.catni.cn/api/163-api.php'
                                bodys = {'id': '3778678'}
                                argument = {
                                    'Content-Type': 'text/html;charset=utf-8'
                                }
                                request = requests.get(url=url, params=argument, data=bodys)
                                print(request.text)
                            
                        

php

                            
                                <?php
                                $url = "https://163.catni.cn/api/163-api.php";
                                $method = "GET";
                                $headers = [
                                    "Content-Type" => "text/html;charset=utf-8"
                                ];
                                $bodys = "id=3778678";
                                
                                $curl = curl_init();
                                curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
                                curl_setopt($curl, CURLOPT_URL, $url);
                                curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
                                curl_setopt($curl, CURLOPT_FAILONERROR, false);
                                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
                                curl_setopt($curl, CURLOPT_HEADER, false);
                                if (200 == strpos("$" . $url, "https://")) {
                                    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
                                    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
                                }
                                curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
                                echo curl_exec($curl);
                                ?>