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

{{item.type_name}}:

API 市场 / 猜你喜欢
 

猜你喜欢
吐槽建议
应用场景:
一般用在首页底部,或者个人中心底部。根据用户浏览的类型,进行猜你喜欢推荐。帮助用户进一步转化
接口说明:
接口根据用户的浏览行为,推荐所访问商品同品类相似的商品。如用户访问充电器,则猜你喜欢则会推荐一些与充电器相关的商品
使用人数: 6000+
猜你喜欢 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.2.2

请求地址:https://openapi.dataoke.com/api/goods/list-similer-goods-by-open 复制

请求方式:GET

公共参数:
请求参数:

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

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

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkListSimilerGoodsByOpenRequest request = new DtkListSimilerGoodsByOpenRequest();
request.setId(34634133);
request.setSize(10);
DtkApiResponse < DtkPageResponse < DtkListSimilerGoodsByOpenResponse >> execute = client.execute(request);
 //猜你喜欢
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/list-similer-goods-by-open";
    $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 GetListSimilerGoods();
    $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 {
		"id": "639331017111",
	}

	// 4.业务请求,示例使用猜你喜欢和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.ListSimilarGoodsByOpen(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": 1555400012796,
	"code": 0,
	"msg": "成功",
	"data": [{
			"id": 20140409,
			"goodsId": "592823281538",
			"title": "耶子夏季透气走秀款老爹鞋网布鞋飞织运动鞋男鞋运动鞋四季款ins2",
			"dtitle": "夏季透气网布鞋飞织男鞋运动鞋",
			"originalPrice": 609.0,
			"actualPrice": 109.0,
			"shopType": 1,
			"goldSellers": 0,
			"monthSales": 216,
			"twoHoursSales": 0,
			"dailySales": 0,
			"commissionType": 3,
			"desc": "超火、高颜值,全网面,透气,帅气侧漏!舒适不闷脚,聚力回弹,减震缓震,按摩级舒适脚感,享受夏天清透运动~",
			"couponReceiveNum": 2,
			"couponLink": "https://uland.taobao.com/quan/detail?sellerId=2200827132125&activityId=5b5ddf1a90ff465189727050a60b19d4",
			"couponEndTime": "2019-06-12 07:59:59",
			"couponStartTime": "2019-06-04 08:00:00",
			"couponPrice": 500.0,
			"couponConditions": "580",
			"couponId": "5b5ddf1a90ff465189727050a60b19d4",
			"activityType": 1,
			"createTime": "2019-06-03 23:37:25",
			"mainPic": "//img.alicdn.com/imgextra/i3/2200827132125/O1CN017a23gD1RZIATh0rfM_!!2200827132125.jpg",
			"marketingMainPic": "",
			"sellerId": "2200827132125",
			"cid": 5,
			"discounts": 0.18,
			"commissionRate": 20.0,
			"couponTotalNum": 50000,
			"haitao": 0,
			"activityStartTime": "",
			"activityEndTime": "",
			"shopName": "kzom旗舰店",
			"shopLevel": 9,
			"descScore": 4.9,
			"brand": 0,
			"brandId": 1586063976,
			"brandName": "",
			"hotPush": 0,
			"teamName": "火星联盟",
			"itemLink": "https://detail.tmall.com/item.htm?id=592823281538",
			"tchaoshi": 0,
			"dsrScore": 4.8,
			"dsrPercent": 0.0,
			"shipScore": 4.8,
			"shipPercent": 10.32,
			"serviceScore": 4.8,
			"servicePercent": 5.82,
			"subcid":[86369,90723],
			"tbcid": 50012906,
			"quanMLink":10,
			"hzQuanOver":100,
			"yunfeixian":1,
			"estimateAmount":0,
			"freeshipRemoteDistrict":1
		}]
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表: