万邦淘宝/天猫按分类搜索淘宝直播接口 API 返回值说明

item_videolist-按分类搜索淘宝直播接口 [查看演示] API测试工具

onebound.taobao.item_videolist

公共参数

请求地址: https://api-gw.onebound.cn/taobao/item_videolist

名称 类型 必须 描述
keyString调用key(必须以GET方式拼接在URL中)
secretString调用密钥
api_nameStringAPI接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cacheString[yes,no]默认yes,将调用缓存的数据,速度比较快
result_typeString[json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
langString[cn,en,ru]翻译语言,默认cn简体中文
versionStringAPI版本
请求参数

请求参数:channelId=0&page=1

参数说明:channelId:视频分类ID
page页数

响应参数
名称 类型 示例值 描述
title
String年货盛宴 心意之选商品标题
num_iid
Bigint294846800380宝贝ID
view_count
Int890观看人数
pic_url
Stringhttps://gw.alicdn.com/tfscom/i1/O1CN019WuTCM1WkoKlZhTPU_!!0-dgshop.jpg宝贝图片
detail_url
String//h5.m.taobao.com/taolive/video.html?id=294846800380宝贝链接
seller_info
Mix{"user_num_id": 2064892827, "head_img": "//img.alicdn.com/imgextra/i4/2064892827/O1CN01FQoRJd1WkoJuNhJOw_!!2064892827-0-beehive-scenes.jpg", "seller_nick": "雅诗兰黛旗舰店"}卖家信息
请求示例
	
-- 请求示例 url 默认请求参数已经URL编码处理
curl -i "https://api-gw.onebound.cn/taobao/item_videolist/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1"
<?php

// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://api.onebound.cn/taobao/demo/sdk2020/demo-sign.php
$method = "GET";
$url = "https://api-gw.onebound.cn/taobao/item_videolist/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>
<?php
//定义缓存目录和引入文件
define("DIR_RUNTIME","runtime/");
define("DIR_ERROR","runtime/");
define("SECACHE_SIZE","0");
//SDK下载地址 http://api-gw.onebound.cn/taobao/demo/sdk2020/onebound-api-sdk.zip
include ("ObApiClient.php");

$obapi = new otao\ObApiClient();
$obapi->api_url = "http://api-gw.onebound.cn/";
$obapi->api_urls = array("http://api-gw.onebound.cn/","http://api-1.onebound.cn/");//备用API服务器
$obapi->api_urls_on = true;//当网络错误时,是否启用备用API服务器
$obapi->api_key = "<您自己的apiKey>";
$obapi->api_secret = "<您自己的apiSecret>";
$obapi->api_version ="";
$obapi->secache_path ="runtime/";
$obapi->secache_time ="86400";
$obapi->cache = true;

$api_data = $obapi->exec(
                array(
	                "api_type" =>"taobao",
	                "api_name" =>"item_videolist",
	                "api_params"=>array (
  'channelId' => '0',
  'page' => '1',
)
                )
            );
 var_dump($api_data);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.nio.charset.Charset;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.PrintWriter;
import java.net.URLConnection;

public class Example {
	private static String readAll(Reader rd) throws IOException {
		StringBuilder sb = new StringBuilder();
		int cp;
		while ((cp = rd.read()) != -1) {
			sb.append((char) cp);
		}
		return  sb.toString();
	}
	public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException {
		URL realUrl = new URL(url);
		URLConnection conn = realUrl.openConnection();
		conn.setDoOutput(true);
		conn.setDoInput(true);
		PrintWriter out = new PrintWriter(conn.getOutputStream());
		out.print(body);
		out.flush();
		InputStream instream = conn.getInputStream();
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8")));
			String jsonText = readAll(rd);
			JSONObject json = new JSONObject(jsonText);
			return json;
		} finally {
			instream.close();
		}
	}
	public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException {
		URL realUrl = new URL(url);
		URLConnection conn = realUrl.openConnection();
		InputStream instream = conn.getInputStream();
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8")));
			String jsonText = readAll(rd);
			JSONObject json = new JSONObject(jsonText);
			return json;
		} finally {
			instream.close();
		}
	}
	public static void main(String[] args) throws IOException, JSONException {
		// 请求示例 url 默认请求参数已经URL编码处理
		String url = "https://api-gw.onebound.cn/taobao/item_videolist/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1";
		JSONObject json = getRequestFromUrl(url);
		System.out.println(json.toString());
	}

}
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String method = "GET";
static void Main(string[] args)
{
	String bodys = "";
	// 请求示例 url 默认请求参数已经做URL编码
	String url = "https://api-gw.onebound.cn/taobao/item_videolist/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1";
	HttpWebRequest httpRequest = null;
	HttpWebResponse httpResponse = null; 
	if (url.Contains("https://"))
	{
		ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
		httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
	}
	else
	{
		httpRequest = (HttpWebRequest)WebRequest.Create(url);
	}
	httpRequest.Method = method;
	if (0 < bodys.Length)
	{
		byte[] data = Encoding.UTF8.GetBytes(bodys);
		using (Stream stream = httpRequest.GetRequestStream())
		{
		stream.Write(data, 0, data.Length);
		}
	}
	try
	{
		httpResponse = (HttpWebResponse)httpRequest.GetResponse();
	}
	catch (WebException ex)
	{
		httpResponse = (HttpWebResponse)ex.Response;
	}
	Console.WriteLine(httpResponse.StatusCode);
	Console.WriteLine(httpResponse.Method);
	Console.WriteLine(httpResponse.Headers);
	Stream st = httpResponse.GetResponseStream();
	StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
	Console.WriteLine(reader.ReadToEnd());
	Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
	return true;
}
# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://api-gw.onebound.cn/taobao/item_videolist/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1"
headers = {
    "Accept-Encoding": "gzip",
    "Connection": "close"
}
if __name__ == "__main__":
    r = requests.get(url, headers=headers)
    json_obj = r.json()
    print(json_obj)
