优酷 视频搜索
通过关键词搜索优酷视频,提供基于页面的分页。使用该接口发现与主题、标题、创作者或其他搜索词相关的视频。
GET
/v1/youku/search_video_v1
$0.02
- 价格
- $0.02 / 次成功调用,失败不收费
- 接口 ID
youku.search_video_v1
参数
-
keywordstring 必填用于搜索的关键词。
示例
咖啡 -
pageinteger 可选用于分页的页码,从1开始。
示例
1
代码示例
curl -G "https://api.mofa-ai.com/v1/youku/search_video_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'keyword=咖啡' \
--data-urlencode 'page=1'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/youku/search_video_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"keyword": "咖啡",
"page": "1",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/youku/search_video_v1");
url.search = new URLSearchParams({
keyword: "咖啡",
page: "1",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
响应示例
请求参数 {"page": "1", "keyword": "咖啡"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "youku.search_video_v1",
"cost_usd": 0.02,
"data": {
"code": 0,
"data": {
"v": "2.0",
"api": "mtop.youku.soku.yksearch",
"ret": [
"SUCCESS::调用成功"
],
"data": {
"id": 0,
"data": {
"pg": 1,
"pz": 30,
"isEnd": 0,
"total": 606,
"action": {
"report": {
"pageName": "page_searchresults",
"trackInfo": {
"k": "咖啡",
"eid": "2133636417940959360903232e34f4",
"aaid": "9fbffd5aabe0f1eeaa005d2258486410",
"engine": "expid~req.ugc105.sort1004.rank105.qa0$eid~2133636417940959360903232e34f4$bts~soku_engine_master#105$r_p_n~47",
"searchtab": "0",
"search_from": "1",
"source_from": "home"
}
}
},
"filter": {
"tab": [
{
"id": "0",
"title": "综合排序",
"orders": [
{
"title": "综合排序",
"value": 0
},
"… +2"
]
},
"… +2"
],
"cate": [
{
"id": "0",
"title": "全部"
},
"… +4"
],
"format": [
{
"title": "全部",
"value": 0
},
"… +3"
],
"newType": true,
"duration": [
{
"title": "全部",
"value": "0-0"
},
"… +4"
]
},
"rstate": 0,
"status": "success",
"isModule": true,
"hitNFMode": true,
"typeVersion": "B",
"highlightWord": "咖啡",
"displaySearchTerms": "咖啡",
"globalControlParam": {
"closeRetentionPop": true
}
},
"more": true,
"type": 0,
"level": 0,
"nodes": [
{
"id": 0,
"data": {
"schema": "1",
"version": 311,
"docSource": 1,
"schemeName": "1"
},
"more": false,
"type": 0,
"level": 1,
"nodes": [
{
"id": 0,
"more": false,
"type": 1027,
"level": 2,
"nodes": [
{
"id": 0,
"data": {
"cats": "电影",
"info": "简介:咖啡有三种味道:苦、酸、香。影片讲述三段感人至深的故事,展现了不同文化背景下多样的人文情怀。影片利用咖啡悠久的历史、丰富的味觉体验和地域差异等特征,展现了当代世界面临的种种挑战。比利时,哈默德是一家小当铺的主人,在一次抗议经济危机的暴…",
"docId": "316977",
"action": {
"type": "JUMP_TO_NATIVE",
"value": "https://m.yangshipin.cn/video?type=0&vid=d000057ai14&cid=udcnl5px04421qk&channel=youkuquanwangsou",
"report": {
"trackInfo": {
"cid": "…",
"group_id": "…",
"item_log": "…",
"group_num": "…",
"source_id": "…",
"group_type": "…",
"object_url": "…",
"object_type": "…",
"object_title": "…"
}
}
},
"cateId": 2,
"notice": "演员:Hichem Yacoubi Dario Aita 芦芳生 谭卓 米瑞安·达尔马兹欧 恩尼奥·凡塔斯蒂基尼 黎一墨 肯·德·布沃 Arne De Tremerie ",
"showId": "406d112724efbfbd11ef",
"isYouku": 0,
"itemLog": "eps_t~2$site~173$show_id~406d112724efbfbd11ef$doc_source~1$eng_source~6$sp_id~1154282910455431168",
"logCate": "movie",
"director": "导演:克里斯提诺·波顿 ",
"hasYouku": 0,
"needLess": false,
"sourceId": 173,
"thumbUrl": "https://m.ykimg.com/050C00005A6EE54AADBC09059C0A48FB",
"titleDTO": {
"action": {
"type": "JUMP_TO_NATIVE",
"value": "https://m.yangshipin.cn/video?type=0&vid=d000057ai14&cid=udcnl5px04421qk&channel=youkuquanwangsou",
"report": {
"scm": "…",
"spm": "…",
"arg1": "…"
}
},
"displayName": "咖啡风暴"
},
"completed": 1,
"docSource": 1,
"exclusive": 0,
"isTrailer": 0,
"posterDTO": {
"action": {
"type": "JUMP_TO_NATIVE",
"value": "https://m.yangshipin.cn/video?type=0&vid=d000057ai14&cid=udcnl5px04421qk&channel=youkuquanwangsou",
"report": {
"scm": "…",
"spm": "…",
"arg1": "…"
}
},
"vThumbUrl": "http://m.ykimg.com/052600005D3693BC425BD91F5B4A5103",
"iconCorner": {},
"posterType": "showW3H4ThumbUrl"
},
"programId": "316977",
"sourceImg": "http://r1.ykimg.com/051000005A65A6A5ADC0AECA4B01B87F",
"tempTitle": "咖啡风暴",
"ugcSupply": 0,
"featureDTO": {
"text": "电影 · 2016 · 比利时"
},
"realShowId": "406d112724efbfbd11ef",
"sourceName": "央视频",
"showIdValid": -1,
"animeEdition": 0,
"disableClick": true,
"episodeTotal": 1,
"showMediaTag": [],
"stripeBottom": "",
…
示例较长,此处截断显示。
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。