关键词联想
1. 接口描述
URL |
https://openapi.youku.com/router/rest.json |
功能描述 |
关键词联想 |
返回格式 |
Json,UTF8 |
HTTP请求方式 |
GET |
当前接口版本 |
V3 |
2. 系统参数
参数名 |
参数全称 |
必选 |
参数类型 |
参数描述 |
action |
action |
String | true |
youku.search.keyword.get |
client_id |
client_id |
String | true |
应用的client id |
access_token |
access token |
String | false |
oauth2的token |
format |
format |
String | false |
可选,指定响应格式。默认保持代理接口格式化,目前支持格式为xml,json,text |
timestamp |
timestamp |
String | true |
客户端当前时间戳,精确到秒,timestamp与开放平台请求时间误差为6分钟 |
version |
version |
String | true |
3.0 |
sign |
sign |
String | true |
对API调用参数(除sign外)的md5加密值。详情见签名方法 |
3. 业务参数
参数名 |
参数类型 |
必选 |
参数默认值 |
参数描述 |
keyword |
string |
true |
|
搜索关键词 |
noextra |
int |
false |
0 |
去掉附带信息(暂不生效,不要使用) |
4. 返回参数
参数名 |
参数全称 |
参数类型 |
参数描述 |
provider |
provider |
string |
父字段:e,服务方名称:searches.soku.kubox |
|
code |
int |
父字段:e,错误代码 |
|
desc |
String |
父字段:e,错误描述 |
total |
total |
String |
父字段:total,结果条数 |
cost |
cost |
int |
父字段:cost,耗时 |
q |
q |
String |
父字段:q,查询词 |
c |
c |
String |
父字段:r,提示词 |
d |
d |
int |
父字段:r,标示提示词有没有附加信息,如果提示词是一个节目或者人物,就会有附加信息。如果不需要可以忽略,或者通过参数noextra=noextra去挑这些信息 |
u |
u |
JSONArray |
父字段:r提示词附加信息,详细见提示词附加信息code |
提示词附加信息:code
参数名 |
参数全称 |
参数类型 |
参数描述 |
o |
o |
int |
顺序 |
k |
k |
string |
播放链接 |
d |
d |
String |
详细页面链接 |
j |
j |
String |
节目名 |
m |
m |
String |
节目类型 |
y |
y |
String |
节目年代 |
a |
a |
String |
节目海报 |
p |
p |
String |
节目主演 |
w |
w |
String |
地区 |
i |
i |
int |
节目id |
s |
s |
String |
对外的showid |
e |
e |
int |
直达区类型,1为节目类,2为播客类 |
c | c |
int |
是否被播控,1为被播控,2为未被播控 |
vi | vi |
int |
播放地址对应的视频id |
cr | cr |
int |
该节目优酷是否有版权,0=版权未知,1=已授权,2=无版权,3=版权过期,4=公共版权,5=伪授权 |
5. 调用示例
https://openapi.youku.com/router/rest.json?opensysparams={"action": "youku.search.keyword.get",
"format": "json", "access_token": "d9ce66ced641240836cf6011a4c195bc", "sign":
"adbd7046517a0730efd45927cf780338", "version": "3.0", "client_id": "163d4fd10c7f9a28",
"timestamp": 1453720524}&keyword=四大名助&caller=NOVA
6. 响应示例
{ "cost" : "0",
"q" : "test",
"r" : [ { "c" : "天鹅索套" },
{ "c" : "test" },
{ "c" : "teste100" },
{ "c" : "testlauf" },
{ "c" : "testarda io" },
{ "c" : "test11" }
],
"total" : "6"
}
7. 异常示例
e: {
provider: "searches.soku.kubox",
code: "3001",
desc: "3001"
}
8. 注意事项
请预留“X-Caller”和“User-Agent”段以标识调用方名称和调用方平台请设置“Accept-Encoding: gzip, deflate”段以打开gzip压缩,并且调用方需要支持gzip解压缩如果调用方不是请求的发起方而是代理方,请设置“X-Forwarded-For”记录发起方的真实IP Referer、Cookie等段可选,建议代理方能够尽量多的带上调用方的相关信息,以便服务方分析用户行为