音乐ID获取
其他 官方文档
音乐聚合搜索所需ID,支持网易/QQ/酷我/咪咕/千千音乐,良心接口请不要乱搞,导致本接口不可用
基本说明:
接口地址:https://jkyapi.top/API/hqyyid.php
返回格式:json
请求方式:get
请求示例:https://jkyapi.top/API/hqyyid.php?name=梨花香&type=wy&page=1&limit=10
请求参数说明:
名称 类型 必填 说明
name string 必填 歌曲名
type string 必填 音乐平台,可填wy/qq/kw/mg/qi
page string 必填 歌单页数,默认第一页
limit string 必填 歌曲数量,默认十首歌
返回参数说明:
名称 类型 说明
type string 音乐来源
id string 歌曲ID,配合音乐聚合搜索音接口使用可以获取到歌曲完整信息
name string 歌曲名称
album string 专辑名称
artist string 歌手名称
JSON返回示例:
{
	"code": 1,
	"msg": "获取成功",
	"data": [{
			"type": "wy",
			"id": 2140038547,
			"name": "梨花香(霜雪千年抖音热播dj)",
			"album": "霜雪千年抖音热播dj)",
			"artist": "krs",
			"pic_id": "109951169448211433"
		},
		{
			"type": "wy",
			"id": 409650851,
			"name": "霜雪千年(Cover 洛天依 \/ 乐正绫)",
			"album": "霜雪千年(翻唱)",
			"artist": "双笙(陈元汐)\/封茗囧菌",
			"pic_id": "18198016951567518"
		},
		{
			"type": "wy",
			"id": 2142427963,
			"name": "梨花香(梨花哪有18岁香)",
			"album": "梨花香",
			"artist": "童小丽",
			"pic_id": "109951169468072027"
		},
		{
			"type": "wy",
			"id": 29091429,
			"name": "梨花香",
			"album": "Super Model",
			"artist": "风林火山",
			"pic_id": "109951164795841559"
		},
		{
			"type": "wy",
			"id": 2141217706,
			"name": "梨花香(霜雪千年×芳华慢)",
			"album": "梨花香",
			"artist": "西罕",
			"pic_id": "109951169458755194"
		},
		{
			"type": "wy",
			"id": 2139354869,
			"name": "梨花香(dj版)",
			"album": "a.cool.hamburger",
			"artist": "a.cool.hamburger",
			"pic_id": "109951169429379485"
		},
		{
			"type": "wy",
			"id": 2139289928,
			"name": "焦小飞-梨花香(立体环绕DJ版)(焦小飞 remix)",
			"album": "鱼子西",
			"artist": "焦小飞",
			"pic_id": "109951169440324977"
		},
		{
			"type": "wy",
			"id": 254351,
			"name": "梨花香",
			"album": "N+1 Evolution 珍藏版",
			"artist": "李宇春",
			"pic_id": "109951166118004259"
		},
		{
			"type": "wy",
			"id": 1917764616,
			"name": "梨花香",
			"album": "翻唱(九)",
			"artist": "淋一次雨",
			"pic_id": "109951166575532993"
		},
		{
			"type": "wy",
			"id": 1897736272,
			"name": "芳华慢+霜雪千年",
			"album": "芳华慢+霜雪千年",
			"artist": "ms吗",
			"pic_id": "109951165558201196"
		}
	]
}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2024/4/12 09:11
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://jkyapi.top/API/hqyyid.php?name=梨花香&type=wy&page=1&limit=10';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "https://jkyapi.top/API/hqyyid.php?name=梨花香&type=wy&page=1&limit=10"
)

func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}