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

{{item.type_name}}:

API 市场 / 定时拉取
 

定时拉取
吐槽建议
应用场景:
第一次拉取全量商品后(调用商品列表接口)。后续只需要调用本接口就可以实现商品的增量入库
接口说明:
用于获取商品库中所选时段内的所有有效商品。建议1h调用一次,从上一次拉取的最晚时间开始作为这一次的开始时间
使用人数: 7000+
定时拉取 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.2.3
  • 接口版本号:v1.2.2

请求地址:https://openapi.dataoke.com/api/goods/pull-goods-by-time 复制

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/pull-goods-by-time";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.2.3");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkPullGoodsByTimeRequest request = new DtkPullGoodsByTimeRequest();
request.setPageId("1");
request.setPageSize(100);
request.setCid("10");
request.setSubcid(1);
request.setPre(1);
request.setSort("0");
request.setStartTime("2021-7-14 15:09:00");
request.setEndTime("2021-7-14 15:59:00");
request.setFreeshipRemoteDistrict(1);
request.setChoice(1);
DtkApiResponse < DtkPageResponse < DtkGoodsListItemResponse >> execute = client.execute(request);
返回示例:
{
    "time":1554711897417,
    "code":0,
    "msg":"成功",
    "data":{
        "list":[
            {
            "id": 21631667,
			"goodsId": "599287662104",
			"title": "稻香村月饼广式蛋黄莲蓉豆沙散装多口味中秋送礼品团购尝鲜装礼盒",
			"dtitle": "【稻香村】9饼9味广式中秋月饼",
			"originalPrice": 24.9,
			"actualPrice": 14.9,
			"shopType": 1,
			"goldSellers": 0,
			"monthSales": 229734,
			"twoHoursSales": 1675,
			"dailySales": 281,
			"commissionType": 3,
			"desc": "【爆款返】【中华老字号,中国驰名商标,传承百年工艺】【聚划算44.9元。拍下立减20元。领10元券。到手价14.9元·】中秋月饼提前“购”,稻花千里,臻品世香,百年传承,九种口味,甜而不腻,口口酥软~",
			"couponReceiveNum": 0,
			"couponLink": "https://uland.taobao.com/quan/detail?sellerId=2935830269&activityId=fa1211336e194e81b0586e5d1bf38e17",
			"couponEndTime": "2019-08-15 23:59:59",
			"couponStartTime": "2019-08-15 00:00:00",
			"couponPrice": 10.0,
			"couponConditions": "20",
			"activityType": 3,
			"createTime": "2019-08-15 00:08:03",
			"mainPic": "https://img.alicdn.com/imgextra/i2/2531211011/O1CN01R4Wxsc1JL4yRWh8Jj_!!2531211011.png",
			"marketingMainPic": "https://sr.ffquan.cn/relate_pic/o_1di0mofb21nb2lqfkc51gv1n2cd.jpg",
			"sellerId": "2935830269",
			"cid": 6,
			"discounts": 0.6,
			"commissionRate": 30.0,
			"couponTotalNum": 100000,
			"haitao": 0,
			"activityStartTime": "2019-08-14 10:00:00",
			"activityEndTime": "2019-08-17 08:59:59",
			"shopName": "稻香村星皓专卖店",
			"shopLevel": 15,
			"descScore": 4.8,
			"brand": 1,
			"brandId": 92540,
			"brandName": "稻香村",
			"hotPush": 51,
			"teamName": "文案工会",
			"itemLink": "https://detail.tmall.com/item.htm?id=599287662104",
			"tchaoshi": 0,
			"detailPics": "",
			"dsrScore": -1,
			"dsrPercent": -1,
			"shipScore": -1,
			"shipPercent": -1,
			"serviceScore": -1,
			"servicePercent": -1,
			"subcid": [8738, 90936],
			"tbcid": 50008062,
			"quanMLink":10,
			"hzQuanOver":100,
			"yunfeixian":1,
			"estimateAmount":0,
			"shopLogo": "https://img.alicdn.com/imgextra//59/df/TB1lJVxNFXXXXcoXFXXSutbFXXX.jpg",
			"freeshipRemoteDistrict": 0
            }
        ],
        "totalNum":16499,
        "pageId":"76679471048598b0"
    }
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表:

请求地址:https://openapi.dataoke.com/api/goods/pull-goods-by-time 复制

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/pull-goods-by-time";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.2.2");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
String data = ApiClient.sendReq(url, appSecret, paraMap);
 //定时拉取
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/pull-goods-by-time";
    $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 GetPullGoodsByTime();
    $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": "639331017111",
	}

	// 4.业务请求,示例使用定时拉取和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.GetPrivilegeLink(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)
}
返回示例:
{
    "time":1554711897417,
    "code":0,
    "msg":"成功",
    "data":{
        "list":[
            {
            "id": 21631667,
			"goodsId": "599287662104",
			"title": "稻香村月饼广式蛋黄莲蓉豆沙散装多口味中秋送礼品团购尝鲜装礼盒",
			"dtitle": "【稻香村】9饼9味广式中秋月饼",
			"originalPrice": 24.9,
			"actualPrice": 14.9,
			"shopType": 1,
			"goldSellers": 0,
			"monthSales": 229734,
			"twoHoursSales": 1675,
			"dailySales": 281,
			"commissionType": 3,
			"desc": "【爆款返】【中华老字号,中国驰名商标,传承百年工艺】【聚划算44.9元。拍下立减20元。领10元券。到手价14.9元·】中秋月饼提前“购”,稻花千里,臻品世香,百年传承,九种口味,甜而不腻,口口酥软~",
			"couponReceiveNum": 0,
			"couponLink": "https://uland.taobao.com/quan/detail?sellerId=2935830269&activityId=fa1211336e194e81b0586e5d1bf38e17",
			"couponEndTime": "2019-08-15 23:59:59",
			"couponStartTime": "2019-08-15 00:00:00",
			"couponPrice": 10.0,
			"couponConditions": "20",
			"activityType": 3,
			"createTime": "2019-08-15 00:08:03",
			"mainPic": "https://img.alicdn.com/imgextra/i2/2531211011/O1CN01R4Wxsc1JL4yRWh8Jj_!!2531211011.png",
			"marketingMainPic": "https://sr.ffquan.cn/relate_pic/o_1di0mofb21nb2lqfkc51gv1n2cd.jpg",
			"sellerId": "2935830269",
			"cid": 6,
			"discounts": 0.6,
			"commissionRate": 30.0,
			"couponTotalNum": 100000,
			"haitao": 0,
			"activityStartTime": "2019-08-14 10:00:00",
			"activityEndTime": "2019-08-17 08:59:59",
			"shopName": "稻香村星皓专卖店",
			"shopLevel": 15,
			"descScore": 4.8,
			"brand": 1,
			"brandId": 92540,
			"brandName": "稻香村",
			"hotPush": 51,
			"teamName": "文案工会",
			"itemLink": "https://detail.tmall.com/item.htm?id=599287662104",
			"tchaoshi": 0,
			"detailPics": "",
			"dsrScore": -1,
			"dsrPercent": -1,
			"shipScore": -1,
			"shipPercent": -1,
			"serviceScore": -1,
			"servicePercent": -1,
			"subcid": [8738, 90936],
			"tbcid": 50008062,
			"quanMLink":10,
			"hzQuanOver":100,
			"yunfeixian":1,
			"estimateAmount":0,
			"shopLogo": "https://img.alicdn.com/imgextra//59/df/TB1lJVxNFXXXXcoXFXXSutbFXXX.jpg",
			"freeshipRemoteDistrict": 0
            }
        ],
        "totalNum":16499,
        "pageId":"76679471048598b0"
    }
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表: