搜索音频
通过音频id、关键词或其他筛选条件获取新音频id结果集合及排序序列
接口地址(URI):/api/music/search
HTTP请求方式:GET
请求参数:
| 请求值字段 | 必选 | 类型 | 说明 |
|---|---|---|---|
| id | false | string | 音频编号 |
| keyword | true | string | 关键词搜索。支持多关键词搜索,and条件。多关键词用空格分隔 |
| sort_by | false | string | 排序方式:正序、倒序,输入:asc/desc |
| has_vocal | false | integer | 是否人声,1-是 2-否 |
| duration | false | string | 时长.单位为秒 . 使用区间来获取,例:12,50(筛选12-50秒的音乐) |
| music_type | false | integer | 1-音乐 2-音效 |
| bpm | false | string | Beat Per Minute的简称,音乐节拍数,释义为每分钟节拍数。 使用区间来获取,例:80,100(筛选节拍为80-100的音乐) |
| page | false | integer | 第几页,仅支持输入数字. 默认值1. |
| nums | false | integer | 每页返回数量 最小值1. 最大值100. 默认值100. |
返回参数:
| 返回字段 | 说明 |
|---|---|
| res_id | 音频编号 |
| title | 标题 |
| artist | 艺术家 |
| duration | 时长,单位为秒 |
| bpm | Beat Per Minute |
| album_cover_url | 封面图地址 |
| preview_jpg_json_https | 音频预览波形图数据(https) |
| preview_url_https | 预览小样下载地址 https 地址 |
| keywords | 关键词 |
| total_count | 返回结果总数 |
| total_page | 返回结果总页数 |
| per_page | 每页结果总数 |
| cur_page | 当前页码 |
请求参数示例example value:
Curl: curl -X GET --header 'Accept: application/json' --header 'api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' --header 'authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxx 'https://api.fotomore.com/api/music/search?keyword=test&nums=2' Request URL: https://api.fotomore.com/api/music/search?keyword=test&nums=2
返回数据示例example value:
{
"status_code": 1,
"message": "ok",
"data": {
"list": [
{
"res_id": "VCG231159049",
"title": "Failed the Test",
"artist": "Toby Tranter",
"duration": 172,
"bpm": 158,
"preview_url_https": "https://music-static-api.fotomore.com/music/preview/VCG231159049.mp3?uid=33×tamp=1677747207&sign=9d62fed4d7bcc427b711e0c735280ac5",
"album_cover_url_https": "https://music-static-api.fotomore.com/music/album_cover_800/53367.jpg",
"preview_jpg_json_https": "https://music-static-api.fotomore.com/music/wave/VCG231159049.json",
"keywords": ""
},
{
"res_id": "VCG231158706",
"title": "Nowhere to Be Found",
"artist": "Philip Ayers",
"duration": 130,
"bpm": 140,
"preview_url_https": "https://music-static-api.fotomore.com/music/preview/VCG231158706.mp3?uid=33×tamp=1677747207&sign=9d62fed4d7bcc427b711e0c735280ac5",
"album_cover_url_https": "https://music-static-api.fotomore.com/music/album_cover_800/53307.jpg",
"preview_jpg_json_https": "https://music-static-api.fotomore.com/music/wave/VCG231158706.json",
"keywords": "考试,测验,测试,线索,琐事,计时,紧急"
}
],
"total_count": 24,
"total_page": 12,
"per_page": 2,
"cur_page": 1
}
}