
接口使用场景等说明:接口主要是用于对淘宝联盟的淘礼金淘口令或淘礼金链接,进行解析提取淘礼金信自己,以及检测淘礼金是否仍有效。
淘礼金接口提取内容:
1、淘礼金产品基本信息,包含产品标题、店铺名等。
2、淘礼金中有的优惠券信息(如果优惠券过期,则这块内容为空)。
3、提取淘礼金中的PID信息。
4、淘礼金时间、金额等信息。
| 环境 | http 地址 | https 地址 |
|---|---|---|
| 正式环境 | http://api.veapi.cn/tbk/chkvegas | 暂无 |
| 参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
| para | String | 是 | $bVJ5cKcM5wM$ | 淘礼金参数,接受2种参数:1.淘礼金淘口令,2.淘礼金链接 |
GET/POST http://api.veapi.cn/tbk/chkvegas?vekey=xxx¶=$bVJ5cKcM5wM$
$api="http://api.veapi.cn/tbk/chkvegas?vekey=xxx¶=$bVJ5cKcM5wM$"; $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/chkvegas?vekey=xxx¶=$bVJ5cKcM5wM$";
// 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/chkvegas?vekey=xxx¶=$bVJ5cKcM5wM$" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
| 参数名称 | 参数类型 | 示例值 | 描述 |
|---|---|---|---|
| title | String | 新奥尔良腌料组合蜜汁2瓶装家用 | 产品标题 |
| num_iid | String | 1325434423 | 商品ID |
| pict_url | String | //img.al....ic.jpg | 主图 |
| small_images | String[] | [img...] | 商品小图 |
| user_type | Number | 1 | 商品是否为天猫:0-淘宝集市,1-天猫 |
| shop_title | String | 伍斯特旗舰店 | 店铺名 |
| seller_id | String | 2208760153926 | 店铺卖家ID |
| category_id | String | 50009826 | 分类 |
| pid | String | mm_11_222_333 | 该淘礼金的PID |
| tkRate | String | 160表示1.6% | 淘客佣金 |
| coupon | String[] | 优惠券信息,如为空则可能券领完或商家取消券。 | |
| vegasFields | Object | 淘礼金属性 | |
| status | String | 已过领取期 | 淘礼金状态描述 |
| rightsStatus | Number | 2 | 淘礼金状态说明 |
| sendStartTime | String | 1607875200000 | 淘礼金发放开始时间 |
| priceAfterAllRights | String | 11.90 | 使用淘礼金后价格 |
| rightsFace | String | 3.00 | 淘礼金使用后的金额 |
| effectDateInfo | String | {"relativeDays":1} | 过期日期信息:领取后1天内可用 |
| effectType | String | RELATIVE | 过期类型:领券后过期 RELATIVE_NATURAL |
| sendEndTime | String | 1608047999000 | 淘礼金发放结束时间 |
{ "error": "0", "msg": "淘礼金解析成功!", "data": { "title": "新奥尔良腌料组合蜜肉烧烤料调料", "num_iid": "626858286967", "pict_url": "//img.al....ic.jpg", "small_images": [ "//img.alicdn.com/i4......jpg", ], "user_type": 1, "shop_title": "伍斯特旗舰店", "nick": "伍斯特旗舰店", "seller_id": 2208760153926, "category_id": "50009826", "pid": "mm_239940109_976150476_109724700137", "tkRate": 160, "monthSellCount": "1542", "coupon": [], "vegasFields": { "status": "已过领取期", "rightsStatus": 2, "sendStartTime": 1607875200000, "pid": "mm_2399....", "priceAfterAllRights": "11.90", "rightsFace": "3.00", "effectDateInfo": "{\"relativeDays\":1}", "effectType": "RELATIVE", "sendEndTime": 1608047999000 } } }