响应示例
{
		"items": {
		"channel_id": 0,
		"page": "5",
		"page_size": 10,
		"real_total_results": 1000,
		"total_results": 1000,
		"page_count": 100,
		"data_from": "app",
		"item": [
			{
				"title": "有温度的小石头",
				"num_iid": "295999018811",
				"view_count": "215",
				"pic_url": "https://img.alicdn.com/imgextra/i1/6000000006651/O1CN01G4pLtF1z0CtBZSU7F_!!6000000006651-0-tblive.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295999018811",
				"seller_info": {
					"user_num_id": "59632",
					"head_img": "//img.alicdn.com/imgextra/i3/6000000006633/O1CN01Qb05DO1yrxklqRO7j_!!6000000006633-0-tblive.jpg",
					"seller_nick": "善石柏缘"
				}
			},
			{
				"title": "小玩通的直播间",
				"num_iid": "295408948484",
				"view_count": "10",
				"pic_url": "https://img.alicdn.com/imgextra/i2/O1CN01v5Ks0Z1wsIoMjVn0m_!!0-tbCommonAudio.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295408948484",
				"seller_info": {
					"user_num_id": "254632",
					"head_img": "//gdp.alicdn.com/shop-logo//11/68/TB1cQ9JLrrpK1RjSZTESuwWAVXa.jpg",
					"seller_nick": "小哈香水严选"
				}
			},
			{
				"title": "新年囤好货新店大酬宾",
				"num_iid": "295773049663",
				"view_count": "12",
				"pic_url": "https://gw.alicdn.com/tfscom/i1/O1CN010Y9BYE1al305W4aex_!!0-dgshop.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295773049663",
				"seller_info": {
					"user_num_id": "403369",
					"head_img": "//gdp.alicdn.com/shop-logo//45/42/TB15C2n3uL2gK0jSZFmwu37iXXa.png",
					"seller_nick": "家乡好优选"
				}
			},
			{
				"title": "年货福利来啦",
				"num_iid": "296049354114",
				"view_count": "500",
				"pic_url": "https://img.alicdn.com/imgextra/i1/O1CN01xTxskf1CfVQlLcAhd_!!0-tbCommonAudio.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296049354114",
				"seller_info": {
					"user_num_id": "1148032",
					"head_img": "//img.alicdn.com/imgextra/i4/1148032/TB2_2Tzzv5TBuNjSspmXXaDRVXa_!!1148032-0-beehive-scenes.jpg",
					"seller_nick": "港仔先生"
				}
			},
			{
				"title": "大码女靴断码特价处理",
				"num_iid": "296024138273",
				"view_count": "291",
				"pic_url": "https://gw.alicdn.com/tfscom/i1/O1CN01TS0ijV1jceHIogR40_!!0-dgshop.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296024138273",
				"seller_info": {
					"user_num_id": "1264569",
					"head_img": "//gdp.alicdn.com/shop-logo//dc/5b/TB1Y1L7SpXXXXXHXXXXSutbFXXX.jpg",
					"seller_nick": "王小妖大码女鞋"
				}
			},
			{
				"title": "各店的300-130",
				"num_iid": "296254443199",
				"view_count": "4228",
				"pic_url": "https://gw.alicdn.com/tfscom/i1/O1CN01UZHHAP1CqUw7GNmz0_!!0-dgshop.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296254443199",
				"seller_info": {
					"user_num_id": "10820132",
					"head_img": "//img.alicdn.com/imgextra/i2/6000000006283/O1CN01QYWUUQ1wHf5qtd07i_!!6000000006283-0-tblive.jpg",
					"seller_nick": "果爸书书"
				}
			},
			{
				"title": "库茵新品上新",
				"num_iid": "295757777888",
				"view_count": "9307",
				"pic_url": "https://img.alicdn.com/imgextra/i3/6000000005960/O1CN01PYzift1ttjAbTeOvx_!!6000000005960-0-tblive.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295757777888",
				"seller_info": {
					"user_num_id": "27763132",
					"head_img": "//gw2.alicdn.com/tfscom/tuitui/TB1n0d2LXXXXXXFapXXXXXXXXXX",
					"seller_nick": "叭哒女王"
				}
			},
			{
				"title": "zhyt828的直播间",
				"num_iid": "295755881697",
				"view_count": "430",
				"pic_url": "https://img.alicdn.com/imgextra/i3/6000000003073/O1CN017gZnm51YZTkyshbyk_!!6000000003073-0-tblive.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295755881697",
				"seller_info": {
					"user_num_id": "30586132",
					"head_img": "//gdp.alicdn.com/shop-logo//b1/2a/TB10A9RiAyWBuNjy0FpSuussXXa.jpg",
					"seller_nick": "金华佛手"
				}
			},
			{
				"title": "年终大促~T特价场",
				"num_iid": "295440344582",
				"view_count": "560",
				"pic_url": "https://img.alicdn.com/imgextra/i1/O1CN01qnzeQP1FY7tbw0Nnm_!!0-tbCommonAudio.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295440344582",
				"seller_info": {
					"user_num_id": "36239832",
					"head_img": "//img.alicdn.com/imgextra/i3/36239832/O1CN01syc4oh2MV6iY6dGSv_!!36239832-0-beehive-scenes.jpg",
					"seller_nick": "COSHMIR"
				}
			},
			{
				"title": "新年背新包特惠抢不停",
				"num_iid": "296239047108",
				"view_count": "48",
				"pic_url": "https://gw.alicdn.com/tfscom/i4/O1CN01pjx0gq1YXeBPZifrk_!!0-dgshop.jpg",
				"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296239047108",
				"seller_info": {
					"user_num_id": "36453069",
					"head_img": "//gdp.alicdn.com/shop-logo/https://img.alicdn.com/imgextra/i4/6000000005925/O1CN01D9n0TY1tdhKqfGOYi_!!6000000005925-0-shopmanager.jpg",
					"seller_nick": "宁远包包"
				}
			}
		]
	},
	"error": "",
	"reason": "",
	"error_code": "0000",
	"cache": 0,
	"api_info": "today:27 max:10000",
	"execution_time": 0.637,
	"server_time": "Beijing/2021-01-20 16:32:35",
	"client_ip": "115.151.186.91",
	"call_args": [],
	"api_type": "taobao",
	"translate_language": "zh-CN",
	"translate_engine": "google_cn",
	"server_memory": "5.34MB",
	"request_id": "4.6007eaa2e0364"
	}
