Fetch music search API
Fetch music search
USD 0.010000 / 次成功调用
公开 ID: social.tikhub.douyin.search.fetch.music.search · 版本 1
定价
USD 0.010000 / 次成功调用
快速开始
使用 API 密钥发现此工具,再通过返回的 provider 和 endpoint 检查接口后执行。
将 GLOOP_API_BASE 设为 API 地址,GLOOP_API_KEY 设为服务端密钥。
curl
curl --fail-with-body "${GLOOP_API_BASE%/}/v1/discover" \
-H "Authorization: Bearer $GLOOP_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"limit": 5,
"query": "Fetch music search"
}'Python
import os, json, urllib.request
url = os.environ['GLOOP_API_BASE'].rstrip('/') + "/v1/discover"
headers = {'Authorization': 'Bearer ' + os.environ['GLOOP_API_KEY']}
headers['Content-Type'] = 'application/json'
data = "{\n \"limit\": 5,\n \"query\": \"Fetch music search\"\n}".encode('utf-8')
request = urllib.request.Request(url, data=data, headers=headers)
with urllib.request.urlopen(request) as response:
print(json.load(response))Node.js
const url = process.env.GLOOP_API_BASE.replace(/\/$/, '') + "/v1/discover";
const headers = { Authorization: `Bearer ${process.env.GLOOP_API_KEY}` };
headers['Content-Type'] = 'application/json';
const response = await fetch(url, { method: 'POST', headers, body: JSON.stringify({
"limit": 5,
"query": "Fetch music search"
}) });
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());工具 API 文档 · POST /v1/inspect输入结构
{
"additionalProperties": false,
"properties": {
"body": {
"additionalProperties": false,
"properties": {
"backtrace": {
"description": "翻页回溯标识,用于翻页,从上一次请求返回的响应中获取 / Backtrace for pagination, obtained from the last response",
"title": "Backtrace",
"type": "string"
},
"content_type": {
"description": "内容类型:0=不限 1=视频 2=图片 3=文章 / Content type: 0=All, 1=Video, 2=Picture, 3=Article",
"title": "Content Type",
"type": "string"
},
"cursor": {
"description": "偏移游标,用于翻页,从上一次请求返回的响应中获取 / Offset cursor for pagination, obtained from the last response",
"title": "Cursor",
"type": "integer"
},
"filter_duration": {
"description": "视频时长过滤:0=不限 0-1=一分钟以内 1-5=一到五分钟 5-10000=五分钟以上 / Video duration filter: 0=Unlimited, 0-1=Within 1 minute, 1-5=1 to 5 minutes, 5-10000=More than 5 minutes",
"title": "Filter Duration",
"type": "string"
},
"keyword": {
"description": "关键词 / Keyword",
"title": "Keyword",
"type": "string"
},
"publish_time": {
"description": "发布时间筛选:0=不限 1=最近一天 7=最近一周 180=最近半年 / Publish time filter: 0=Unlimited, 1=Last day, 7=Last week, 180=Last half year",
"title": "Publish Time",
"type": "string"
},
"search_id": {
"description": "搜索ID,用于翻页,从上一次请求返回的响应中获取 / Search ID for pagination, obtained from the last response",
"title": "Search Id",
"type": "string"
},
"sort_type": {
"description": "排序方式:0=综合排序 1=最多点赞 2=最新发布 / Sort type: 0=Comprehensive, 1=Most Likes, 2=Latest",
"title": "Sort Type",
"type": "string"
}
},
"title": "MusicSearchRequest",
"type": "object"
},
"queryParams": {
"additionalProperties": false,
"properties": {},
"type": "object"
}
},
"required": [],
"type": "object"
}输出结构
{
"type": "object"
}