接口使用场景等说明:根据您提供的一个产品图片(通常是产品主图,但不限于淘宝产品图),找出淘宝天猫上同款的有佣金的淘客商品。
此API适用于淘客APP、微信公众号的淘客应用的“拍照搜同款、发图找券”、微信机器人“发图找券”及视觉搜索模块搭建。
| 环境 | http 地址 | https 地址 |
|---|---|---|
| 正式环境 | http://api.veapi.cn/tbk/picsimilaritem | 暂无 |
| 参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
| pic | String | 是 | http://...img | 你要找同款或近似款的商品图片,支持格式有png,jpg,jpeg,bmp,gif,webp。可以是http开始的图片网络地址(请urlencode编码),图片像素分辨率必须介于100-4000之间,最大不要超过2M。推荐你自己本地服务器上的图片url地址。 |
| relationId | String | 否 | 5668841122 | 淘客渠道ID |
| page | Number | 否 | 1 | 页码,默认1 |
| pageSize | Number | 否 | 20 | 每页返回值,默认10,最大20 |
| region | String | 否 | 您自己选中的图片区域,格式为x1,x2,y1,y2, 其中x1,y1 是左上角的点,x2,y2是右下角的点。如90,316,156,506,比如现在有一些应用在一张图片上切出多个区域,分别推荐图中的衣服,手提包,拉杆箱等等。 | |
| fields | String | 否 | 1 | 可选值空或1或指定字段名,当您不需要返回那么多字段时,可以指定字段返回或设为1返回主要字段。默认PicUrl,ReservePrice,Title,Url,ZkFinalPrice字段必返回。 |
GET/POST http://api.veapi.cn/tbk/picsimilaritem?vekey=xxxx&fields=&pic=https:%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi3%2F3937219703%2FO1CN01eRAhx72LY1nulcbwC_%21%213937219703-0-C2M.jpg
$api="http://api.veapi.cn/tbk/picsimilaritem?vekey=xxxx&fields=&pic=https:%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi3%2F3937219703%2FO1CN01eRAhx72LY1nulcbwC_%21%213937219703-0-C2M.jpg"; $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; //返回值
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/picsimilaritem?vekey=xxxx&fields=&pic=https:%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi3%2F3937219703%2FO1CN01eRAhx72LY1nulcbwC_%21%213937219703-0-C2M.jpg";
// JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权
//System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
// 发送请求
String result = HttpRequest.get(url)
.timeout(10000)//设置超时,毫秒
.execute().body();
System.out.println(result);
}
}
import requests # 要访问的API网页 target_url = "http://api.veapi.cn/tbk/picsimilaritem?vekey=xxxx&fields=&pic=https:%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi3%2F3937219703%2FO1CN01eRAhx72LY1nulcbwC_%21%213937219703-0-C2M.jpg" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
| 参数名称 | 参数类型 | 示例值 | 描述 |
|---|---|---|---|
| RankScore | String | 0.98 | 产品近似比率 |
| CategoryName | String | 中筒袜 | 分类名 |
| CommissionRate | Number | 310 | 佣金,千位表示法,310表示3.1% |
| CouponAmount | Number | 10 | 优惠券面额,无券时值0 |
| CouponEndTime | String | 2023-01-02 | 优惠券结束时间 |
| CouponInfo | String | 满3.0元减2.0元 | 优惠券描述 |
| CouponRemainCount | Number | 2900 | 优惠券余量 |
| CouponStartFee | String | 3.00 | 优惠券起用金额 |
| CouponStartTime | String | 2022-12-03 | 优惠券起始时间 |
| CouponTotalCount | String | 5000 | 优惠券总量 |
| ItemId | Number | 684757302845 | 产品ID |
| LevelOneCategoryName | String | 女士内衣 | 叶子分类名 |
| MaxCommission | Object | 高佣信息 | |
| MaxCommissionRate | String | 20.4 | 商品信息-最优佣金率。如:20.4表示佣金率为20.4%。 |
| MaxCommissionClickUrl | String | s.click... | 商品信息-链接-最优佣金率宝贝推广链接。 |
| MaxCommissionCouponShareUrl | String | uland.taobao... | 商品信息-链接-最优佣金率宝贝+券二合一页面链接。 |
| Nick | String | 旺旺名 | |
| PicUrl | String | https://img...jpg | 主图 |
| PriceAfterCoupon | String | 19.90 | 券后价。 |
| Provcity | String | 浙江 杭州 | 商品信息-宝贝所在地。 |
| ReservePrice | String | 19.9 | 商品信息-一口价通常显示为划线价。 |
| SellerId | String | 2209041379559 | 卖家ID |
| ShopTitle | String | 淘工厂淘特官方直营店 | 店铺名称 |
| ShortTitle | String | 秋冬季中长筒韩版ins | 短标题(移动端建议使用) |
| SubTitle | String | xxx女装 | 商品子标题。 |
| Title | String | 袜子女秋冬季中长筒加厚韩版ins | 标题。 |
| UserType | Number | 3 | 店铺信息-卖家类型:1天猫,0淘宝,3淘特 |
| Volume | Number | 24 | 近30天销量 |
| ZkFinalPrice | String | 19.9 | 折后价 |