异常示例
{
  "error": "item-not-found",
  "reason": "商品没找到",
  "error_code": "2000",
  "success": 0,
  "cache": 0,
  "api_info": "today:0 max:10000",
  "execution_time": 0.081,
  "server_time": "Beijing/2020-06-10 23:44:00",
  "call_args": [],
  "api_type": "taobao",
  "request_id": "15ee0ffc041242"}
相关资料
错误码解释
状态代码(error_code) 状态信息 详细描述 是否收费
0000success接口调用成功并返回相关数据
2000Search success but no result接口访问成功,但是搜索没有结果
4000Server internal error服务器内部错误
4001Network error网络错误
4002Target server error目标服务器错误
4003Param error用户输入参数错误
4004Account not found用户帐号不存在
4005Invalid authentication credentials授权失败
4006API stopped您的当前API已停用
4007Account stopped您的账户已停用
4008API rate limit exceeded并发已达上限
4009API maintenanceAPI维护中
4010API not found with these valuesAPI不存在
4012Please add api first请先添加api
4013Number of calls exceeded调用次数超限
4014Missing url param参数缺失
4015Wrong pageToken参数pageToken有误
4016Insufficient balance余额不足
4017timeout error请求超时
5000unknown error未知错误
API 工具
如何获得此API
立即开通 有疑问联系客服QQ:QQ:583964941583964941(微信同号)