加载中...

基础信息

查看接口基本信息和返回格式
接口描述

为QQ机器人,微信插件提供音乐搜索和播放功能,支持黄白助手格式

七日请求统计
本周总请求: - 日均: -
请求方式
GET POST 推荐
请求地址
https://api.cxzja.cn/api/qqmusicbot
返回方式
JSON 默认返回格式,包含完整数据结构
返回预览
JSON
{
  "code": 200,
  "title": "指纹",
  "singer": "杜宣达",
  "cover": "https://y.qq.com/music/photo_new/T002R300x300M000004SjWnA1NcK5d_1.jpg?max_age=2592000",
  "link": "https://y.qq.com/n/ryqq/songDetail/000HTbQv2OHqYi",
  "music_url": "https://car-bj.kuwo.cn/a7d0330bcc832265e94c9f2731a204ec/6a1fc8ea/lx/resource/n1/37/28/3627038463.mp3",
  "lyric": "[00:00.00]指纹 - 杜宣达
[00:00.78]出品:太合音乐x银河方舟
[00:02.22]音乐发行:太合麦田
[00:03.27]制作总监:蔡庭贵
[00:04.19]策略营销:武鹏
[00:04.97]词 Lyrics:周剑光
[00:05.63]曲 Composer:郑宇界
[00:06.28]原唱:胡歌
[00:06.81]编曲 Arranger:任斌
[00:07.46]和声 Backing Vocals:Eileen Shan Zou
[00:08.38]制作人 Producer:王圆坤@不要音乐
[00:09.95]混音工程师 Mixing:郑昊杰
[00:11.13]母带工程师 Master:郑昊杰
[00:12.31]项目统筹:闫曼嘉/黄路欢/chili
[00:13.88]企划营销:AiryX/袋熊/Frank/黄路欢
[00:15.32]项目协力:李靖/ELANUS/One
[00:16.24]封面设计:ELANUS
[00:17.00]我们 变成一对 差点缘分
[00:22.52]装成朋友少点天份
[00:26.30]坦然不是每个人都能
[00:30.98]
[00:31.93]我们 结成伴趟过的天真
[00:37.37]没了天真选择孤身
[00:41.05]以为成熟需要不诚恳
[00:46.02]
[00:46.83]你也不承认
[00:49.52]
[00:50.41]自己会失衡
[00:53.74]坚持着分寸
[00:56.82]
[00:57.40]却又依赖着余温
[01:01.78]
[01:03.49]旋转几轮 变成我们
[01:07.16]深刻的指纹
[01:09.92]
[01:10.93]留在每个 爱过的人
[01:14.66]心房里加温
[01:17.55]
[01:18.40]爱过几番 恨过几轮
[01:22.17]越仔细越疼
[01:25.05]
[01:25.69]等了多久 忍过青春
[01:29.59]却憎恨 别人奋不顾身
[01:35.00]
[01:50.14]我们 抓紧了所谓的人生
[01:55.00]
[01:55.50]追逐爱恨交换灵魂
[01:59.23]选择自己满意的身份
[02:04.11]
[02:04.95]我何苦又问
[02:07.61]
[02:08.49]你是否认真
[02:11.20]
[02:11.77]指尖的年轮
[02:14.92]
[02:15.61]是催促我们
[02:17.76]沉沦的印证
[02:21.66]旋转几轮 变成我们
[02:25.27]深刻的指纹
[02:27.91]
[02:29.01]留在每个 爱过的人
[02:32.74]心房里加温
[02:35.34]
[02:36.38]爱过几番 恨过几轮
[02:40.11]越仔细越疼
[02:43.01]
[02:43.96]等了多久 忍过青春
[02:47.56]却憎恨 别人奋不顾身
[02:53.28]
[03:06.23]旋转几轮 变成我们
[03:09.95]深刻的指纹
[03:12.72]
[03:13.53]留在每个 爱过的人
[03:17.42]心房里加温
[03:20.01]
[03:20.99]爱过几番 恨过几轮
[03:24.87]越仔细越疼
[03:27.76]
[03:28.59]等了多久 忍过青春
[03:32.31]却憎恨 别人奋不顾身"
}

计费标准

了解接口的计费方式和价格
VIP专享接口定价
VIP 免费
VIP免费专享
VIP会员免费使用,非会员无法访问
QPS限制
普通用户
不限
会员用户
不限
每日请求次数
普通用户
不限
会员用户
不限

安全认证

了解接口的认证方式和访问凭证管理
Token 认证

登录后可查看您的Token

立即登录
实名认证
无需实名认证
本接口对所有用户开放,无需实名认证即可访问
认证方式
推荐 Header 认证

通过 HTTP Header 传递认证信息

Authorization
Bearer {access_token}

或通过curl请求参数传递:

curl
curl "https://api.cxzja.cn/api/qqmusicbot?token=YOUR_TOKEN"

参数文档

