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

{{item.type_name}}:

API 市场 / 商品更新
 

商品更新
吐槽建议
应用场景:
用于获取一定时间段内热销,领券量,价格等关键信息有变化的商品信息
接口说明:
实时更新已经入库的商品在一定时间段内热销,领券量,价格等关键信息的数据变化情况(建议2分钟调用一次,保证数据的准确)
使用人数: 7000+
商品更新 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.2.0
  • 接口版本号:v1.1.0

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

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/get-newest-goods";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.2.0");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
paraMap.put("pageSize", "20");
paraMap.put("startTime", "2020-03-22 23:12:12");
paraMap.put("startTime", "2020-03-22 23:22:30");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkNewestGoodsRequest request = new DtkNewestGoodsRequest();
request.setPageId("1");
request.setPageSize(10);
request.setStartTime("2021-07-12 15:05:00");
request.setEndTime("2021-07-13 15:05:05");
request.setCids("1");
request.setSubcid(1);
request.setJuHuaSuan(1);
request.setTmall(1);
request.setTaoQiangGou(1);
request.setGoldSeller(1);
request.setHaitao(1);
request.setBrand(1);
request.setBrandIds("296748800");
request.setPreSale(1);
request.setPriceLowerLimit(BigDecimal.ONE);
request.setPriceUpperLimit(BigDecimal.TEN);
request.setCouponPriceLowerLimit(BigDecimal.ONE);
request.setCommissionRateLowerLimit(BigDecimal.ONE);
request.setMonthSalesLowerLimit(BigDecimal.ONE);
request.setSort("0");
DtkApiResponse < DtkPageResponse < DtkNewestGoodsResponse >> execute = client.execute(request);
 //商品更新
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/get-newest-goods";
    $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 GetNewestGoods();
    $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 {
		"pageId": "1",
	}

	// 4.业务请求,示例使用商品更新和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.GetNewestGoods(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)
}
返回示例:
{
				"id": 29742364,
				"goodsId": "15426311130",
				"originalPrice": 99.8,
				"actualPrice": 59.8,
				"monthSales": 67884,
				"twoHoursSales": 56423,
				"dailySales": 56544,
				"commissionType": 3,
				"couponReceiveNum": 73,
				"couponPrice": 40,
				"discounts": 0.4,
				"commissionRate": 15,
				"hotPush": 1498,
				"subcid": [],
				"couponId": "33ea85a9de7e47a9a91a7fa3bf3e2b66",
				"couponLink": "https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=33ea85a9de7e47a9a91a7fa3bf3e2b66",
				"couponRemainCount": 99927,
				"specialText": ["拍4件48盒"]
			}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表:

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

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/get-newest-goods";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.1.0");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
paraMap.put("pageSize", "20");
paraMap.put("startTime", "2020-03-22 23:12:12");
paraMap.put("startTime", "2020-03-22 23:22:30");
String data = ApiClient.sendReq(url, appSecret, paraMap);
 //商品更新
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/get-newest-goods";
    $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 GetNewestGoods();
    $client->setAppKey("xxxxxxxxx");
    $client->setAppSecret("xxxxxxxxxxxxxxxxxxxxxxxxx");
    $client->setVersion("v1.0.0");

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

返回示例:
{
    "time": 1554971857451,
    "code": 0,
    "msg": "成功",
    "data": {
        "list": [
            {
            "id": 21631667,
			"goodsId": "599287662104",
			"originalPrice": 24.9,
			"actualPrice": 14.9,
			"monthSales": 229734,
			"twoHoursSales": 1675,
			"dailySales": 281,
			"commissionType": 3,
			"couponReceiveNum": 0,
			"couponPrice": 10.0,
			"discounts": 0.6,
			"commissionRate": 30.0,
			"hotPush": 51,
			"subcid": [8738, 90936]
            }
        ],
        "totalNum": 20069,
        "pageId": "bcc699f1fc4ecaf5"
    }
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表: