大淘客,让选品更简单! |

{{item.type_name}}:

API 市场 / 商品历史券后价
 

商品历史券后价
吐槽建议
应用场景:
可用于商品详情页,帮助用户了解当前是否是近期最低价,以便于刺激消费欲望。进而提升转化
接口说明:
接口返回该商品在大淘客近期的上架价格趋势变化
使用人数: 2000+
商品历史券后价 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

请求地址:https://openapi.dataoke.com/api/goods/price-trend 复制

请求方式:GET

公共参数:
请求参数:

注:请求参数须区分大小写

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/price-trend";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.0");
paraMap.put("appKey", appKey);
paraMap.put("id", "29312967");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkPriceTrendRequest request = new DtkPriceTrendRequest();
request.setId("34634133");
request.setGoodsId("589284195570");
DtkApiResponse < DtkPriceTrendResponse > execute = client.execute(request);
 //商品历史券后价
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/price-trend";
    $url = $host . '?' . http_build_query($data);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $output = curl_exec($ch);
    $a = curl_error($ch);
    if(!empty($a)){
        return json_encode(array('code'=>10003, 'msg'=>$a));
    }
    curl_close($ch);
    return $output;

    SDK调用示例
    $client = new GetGoodsPriceTrend();
    $client->setAppKey("xxxxxxxxx");
    $client->setAppSecret("xxxxxxxxxxxxxxxxxxxxxxxxx");
    $client->setVersion("v1.0.0");

    $res = $client->setParams([])->request();

package main

import (
	"fmt"
	"gitee.com/dtk-developer/openapi-sdk-go/sdk"
)

func main() {
	// 1.初始化所需要的参数appKey, appSecret, version
	var (
		appKey = "xxxxxxxxxx"
		appSecret = "xxxxxxxxxx"
		version = "v1.3.1"
	)

	// 2.初始化开放平台api的客户端句柄
	oa := &sdk.OpenApi{}
	oa.AppKey = appKey
	oa.AppSecret = appSecret
	oa.Version = version
	client :=  oa.GetClient()

	// 3.准备请求参数
	params := map[string]string {
		"goodsId": "639331017111",
	}

	// 4.业务请求,示例使用淘系商品历史券后价和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.PriceTrendGoods(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)

	// 复用client句柄
	params = map[string]string {
		// 指定接口版本
		"version": "v1.0.0",
		"content": "1👈¥fym8XiJU9Oi¥ https://s.click.taobao.com/Ys3TNlu  包邮 漫花抽纸10包4层加厚280张/包纸巾卫生纸家用实惠装面巾纸",
	}
	resp, err = client.ParseContent(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)
}
返回示例:
{
    "code": "1",
    "data": {
        "brandId": 3363016,
        "brandName": "kate spade",
        "commissionRate": 6,
        "commissionType": 3,
        "couponConditions": "2000",
        "couponEndTime": "2022-11-11 23:59:59",
        "couponPrice": 200,
        "couponReceiveNum": 0,
        "couponStartTime": "2022-10-15 00:00:00",
        "couponTotalNum": 1000,
        "dailySales": 0,
        "desc": "market中号老花提花葡萄柚托特包,融入品牌标志性四叶花元素中清新的葡萄柚元素,减龄可配以光面皮革镶边,打造轻盈挺括的中号托特包宽裕主间可轻松收纳皮夹、手机、太阳镜、钥匙等随身物品",
        "dtitle": "【双11预售】katespade中号老花托特包",
        "goodsId": "kWRgj4eRVDFYt3J6P0hG9DtPtJ-VrGvymkIkBk6V974ugw",
        "goodsSign": "kWRgj4eRVDFYt3J6P0hG9DtPtJ-VrGvymkIkBk6V974ugw",
        "historicalPrice": [
            {
                "actualPrice": 1280,
                "date": "2022-10-24 20:00:00"
            },
            {
                "actualPrice": 1530,
                "date": "2022-10-31 14:28:48"
            }
        ],
        "id": 39690128,
        "itemLink": "https://detail.tmall.com/item.htm?id=675167771090",
        "mainPic": "https://img.alicdn.com/imgextra/i2/2206905338798/O1CN01spODcn2ErXLPO0odR_!!2206905338798.jpg",
        "marketingMainPic": "",
        "monthSales": 0,
        "originalPrice": 1480,
        "title": "【双11预售】kate spade ks market 中号老花提花葡萄柚托特包女",
        "twoHoursSales": 0
    },
    "msg": "成功",
    "time": 1667284381
}
错误码列表: