李经理: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.setLevels("MUSIC,MUSIC_EFFECT")
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=0805BE7F751CBE6F3F83691BD1464A29' -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.2.0' -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": 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": [],
        "waveUrl": "https://static-hifiveai-open.haifanwu.com/wave/COPYRIGHT/1D652157FC9/1D652157FC9.json?sign=3b749cc63daee0f7f5809c070356e011&t=1660702625",
        "version": [{
          "name": "主版本",
          "musicId": "1D65214CB60",
          "free": 1,
          "price": 0,
          "majorVersion": true,
          "duration": 198,
          "auditionBegin": 0,
          "auditionEnd": 0
        }]
      }],
      "meta": {
        "totalCount": 1,
        "currentPage": 1
      }
    },
    "taskId": "ffb9563528a647be828d5e1f0b2ed450"
  }

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