查看接口请求参数和返回字段说明
请求参数
参数名 类型 必填 默认值 可选值 说明
token string 必填 登录后显示你的请求token 接口请求唯一认证标识!
msg string 必填 搜索关键词
n int 必填 搜索结果中的第几个
id string 必填 歌曲MID
br string 必填 音质(128/320/flac)默认320
lrcs string 必填 只要存在就只返回歌词
response_type string 必填 设为mp3时返回纯文本链接
type string 必填 设为hb启用黄白助手模式 hb
hb string 必填 黄白助手开关(yes/no) yes
name string 必填 黄白助手模式的歌曲名 七里香
返回参数
字段名 类型 说明
code
int 返回状态码

状态码

了解接口返回的状态码含义及处理方式
接口状态码
状态码 说明
200 请求成功
201 请求失败
服务器状态码

在线测试

在线调试接口,实时查看响应结果
发起请求
GET/POST

示例代码

多种语言的接口调用示例
PHP
JavaScript
NodeJs
Python
Go
Java
C#
C
C++
易语言
PHP
<?php
$API_TOKEN = 'YOUR_TOKEN';
$API_URL = 'https://api.cxzja.cn/api/qqmusicbot';

$params = array(
    'token' => 'YOUR_TOKEN',
    'msg' => '参数值',
    'n' => '参数值',
    'id' => '参数值',
    'br' => '参数值',
    'lrcs' => '参数值',
    'response_type' => '参数值',
    'type  ' => '参数值',
    'hb' => '参数值',
    'name' => '参数值',
);

$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/qqmusicbot',
    data: {
        token: 'YOUR_TOKEN',
        msg: '参数值',
        n: '参数值',
        id: '参数值',
        br: '参数值',
        lrcs: '参数值',
        response_type: '参数值',
        type  : '参数值',
        hb: '参数值',
        name: '参数值',
    },
    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/qqmusicbot"
data = {
    "token": "YOUR_TOKEN",
    "msg": "参数值",
    "n": "参数值",
    "id": "参数值",
    "br": "参数值",
    "lrcs": "参数值",
    "response_type": "参数值",
    "type  ": "参数值",
    "hb": "参数值",
    "name": "参数值",
}

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/qqmusicbot");
        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&br=%E5%8F%82%E6%95%B0%E5%80%BC&lrcs=%E5%8F%82%E6%95%B0%E5%80%BC&response_type=%E5%8F%82%E6%95%B0%E5%80%BC&type++=%E5%8F%82%E6%95%B0%E5%80%BC&hb=%E5%8F%82%E6%95%B0%E5%80%BC&name=%E5%8F%82%E6%95%B0%E5%80%BC"
    resp, _ := http.Post("https://api.cxzja.cn/api/qqmusicbot",
        "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", "参数值"},
            {"br", "参数值"},
            {"lrcs", "参数值"},
            {"response_type", "参数值"},
            {"type  ", "参数值"},
            {"hb", "参数值"},
            {"name", "参数值"},
        });
        var response = await client.PostAsync("https://api.cxzja.cn/api/qqmusicbot", 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': '参数值',
    'br': '参数值',
    'lrcs': '参数值',
    'response_type': '参数值',
    'type  ': '参数值',
    'hb': '参数值',
    'name': '参数值',
});
const options = {
    hostname: 'api.cxzja.cn',
    path: '/api/qqmusicbot',
    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/qqmusicbot");
        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&br=%E5%8F%82%E6%95%B0%E5%80%BC&lrcs=%E5%8F%82%E6%95%B0%E5%80%BC&response_type=%E5%8F%82%E6%95%B0%E5%80%BC&type++=%E5%8F%82%E6%95%B0%E5%80%BC&hb=%E5%8F%82%E6%95%B0%E5%80%BC&name=%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/qqmusicbot");
        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&br=%E5%8F%82%E6%95%B0%E5%80%BC&lrcs=%E5%8F%82%E6%95%B0%E5%80%BC&response_type=%E5%8F%82%E6%95%B0%E5%80%BC&type++=%E5%8F%82%E6%95%B0%E5%80%BC&hb=%E5%8F%82%E6%95%B0%E5%80%BC&name=%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/qqmusicbot"
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&br=%E5%8F%82%E6%95%B0%E5%80%BC&lrcs=%E5%8F%82%E6%95%B0%E5%80%BC&response_type=%E5%8F%82%E6%95%B0%E5%80%BC&type++=%E5%8F%82%E6%95%B0%E5%80%BC&hb=%E5%8F%82%E6%95%B0%E5%80%BC&name=%E5%8F%82%E6%95%B0%E5%80%BC"

result = 编码_URL解码 (网页_访问 (url, , params))
调试输出 (result)

AI开发文档

导出接口文档供AI助手快速理解接口结构
复制下方内容粘贴给AI助手,即可快速生成对接代码。
JSON 格式 0 KB