李经理:15682290831

通用服务端
视频编辑SDK
K歌SDK

功能说明

此接口提供歌曲名、艺人、标签名称、标签ID、BPM区间、时长区间等多维度的搜索功能,使用到的标签ID、歌曲价格等信息可以在音乐配置信息接口中获取

请求方法

POST

Header

以下请求参数列表仅列出了部分公共参数,完整公共参数列表见 公共参数列表

请求参数

请求示例

                HFSearchMusicRequest request = new HFSearchMusicRequest();
request.setMethod(HFRequest.METHOD_POST);
request.setPage(1);
request.setPageSize(10);
request.setTagIds("696,703");
request.setSearchFiled(SearchFiledEnum.MUSIC.getValue());
request.setSearchSmart(SearchSmartEnum.NO.getValue());
request.setNonce("fee23fwy9cef16fsw6387wg7m61uw676");
request.setClientId("hf2y7jk19a56qetq05");
try {
  HFSearchMusicResponse response = client.execute(request);
  System.out.println(JSON.toJSON(response));
} catch (ApiException e) {
  e.printStackTrace();
}
              

响应数据

        curl -G https://gateway-open.haifanwu.com -H 'Authorization:HF3-HMAC-SHA1 Signature=EF31AE579BB71A7F0E8D055F45EDA291' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:SearchMusic' -H 'X-HF-Timestamp:1595822526992' -H 'X-HF-Version:V4.1.1' -H 'X-HF-Nonce:tPpsOlzAMsEakZppMkxhaZxtRxVEFoxA' 
-X POST -d 'Keyword=a' 
  {
    "code": 10200,
    "msg": "操作成功",
    "data": {
      "record": [{
        "musicId": "1D65214CB60",
        "musicName": "I'd Go Anywhere With You (a)",
        "albumId": "69",
        "albumName": "Acoustic Sunshine",
        "duration": 198,
        "intro": "",
        "bpm": 100,
        "auditionBegin": 0,
        "auditionEnd": 0,
        "tag": [{
          "tagId": 959,
          "tagName": "有人声",
          "child": [{
            "tagId": 963,
            "tagName": "With Vocals",
            "child": []
          }]
        }, {
          "tagId": 964,
          "tagName": "女声",
          "child": [{
            "tagId": 965,
            "tagName": "Female",
            "child": []
          }]
        }, {
          "tagId": 627,
          "tagName": "静态",
          "child": []
        }, {
          "tagId": 636,
          "tagName": "中速",
          "child": []
        }, {
          "tagId": 668,
          "tagName": "拨奏",
          "child": [{
            "tagId": 675,
            "tagName": "Tremolo",
            "child": []
          }]
        }, {
          "tagId": 809,
          "tagName": "钢琴",
          "child": [{
            "tagId": 814,
            "tagName": "罗兹电钢琴",
            "child": []
          }]
        }, {
          "tagId": 872,
          "tagName": "贝斯",
          "child": [{
            "tagId": 875,
            "tagName": "直立贝司",
            "child": []
          }]
        }, {
          "tagId": 877,
          "tagName": "吉他",
          "child": [{
            "tagId": 878,
            "tagName": "原声吉他",
            "child": []
          }]
        }, {
          "tagId": 708,
          "tagName": "打击乐",
          "child": [{
            "tagId": 719,
            "tagName": "鼓",
            "child": []
          }, {
            "tagId": 721,
            "tagName": "钟琴",
            "child": []
          }, {
            "tagId": 731,
            "tagName": "沙筒",
            "child": []
          }]
        }, {
          "tagId": 78,
          "tagName": "民谣",
          "child": [{
            "tagId": 84,
            "tagName": "独立民谣",
            "child": []
          }]
        }, {
          "tagId": 93,
          "tagName": "流行",
          "child": []
        }, {
          "tagId": 408,
          "tagName": "变化",
          "child": [{
            "tagId": 413,
            "tagName": "明亮",
            "child": []
          }, {
            "tagId": 414,
            "tagName": "中断",
            "child": []
          }]
        }, {
          "tagId": 422,
          "tagName": "梦幻",
          "child": [{
            "tagId": 432,
            "tagName": "光明",
            "child": []
          }]
        }, {
          "tagId": 462,
          "tagName": "幽默",
          "child": [{
            "tagId": 467,
            "tagName": "嬉戏",
            "child": []
          }]
        }, {
          "tagId": 468,
          "tagName": "欢乐",
          "child": [{
            "tagId": 469,
            "tagName": "无忧无虑",
            "child": []
          }]
        }, {
          "tagId": 485,
          "tagName": "激昂",
          "child": [{
            "tagId": 487,
            "tagName": "乐观",
            "child": []
          }, {
            "tagId": 489,
            "tagName": "上升",
            "child": []
          }]
        }, {
          "tagId": 525,
          "tagName": "温柔",
          "child": [{
            "tagId": 537,
            "tagName": "甜蜜",
            "child": []
          }, {
            "tagId": 539,
            "tagName": "温暖",
            "child": []
          }]
        }, {
          "tagId": 548,
          "tagName": "慵懒",
          "child": [{
            "tagId": 550,
            "tagName": "自然",
            "child": []
          }]
        }, {
          "tagId": 553,
          "tagName": "简约",
          "child": [{
            "tagId": 562,
            "tagName": "连续",
            "child": []
          }]
        }],
        "cover": [{
          "url": "https://static-hifiveai-open.haifanwu.com/artwork/artwork_07.png",
          "size": ""
        }],
        "artist": [],
        "author": [],
        "composer": [{
          "name": "Vasco",
          "code": "7866EE1E",
          "avatar": "https://static-hifiveai-open.haifanwu.com/artist/default.png?sign=f8ba91b1643a9325a0e9277d00ed1e88&t=1595822527"
        }],
        "arranger": [],
        "version": [{
          "name": "主版本",
          "musicId": "1D65214CB60",
          "free": 1,
          "price": 0,
          "majorVersion": true,
          "duration": 198,
          "auditionBegin": 0,
          "auditionEnd": 0
        }]
      }],
      "meta": {
        "totalCount": 1,
        "currentPage": 1
      }
    },
    "taskId": "ffb9563528a647be828d5e1f0b2ed450"
  }

      
  • 功能说明
  • 请求方法
  • Header
  • 请求参数
  • 请求示例
  • 响应数据