API文档中心

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

抖客专属优惠券查询

调用权限:核心接口会员卡调用
接口使用场景等说明:

抖客商品专属券查询,只能查询抖客专属券,不返回商品的通用券

接口请求地址

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

请求方式:GETPOST

请求参数

参数名称 参数类型 必填 示例值 描述
vekey String V123M56 公共参数,接口秘钥,请在会员中心获取
product_url String 3767271465246917268 商品链接

请求示例

  • HTTP
  • PHP
  • JAVA
  • PYTHON
GET/POST  http://api.veapi.cn/douke/csj_productselect?vekey=xxx&product_url=3767271465246917268 

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

$api="http://api.veapi.cn/douke/csj_productselect?vekey=xxx&product_url=3767271465246917268";

$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/douke/csj_productselect?vekey=xxx&product_url=3767271465246917268";
        // 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/douke/csj_productselect?vekey=xxx&product_url=3767271465246917268"

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

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

返回值(JSON)

参数名称 参数类型 示例值 描述
is_coupon_product Bool false 是否包含优惠券
coupons List   优惠券信息
coupon_type Int 1 优惠券类型 0:无效券类型 1:抖客团长渠道券
status Int 1 优惠券状态 1 新建 2 生效 3 过期 4 失效 5 删除
discount Int 85 折扣券折扣,8.5折则为85
threshold Int 600 满减门槛,金额分
credit Int 600 满减/直减金额,金额分
start_apply_time Int 1234567890 券领取开始时间
end_apply_time Int 1234567890 券领取结束时间
coupon_validity_type Int 1 券使用有效期类型:1固定有效期类型,2浮动有效期类型
coupon_valid_period Int   浮动有效期,单位s
coupon_start_time Int 1234567890 券使用开始时间
coupon_end_time Int 1234567890 券使用结束时间
total_amount Int 6000 券总数量
left_amount Int 3000 剩余数量

返回示例

【提示】推广链接通常有时效性,示例中的链接为创建文档时生成,仅用于展示返回结果使用,有可能已失效。
{ "code": 0, "desc": "", "data": { "is_coupon_product": true, "coupons": [ { "coupon_type": 1, "status": 2, "coupon_sub_type": 2, "discount": 0, "threshold": 0, "credit": 2000, "start_apply_time": 1710172800, "end_apply_time": 1719763200, "coupon_validity_type": 2, "coupon_valid_period": 7776000, "coupon_start_time": 1, "coupon_end_time": 1, "total_amount": 20, "left_amount": 0 } ] } }

错误码

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

在线
客服

会员请加QQ群交流:

微信
咨询

加微信咨询
顶部