API文档中心

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

淘礼金淘口令解密、淘礼金有效性检测

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

接口主要是用于对淘宝联盟的淘礼金淘口令或淘礼金链接,进行解析提取淘礼金信自己,以及检测淘礼金是否仍有效。


淘礼金接口提取内容:

1、淘礼金产品基本信息,包含产品标题、店铺名等。

2、淘礼金中有的优惠券信息(如果优惠券过期,则这块内容为空)。

3、提取淘礼金中的PID信息。

4、淘礼金时间、金额等信息。

接口请求地址

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

请求方式:GETPOST

请求参数

参数名称 参数类型 必填 示例值 描述
vekey String V123M56 公共参数,接口秘钥,请在会员中心获取
para String $bVJ5cKcM5wM$ 淘礼金参数,接受2种参数:1.淘礼金淘口令,2.淘礼金链接

请求示例

  • HTTP
  • PHP
  • JAVA
  • PYTHON
GET/POST  http://api.veapi.cn/tbk/chkvegas?vekey=xxx&para=$bVJ5cKcM5wM$ 

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

$api="http://api.veapi.cn/tbk/chkvegas?vekey=xxx&para=$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; //返回值
使用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/chkvegas?vekey=xxx&para=$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);
    }
}
推荐使用 requests,支持访问http,https网页:

import requests
		
# 要访问的API网页
target_url = "http://api.veapi.cn/tbk/chkvegas?vekey=xxx&para=$bVJ5cKcM5wM$"

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

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

返回值(JSON)

参数名称 参数类型 示例值 描述
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 } } }

错误码

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

在线
客服

会员请加QQ群交流:

微信
咨询

加微信咨询
顶部