API文档中心

热门接口:产品ID找同款全量维权查询万能转链字符串ID转换 (有API需求可联系本站)

淘宝天猫全网商品图文详情介绍接口

专用卡
调用权限:仅限专用卡调用
接口使用场景等说明:

获取淘宝、天猫全网的商品的图文详细介绍接口。可以查询非淘客商品

接口请求地址

环境 http 地址 https 地址
正式环境 http://api.veapi.cn/tbk/tbitems 暂无

请求方式:GETPOST

请求参数

参数名称 参数类型 必填 示例值 描述
vekey String V123M56 公共参数,接口秘钥,请在会员中心获取
id Number 551700864501 淘宝或天猫产品数字ID,不支持淘宝联盟字符串ID入参。
pcClient Number 0(默认) 可选值1,是否为PC端的图文信息。默认0表示返回移动端的图文信息。1表示要PC端的。
picType Number 1(默认) 表示图片的格式,可选1或2。默认1表示返回的图片地址字段item_detail值为干净的图片地址,2表示带HTML的图片代码。

请求示例

  • HTTP
  • PHP
  • JAVA
  • PYTHON
GET/POST  http://api.veapi.cn/tbk/tbitems?vekey=xxx&id=551700864501 

使用curl函数,curl不是php原生库,需要安装才能使用

$api="http://api.veapi.cn/tbk/tbitems?vekey=xxx&id=551700864501";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api);
//curl_setopt($ch, CURLOPT_POST, true);  //POST方式时启用
//curl_setopt($ch, CURLOPT_POSTFIELDS, $postData );  //POST方式时传参

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  //如果使用https请启用
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);  //如果使用https请启用
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );   //返回数据流,不直接输出
curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); //使用gzip压缩传输让访问更快
curl_setopt($ch, CURLOPT_TIMEOUT, 6);  //允许执行的最长秒数。这里设定6S
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);

$result = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

echo $result; //返回值
使用okhttp3/httpclient/jsoup/hutool,以hutool为例:

import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpRequest;

public class testGetParam {

    public static void main(String[] args) {
        // API网址
        String url = "http://api.veapi.cn/tbk/tbitems?vekey=xxx&id=551700864501";
        // JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权
        //System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");

        // 发送请求
        String result = HttpRequest.get(url)
                .timeout(10000)//设置超时,毫秒
                .execute().body();
        System.out.println(result);
    }
}
推荐使用 requests,支持访问http,https网页:

import requests
		
# 要访问的API网页
target_url = "http://api.veapi.cn/tbk/tbitems?vekey=xxx&id=551700864501"

# 发送请求
response = requests.get(target_url)

# 获取页面内容
if response.status_code == 200:
	print response.text

返回值(JSON)

参数名称 参数类型 示例值 描述
itemProperties Object   商品属性,比如品牌、产地、面料等等。
item_detail String ["//img...jpg","//img...jpg"] 图片对象。【重要说明】当产品介绍含有文字时,这时item_detail强制为html格式。比如很多书籍介绍,是图片+文字,如果还是只保留图片,就会破坏原详情介绍完整内容和排版,因此,这时item_detail就保留了原HTML内容。同时picType参数失效。请务必做好判断item_detail内容格式。

返回示例

【提示】推广链接通常有时效性,示例中的链接为创建文档时生成,仅用于展示返回结果使用,有可能已失效。
{ "error": "0", "msg": "商品图文详情调用成功", "isHtml": 0, "debugCode": "T000", "requestGlobal": "10", "data": { "sellerId": "2549841410", "itemProperties": [ { "name": "品牌", "value": "swisse " }, { "name": "系列", "value": "深海鱼油 " }, { "name": "产地", "value": "澳大利亚 " }, { "name": "适用性别", "value": "男女通用 " }, { "name": "颜色分类", "value": "1000mg 400粒 1500mg 400粒 升级款-1.6倍高浓度200粒 " }, { "name": "保质期", "value": "36个月 " }, { "name": "保质期", "value": "1095" } ], "item_detail": [ "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01mfD6ia1NYbNu8zURw_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01camgrn1NYbMEA92sL_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i1/3596641582/O1CN01vALMzg1NYbMDKb6fF_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN018xngno1NYbM1vtsZw_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01nKft7E1NYbMAC6kzp_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN015uJU721NYbM7EQT9v_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i2/3596641582/O1CN01gHWrcJ1NYbMEABOPF_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01T90ctI1NYbM9PK0nH_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i2/3596641582/O1CN013vYt1N1NYbLvfx6Io_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i2/3596641582/O1CN01TwzkWS1NYbLvfx29g_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN01NF6aeF1NYbLiMICb3_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i1/3596641582/O1CN01NBZk7f1NYbLYvxMZU_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i1/3596641582/O1CN015eIDjl1NYbLYvzAo6_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN01MokAf31NYbLPXS8mn_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01odIRsi1NYbLgGfsKG_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN01eg9CHz1NYbLPXQrn2_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN01apjGX91NYbLdUROoG_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i2/3596641582/O1CN01Nam9Y51NYbLeLzrwk_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i1/3596641582/O1CN01Nud9rF1NYbLjDfmOQ_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i4/3596641582/O1CN01X3RGFo1NYbLY9zhQb_!!3596641582-0-scmitem1000.jpg", "https://img.alicdn.com/imgextra/i3/3596641582/O1CN01XapEDG1NYbNDIJsBX_!!3596641582-2-scmitem1000.png", "//img.alicdn.com/imgextra/i4/O1CN01IjhlKv20nVEUPlzOV_!!6000000006894-2-tps-1500-1194.png" ] }, "request_id": "B2RqPRZ" }

错误码

如果error不为0时,请点此查看错误码表格

在线
客服

会员请加QQ群交流:

微信
咨询

加微信咨询
顶部