淘宝联盟高级API - 超级搜索api接口, 淘宝联盟商品搜索接口

淘宝联盟商品库超级搜索api接口,支持搜索商品链接、商品id,商品标题搜索,还有更多强大搜索选项。

注意:接口默认只查【含有优惠券】的商品,如果需要精确搜索,请将 has_coupon 参数设置为 false

1、注册订单侠开放平台账号

注册地址: https://www.dingdanxia.com/user/register/index.html  

2、获取接口秘钥apikey

登录个人中心 - 系统设置 - 接口管理 找到接秘钥apikey,apikey 接口秘钥是调用接口的唯一凭证,请妥善保管! 

3、授权淘宝联盟账号、填写推广位PID

登录个人中心 - 授权管理 - 淘宝授权, 授权自己的淘宝联盟账号,填写推广位pid (什么是推广位pid?

4、PHP代码调用示例

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的apikey';
//接口地址
$apiurl = "http://api.tbk.dingdanxia.com/tbk/super_search";


//开始调用
$result = curl_post($apiurl, array(
    //接口秘钥
        "apikey"    => $apikey,
	//搜索关键词,支持整个商品标题或单独的商品id搜索
	"q"        => "短裤",
	//是否只查带优惠券的 false 不检查券
	"has_coupon"=> false
));


//打印结果
print_r($result);

/**
 * post请求
 * @param string $url
 * @param array $params
 * @param int $timeout
 */
function curl_post($url, $params, $timeout = 3) {
    try {
        foreach ($params as $key => $val) {
            $post[] = "{$key}={$val}";
        }
        $post_data  = implode('&', $post);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        return curl_exec($ch);
    }
    catch (Exception $e) {
        return false;
    }
}

5、接口返回结果

{
    "code": 200,
    "msg": "请求成功【success】",
    "data": [
       {
                    "coupon_start_time":"2017-10-29",
                    "coupon_end_time":"2017-10-29",
                    "info_dxjh":"{\"19013551\":\"2850\",\"74510538\":\"2550\"}",
                    "tk_total_sales":"11",
                    "tk_total_commi":"323",
                    "coupon_id":"d62db1ab8d9546b1bf0ff49bda5fc33b",
                    "num_iid":556633720749,
                    "title":"毛呢阔腿裤港味复古女裤子秋冬九分裤萝卜裤显瘦高腰韩版2017新款",
                    "pict_url":"https:\/\/img.alicdn.com\/bao\/uploaded\/i4\/745957850\/TB1WzSRmV9gSKJjSspbXXbeNXXa_!!0-item_pic.jpg",
                    "small_images":{
                        "string":[
                            "https:\/\/img.alicdn.com\/i4\/3077291146\/TB2NA3poDnI8KJjSszgXXc8ApXa_!!3077291146.jpg"
                        ]
                    },
                    "reserve_price":"102.00",
                    "zk_final_price":"88.00",
                    "user_type":1,
                    "provcity":"杭州",
                    "item_url":"https:\/\/item.taobao.com\/item.htm?id=564591813536",
                    "include_mkt":"false",
                    "include_dxjh":"false",
                    "commission_rate":"1550表示15.5%",
                    "volume":123,
                    "seller_id":232332,
                    "coupon_total_count":22323,
                    "coupon_remain_count":111,
                    "coupon_info":"满299元减20元",
                    "commission_type":"MKT表示营销计划,SP表示定向计划,COMMON表示通用计划",
                    "shop_title":"xx旗舰店",
                    "url":"s.click.xxx",
                    "coupon_share_url":"uland.xxx",
                    "shop_dsr":13,
                    "white_image":"https:\/\/img.alicdn.com\/bao\/uploaded\/i4\/745957850\/TB1WzSRmV9gSKJjSspbXXbeNXXa_!!0-item_pic.jpg",
                    "short_title":"xxsd",
                    "category_id":162201,
                    "category_name":"连衣裙",
                    "level_one_category_id":20,
                    "level_one_category_name":"女装",
                    "oetime":"2018-08-21 11:23:31",
                    "ostime":"2018-08-21 11:23:31",
                    "jdd_num":10,
                    "jdd_price":"5",
                    "uv_sum_pre_sale":23,
                    "coupon_amount":"10.00",
                    "coupon_start_fee":"29.00",
                    "item_description":"夏季凉被 全棉亲肤",
                    "nick":"旗舰店",
                    "x_id":"uESS0mv8JvfJRMKlIgCD5At9VuHVBXoqBRihfQlo4ybLiKygRlqiN4eoxoZDfe38uSogWy6GB971jD2N8tLuuc",
                    "orig_price":"25",
                    "total_stock":5555,
                    "sell_num":1111,
                    "stock":4444,
                    "tmall_play_activity_info":"前n件x折",
                    "item_id":5678899993,
                    "real_post_fee":"0.00",
                    "lock_rate_start_time":1567440000000,
                    "lock_rate_end_time":1567440000000,
                    "lock_rate":"110",
                    "presale_discount_fee_text":"付定金立减5元",
                    "presale_tail_end_time":1567440000000,
                    "presale_tail_start_time":1567440000000,
                    "presale_end_time":1567440000000,
                    "presale_start_time":1567440000000,
                    "presale_deposit":"100"
         }
    ]
}

接口文档:https://www.dingdanxia.com/doc/15/8

在线测试:https://www.dingdanxia.com/apitest/15/8

实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值