接口使用场景等说明:本接口可以帮助淘客查询商品可用的店铺券。为您的客户提供更实惠的券选择。
环境 | http 地址 | https 地址 |
---|---|---|
正式环境 | http://api.veapi.cn/tbk/shopcoupon | 暂无 |
参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
itemid | Number | 是 | 626132884654 | 要查询的淘宝或天猫的商品ID |
sellerId | Number | 否 | 225321822932065953 | 店铺ID,在搜索或高佣转链详情接口有此参数值 |
GET/POST http://api.veapi.cn/tbk/shopcoupon?vekey=xxx&itemid=626132884654【例子】动态字符串ID入参
http://api.veapi.cn/tbk/shopcoupon?vekey=xxx&itemid=x0jgvwXsktqa26vT6O4Fwu9-4b9dPpsymMeqdK8tN
$api="http://api.veapi.cn/tbk/shopcoupon?vekey=xxx&itemid=626132884654"; $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/shopcoupon?vekey=xxx&itemid=626132884654"; // 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/shopcoupon?vekey=xxx&itemid=626132884654" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
参数名称 | 参数类型 | 示例值 | 描述 |
---|---|---|---|
coupons_total | Number | 3 | 优惠券和积分等活动数量 |
subTitles | Object | 有效期至2022.12.31 23:59 | 有效期描述 |
effectiveTime | Number | 1669824000000 | 有效期起始时间 |
unEffectiveTime | Number | 1672502399000 | 有效期结束时间 |
titles | Number | 满199使用 | 起用条件 |
priceText | Number | 5 | 优惠券面额 |
uuid | String | 14da4e5a54e74529ad9ab9234e4658d9 | 优惠券ID |
{ "error": "0", "msg": "店铺优惠券查询成功!", "coupons_total": 3, "has_coupon_prom": 0, "data": [ { "priceDes": "折", "subTitles": [ "距到期仅剩3天" ], "applyUrl": "//h5.m.taobao.com/shopb/shopactivity.html?activityId=71108298780&sellerId=2200559522613&source=2&spm=W-a211f8.10431435&scm=20140619.detail.dpb.0", "effectiveTime": 1693497600000, "titles": [], "type": 1007, "items": [ { "actionType": "1", "actionValue": "8.5", "title": "满1件,打8.5折", "gifts": [], "promotionUniqueId": "71108298780-1" } ], "priceText": "8.5", "unEffectiveTime": 1694001540000, "logoImageUrl": "https://gw.alicdn.com/tfs/TB1lm7shoT1gK0jSZFrXXcNCXXa-498-90.png", "bgUrl": "https://gw.alicdn.com/tfs/TB1rPY7gkT2gK0jSZFkXXcIQFXa-714-142.png" }, { "des": "包邮", "effectiveTime": 1669003309000, "title": "满98包邮", "type": 1005, "unEffectiveTime": 1703952000000 }, { "priceCurrency": "¥", "subTitles": [ "有效期至2022.12.31 23:59" ], "effectiveTime": 1669824000000, "titles": [ "满199使用" ], "applyText": "立即领取", "type": 1, "uuid4Cal": "14da4e5a54e74529ad9ab9234e4658d9", "priceText": "5", "unEffectiveTime": 1672502399000, "uuid": "14da4e5a54e74529ad9ab9234e4658d9", "promotionUniqueId": "14da4e5a54e74529ad9ab9234e4658d9" }, { "priceCurrency": "¥", "subTitles": [ "有效期至2022.12.31 23:59" ], "effectiveTime": 1671120000000, "titles": [ "满10使用" ], "applyText": "立即领取", "type": 20, "uuid4Cal": "55c62a91bf25489682fb5b6cc5eeee38", "priceText": "4", "unEffectiveTime": 1672502399000, "uuid": "55c62a91bf25489682fb5b6cc5eeee38", "promotionUniqueId": "55c62a91bf25489682fb5b6cc5eeee38" }, { "des": "积分", "title": "购买预计可得8积分", "type": 1004 } ] }