基础信息
查看接口基本信息和返回格式 接口描述
搜索酷狗音乐、获取播放链接与歌词,支持多音质选择
七日请求统计
本周总请求: -
日均: -
请求方式
GET
POST 推荐
请求地址
https://api.cxzja.cn/api/kgmusic
返回方式
JSON
默认返回格式,包含完整数据结构
返回预览
JSON
{
"code": 200,
"msg": "请求成功",
"data": {
"keyword": "周杰伦",
"page": 1,
"limit": 20,
"count": 20,
"songs": [
{
"index": 1,
"song_hash": "b3a52a7a958bf0aed0ebfba2e9a818b7",
"name": "晴天",
"artist": "周杰伦",
"album": "叶惠美",
"cover": "http://imge.kugou.com/stdmusic/1080/20230920/20230920142503632013.jpg",
"duration": "04:29"
},
{
"index": 2,
"song_hash": "1335f720c701863f127fb14ccc9c08a2",
"name": "那天下雨了",
"artist": "周杰伦",
"album": "太阳之子",
"cover": "http://imge.kugou.com/stdmusic/1080/20260319/20260319101420611881.jpg",
"duration": "03:43"
},
{
"index": 3,
"song_hash": "2a6015676a3c8da32fd1a3bb29b75642",
"name": "爱琴海",
"artist": "周杰伦",
"album": "太阳之子",
"cover": "http://imge.kugou.com/stdmusic/1080/20260319/20260319101420611881.jpg",
"duration": "03:34"
},
{
"index": 4,
"song_hash": "688857974673645ce89eda26a36db19d",
"name": "告白气球",
"artist": "周杰伦",
"album": "周杰伦的床边故事",
"cover": "http://imge.kugou.com/stdmusic/1080/20200620/20200620103601113025.jpg",
"duration": "03:35"
},
{
"index": 5,
"song_hash": "8909e1809908cd8e3bf6cf85d98b93f0",
"name": "稻香",
"artist": "周杰伦",
"album": "魔杰座",
"cover": "http://imge.kugou.com/stdmusic/1080/20241118/20241118160622508429.jpg",
"duration": "03:43"
},
{
"index": 6,
"song_hash": "37a8f50a9ec3b267c3cc6bec633d9c4a",
"name": "青花瓷",
"artist": "周杰伦",
"album": "我很忙",
"cover": "http://imge.kugou.com/stdmusic/1080/20220705/20220705143006989099.jpg",
"duration": "03:59"
},
{
"index": 7,
"song_hash": "6996b4d89596673746aee3d54f7e5367",
"name": "蒲公英的约定",
"artist": "周杰伦",
"album": "我很忙",
"cover": "http://imge.kugou.com/stdmusic/1080/20220705/20220705143006989099.jpg",
"duration": "04:07"
},
{
"index": 8,
"song_hash": "fbc234520fed713c30c1c026e7352770",
"name": "搁浅",
"artist": "周杰伦",
"album": "七里香",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121745628430.jpg",
"duration": "04:00"
},
{
"index": 9,
"song_hash": "16c8ab298231370293d16bcf9e5ff9b6",
"name": "夜曲",
"artist": "周杰伦",
"album": "十一月的萧邦",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121901851911.jpg",
"duration": "03:46"
},
{
"index": 10,
"song_hash": "f73f22fb046ca1a135c70417163af82e",
"name": "一路向北",
"artist": "周杰伦",
"album": "J III MP3 Player",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121743958387.jpg",
"duration": "04:54"
},
{
"index": 11,
"song_hash": "892b7ad62499c97a1a994454423e30f6",
"name": "说好的幸福呢",
"artist": "周杰伦",
"album": "魔杰座",
"cover": "http://imge.kugou.com/stdmusic/1080/20241118/20241118160622508429.jpg",
"duration": "04:16"
},
{
"index": 12,
"song_hash": "48729371f20fb048ef4e51d4cd41dbf5",
"name": "红尘客栈",
"artist": "周杰伦",
"album": "十二新作",
"cover": "http://imge.kugou.com/stdmusic/1080/20231016/20231016111750787075.jpg",
"duration": "04:34"
},
{
"index": 13,
"song_hash": "dbe8fcd4c5072cf6139a28e32d45b990",
"name": "最长的电影",
"artist": "周杰伦",
"album": "我很忙",
"cover": "http://imge.kugou.com/stdmusic/1080/20220705/20220705143006989099.jpg",
"duration": "03:55"
},
{
"index": 14,
"song_hash": "4ec10b1b7b9beb2f0adb89bbec5f664b",
"name": "兰亭序",
"artist": "周杰伦",
"album": "魔杰座",
"cover": "http://imge.kugou.com/stdmusic/1080/20241118/20241118160622508429.jpg",
"duration": "04:13"
},
{
"index": 15,
"song_hash": "0d7e8c11c961a17eb8779feb0ca772e3",
"name": "枫",
"artist": "周杰伦",
"album": "十一月的萧邦",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121901851911.jpg",
"duration": "04:35"
},
{
"index": 16,
"song_hash": "3328808cecbd1a1038166003840fddd7",
"name": "花海",
"artist": "周杰伦",
"album": "魔杰座",
"cover": "http://imge.kugou.com/stdmusic/1080/20241118/20241118160622508429.jpg",
"duration": "04:24"
},
{
"index": 17,
"song_hash": "1f7e7659b9fff4fb6f71562a61bbc25f",
"name": "发如雪",
"artist": "周杰伦",
"album": "十一月的萧邦",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121901851911.jpg",
"duration": "04:59"
},
{
"index": 18,
"song_hash": "2c7ceb6cc2340ecc8948e0ace62f0cf8",
"name": "七里香",
"artist": "周杰伦",
"album": "七里香",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121745628430.jpg",
"duration": "04:59"
},
{
"index": 19,
"song_hash": "d85c14e02008b7a2f97d55cdc29c2221",
"name": "明明就",
"artist": "周杰伦",
"album": "十二新作",
"cover": "http://imge.kugou.com/stdmusic/1080/20231016/20231016111750787075.jpg",
"duration": "04:20"
},
{
"index": 20,
"song_hash": "b9fc03df9015d6bff0554a110bf2c84f",
"name": "烟花易冷",
"artist": "周杰伦",
"album": "跨时代",
"cover": "http://imge.kugou.com/stdmusic/1080/20250125/20250125121628799968.jpg",
"duration": "04:23"
}
],
"api_source": "API官网:api.cxzja.cn",
"timestamp": "2026-05-23 19:01:09"
}
}计费标准
了解接口的计费方式和价格
免费接口
免费
完全免费
所有用户均可免费调用,无需付费
QPS限制
普通用户
不限
会员用户
不限
每日请求次数
普通用户
不限
会员用户
不限
安全认证
了解接口的认证方式和访问凭证管理 Token 认证
实名认证
无需实名认证
本接口对所有用户开放,无需实名认证即可访问
认证方式
推荐
Header 认证
通过 HTTP Header 传递认证信息
Authorization
Bearer {access_token}或通过curl请求参数传递:
curl
curl "https://api.cxzja.cn/api/kgmusic?token=YOUR_TOKEN"
参数文档
查看接口请求参数和返回字段说明 请求参数
| 参数名 | 类型 | 必填 | 默认值 | 可选值 | 说明 |
|---|---|---|---|---|---|
| token | string | 必填 | 无 | 登录后显示你的请求token | 接口请求唯一认证标识! |
| msg | string | 必填 | 关键词 | ||
| n | string | 必填 | 选择序号 | ||
| ID | string | 必填 | 歌曲hash | ||
| p | string | 必填 | 翻页 | ||
| limit | string | 必填 | 翻页数量 | ||
| br | string | 必填 | 音质默认exhigh standard/exhigh/lossless/hires |
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
code
|
int | 返回状态码 |
状态码
了解接口返回的状态码含义及处理方式 接口状态码
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 201 | 请求失败 |
服务器状态码
| 状态码 | 说明 |
|---|---|
| 500 | 服务器错误 |
| 501 | 请求接口不存在 |
| 502 | 请求接口已下架 |
| 503 | 请求接口维护中 |
| 504 | 缺少请求token参数 |
| 505 | 请求token不存在 |
| 506 | 请求token已被封禁 |
| 507 | 请求token额度不足 |
| 508 | 今日请求token已达上限 |
| 509 | 请求ip不在token白名单内 |
| 510 | 请求token无权使用当前接口 |
| 511 | 接口请求频率过高,请稍后再试 |
| 512 | 该接口未开启在线测试功能 |
| 513 | 今日在线测试次数已达上限 |
| 514 | 今日该接口请求次数已达上限 |
| 515 | 该接口为会员专属接口,请携带会员token |
| 516 | 该接口为会员专属接口,请开通会员 |
| 517 | 接口请求过于频繁,已被临时限制 |
| 518 | 该接口需要实名认证,请先完成实名认证 |
| 519 | 当前Token今日请求次数已达上限 |
| 520 | 当前Token已被禁止使用 |
| 521 | 请求token余额不足 |
| 522 | 请求token额度和余额均不足 |
| 530 | 接口服务异常,请稍后再试 |
| 531 | 接口响应超时 |
| 532 | 接口返回数据格式错误 |
| 533 | 接口请求失败 |
在线测试
在线调试接口,实时查看响应结果 发起请求
GET/POST
示例代码
多种语言的接口调用示例PHP
JavaScript
NodeJs
Python
Go
Java
C#
C
C++
易语言
PHP
<?php
$API_TOKEN = 'YOUR_TOKEN';
$API_URL = 'https://api.cxzja.cn/api/kgmusic';
$params = array(
'token' => 'YOUR_TOKEN',
'msg' => '参数值',
'n' => '参数值',
'ID' => '参数值',
'p' => '参数值',
'limit' => '参数值',
'br' => '参数值',
);
$res = api::send($API_URL, $params, 'GET/POST');
print($res);
class api {
public static function send($url, $data, $type) {
$data = http_build_query($data);
$ch = curl_init();
if ($type == 'POST') {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
} else {
curl_setopt($ch, CURLOPT_URL, $url . '?' . $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
}JavaScript
$.ajax({
url: 'https://api.cxzja.cn/api/kgmusic',
data: {
token: 'YOUR_TOKEN',
msg: '参数值',
n: '参数值',
ID: '参数值',
p: '参数值',
limit: '参数值',
br: '参数值',
},
type: 'GET/POST',
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(err) {
console.log('请求失败', err);
}
});Python
import requests
url = "https://api.cxzja.cn/api/kgmusic"
data = {
"token": "YOUR_TOKEN",
"msg": "参数值",
"n": "参数值",
"ID": "参数值",
"p": "参数值",
"limit": "参数值",
"br": "参数值",
}
response = requests.post(url, data=data)
print(response.json())Java
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.*;
public class ApiRequest {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.cxzja.cn/api/kgmusic");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET/POST");
conn.setConnectTimeout(10000);
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder result = new StringBuilder();
while ((line = reader.readLine()) != null) {
result.append(line);
}
reader.close();
System.out.println(result.toString());
}
}Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
data := "token=YOUR_TOKEN&msg=%E5%8F%82%E6%95%B0%E5%80%BC&n=%E5%8F%82%E6%95%B0%E5%80%BC&ID=%E5%8F%82%E6%95%B0%E5%80%BC&p=%E5%8F%82%E6%95%B0%E5%80%BC&limit=%E5%8F%82%E6%95%B0%E5%80%BC&br=%E5%8F%82%E6%95%B0%E5%80%BC"
resp, _ := http.Post("https://api.cxzja.cn/api/kgmusic",
"application/x-www-form-urlencoded", strings.NewReader(data))
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}C#
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main() {
using var client = new HttpClient();
var data = new FormUrlEncodedContent(new Dictionary<string, string> {
{"token", "YOUR_TOKEN"},
{"msg", "参数值"},
{"n", "参数值"},
{"ID", "参数值"},
{"p", "参数值"},
{"limit", "参数值"},
{"br", "参数值"},
});
var response = await client.PostAsync("https://api.cxzja.cn/api/kgmusic", data);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(response);
}
}NodeJs
const https = require('https');
const querystring = require('querystring');
const postData = querystring.stringify({
'token': 'YOUR_TOKEN',
'msg': '参数值',
'n': '参数值',
'ID': '参数值',
'p': '参数值',
'limit': '参数值',
'br': '参数值',
});
const options = {
hostname: 'api.cxzja.cn',
path: '/api/kgmusic',
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
};
const req = https.request(options, res => {
let data = '';
res.on('data', d => data += d);
res.on('end', () => console.log(data));
});
req.write(postData);
req.end();
C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) {
((char*)userp)[0] = '\0';
strcat(userp, contents);
return size * nmemb;
}
int main() {
CURL *curl;
CURLcode res;
char response[4096] = {0};
curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.cxzja.cn/api/kgmusic");
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "token=YOUR_TOKEN&msg=%E5%8F%82%E6%95%B0%E5%80%BC&n=%E5%8F%82%E6%95%B0%E5%80%BC&ID=%E5%8F%82%E6%95%B0%E5%80%BC&p=%E5%8F%82%E6%95%B0%E5%80%BC&limit=%E5%8F%82%E6%95%B0%E5%80%BC&br=%E5%8F%82%E6%95%B0%E5%80%BC");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);
res = curl_easy_perform(curl);
if(res == CURLE_OK) printf("%s\n", response);
curl_easy_cleanup(curl);
}
curl_global_cleanup();
return 0;
}C++
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) {
userp->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl = curl_easy_init();
std::string response;
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.cxzja.cn/api/kgmusic");
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "token=YOUR_TOKEN&msg=%E5%8F%82%E6%95%B0%E5%80%BC&n=%E5%8F%82%E6%95%B0%E5%80%BC&ID=%E5%8F%82%E6%95%B0%E5%80%BC&p=%E5%8F%82%E6%95%B0%E5%80%BC&limit=%E5%8F%82%E6%95%B0%E5%80%BC&br=%E5%8F%82%E6%95%B0%E5%80%BC");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);
CURLcode res = curl_easy_perform(curl);
if (res == CURLE_OK) std::cout << response << std::endl;
curl_easy_cleanup(curl);
}
curl_global_cleanup();
return 0;
}易语言
.版本 2 .支持库 spec .局部变量 url, 文本型 .局部变量 params, 文本型 .局部变量 result, 文本型 url = "https://api.cxzja.cn/api/kgmusic" params = "token=YOUR_TOKEN&msg=%E5%8F%82%E6%95%B0%E5%80%BC&n=%E5%8F%82%E6%95%B0%E5%80%BC&ID=%E5%8F%82%E6%95%B0%E5%80%BC&p=%E5%8F%82%E6%95%B0%E5%80%BC&limit=%E5%8F%82%E6%95%B0%E5%80%BC&br=%E5%8F%82%E6%95%B0%E5%80%BC" result = 编码_URL解码 (网页_访问 (url, , params)) 调试输出 (result)
AI开发文档
导出接口文档供AI助手快速理解接口结构
复制下方内容粘贴给AI助手,即可快速生成对接代码。
JSON 格式
0 KB