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

{{item.type_name}}:

API 市场 / 大淘客搜索
 

大淘客搜索
吐槽建议
应用场景:
用于搭建应用内的搜索功能,基于大淘客的商品数据进行搜索
接口说明:
通过关键词和筛选条件返回符合搜索内容的大淘客商品
使用人数: 9000+
大淘客搜索 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v2.1.2

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

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/get-dtk-search-goods";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v2.1.2");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
paraMap.put("pageSize", "20");
paraMap.put("keyWords", "男装");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkGetDtkSearchGoodsRequest request = new DtkGetDtkSearchGoodsRequest();
request.setPageId("1");
request.setKeyWords("男装");
request.setCids("1");
request.setSubcid(1);
request.setJuHuaSuan(0);
request.setTaoQiangGou(0);
request.setTmall(0);
request.setTchaoshi(0);
request.setGoldSeller(0);
request.setHaitao(0);
request.setBrand(0);
request.setBrandIds("218756504");
request.setPriceLowerLimit(BigDecimal.ONE);
request.setPriceUpperLimit(BigDecimal.TEN);
request.setCouponPriceLowerLimit(BigDecimal.ONE);
request.setCommissionRateLowerLimit(BigDecimal.ONE);
request.setMonthSalesLowerLimit(BigDecimal.TEN);
request.setSort("0");
request.setFreeshipRemoteDistrict(1);
DtkApiResponse < DtkPageResponse < DtkGetDtkSearchGoodsResponse1 >> execute = client.execute(request);
    //大淘客搜索
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/get-dtk-search-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 GetDtkSearchGoods();
    $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 {
		"keyWords": "测试",
	}

	// 4.业务请求,示例使用高效转链和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.GetDtkSearchGoods(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)
}
返回示例:
{
	"status": 200,
	"data": {
		"time": 1589008908021,
		"code": 0,
		"msg": "成功",
		"data": {
			"list": [{
				"id": 26146541,
				"goodsId": "561427522238",
				"title": "雪玲妃氨基酸洗面奶女男补水保湿控油深层清洁毛孔除螨洁面乳学生",
				"dtitle": "【明星同款】氨基酸洗面奶500g大容量",
				"originalPrice": 49.9,
				"actualPrice": 39.9,
				"shopType": 1,
				"goldSellers": 0,
				"monthSales": 343825,
				"twoHoursSales": 1043,
				"dailySales": 1779,
				"commissionType": 3,
				"desc": "【明星赵露思推荐】日本进口氨基酸,温和配方不刺激。敏感肌与孕妇都可以使用,同时里面添加烟酰胺成分,提亮肤色、减轻皮肤老化现象。一瓶抵五瓶,500g大容量。性价比超高。",
				"couponReceiveNum": 86000,
				"couponLink": "https://uland.taobao.com/quan/detail?sellerId=1588446985&activityId=1ccd166bd0ae4d70a6944395cc828bd9",
				"couponEndTime": "2020-05-15 23:59:59",
				"couponStartTime": "2020-05-05 00:00:00",
				"couponPrice": 10,
				"couponConditions": "49",
				"activityType": 1,
				"createTime": "2020-05-06 15:58:09",
				"mainPic": "https://img.alicdn.com/imgextra/i3/1588446985/O1CN01Q5RkUw21TB786kjKg_!!1588446985.jpg",
				"marketingMainPic": "",
				"sellerId": "1588446985",
				"cid": 3,
				"discounts": 0.8,
				"commissionRate": 20,
				"couponTotalNum": 100000,
				"haitao": 0,
				"activityStartTime": "",
				"activityEndTime": "",
				"shopName": "雪玲妃旗舰店",
				"shopLevel": 18,
				"descScore": 4.8,
				"brand": 0,
				"brandId": 218756504,
				"brandName": "雪玲妃",
				"hotPush": 110,
				"teamName": "吃鸡联盟",
				"itemLink": "https://detail.tmall.com/item.htm?id=561427522238",
				"tchaoshi": 0,
				"detailPics": "",
				"dsrScore": 4.8,
				"dsrPercent": 4.7,
				"shipScore": 4.7,
				"shipPercent": -1.22,
				"serviceScore": 4.7,
				"servicePercent": -1.24,
				"subcid": [111749],
				"quanMLink": 0,
				"hzQuanOver": 0,
				"yunfeixian": 1,
				"estimateAmount": -1,
				"freeshipRemoteDistrict": 1,
				"tbcid": 50011977
			}],
			"totalNum": 587,
			"pageId": "8ff77f0f38ac7a3c"
		}
	},
	"msg": "请求成功"
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表: