查询商品及优惠券信息,返回的结果可调用转链接口(https://www.dingdanxia.com/doc/97/94)生成单品或二合一推广链接。支持按SKUID、关键词、优惠券基本属性、是否拼购、是否爆款等条件查询,建议不要同时传入SKUID和其他字段,以获得较多的结果。支持按价格、佣金比例、佣金、引单量等维度排序。用优惠券链接调用转链接口时,需传入搜索接口link字段返回的原始优惠券链接。
1、注册订单侠开放平台账号
2、获取接口秘钥apikey
登录个人中心 - 系统设置 - 接口管理 找到接秘钥apikey,apikey 接口秘钥是调用接口的唯一凭证,请妥善保管!
3、PHP代码调用示例
<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com [ 专为淘客开发者提供一站式API解决方案 ]
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的接口秘钥';
//京东联盟关键词商品查询接口
$apiurl = "http://api.tbk.dingdanxia.com/jd/query_goods";
//开始调用
$result = curl_post($apiurl, array(
//接口秘钥
"apikey" => $apikey,
));
//打印结果
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】",
"total_results":152294,
"data":[
{
"brandCode":"402906",
"brandName":"映趣",
"categoryInfo":{
"cid1":737,
"cid1Name":"家用电器",
"cid2":1276,
"cid2Name":"个护健康",
"cid3":739,
"cid3Name":"剃须刀"
},
"comments":386157,
"commissionInfo":{
"commission":13.98,
"commissionShare":20,
"plusCommissionShare":20
},
"couponInfo":{
"couponList":[
]
},
"goodCommentsShare":97,
"imageInfo":{
"imageList":[
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/96487/22/6349/92783/5df2645cEa169b540/9746ae0dde2c0902.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/124873/32/1134/421715/5eba3a96E930a3ec9/9025fd09b8daf7c1.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/76049/17/10766/269343/5d81cdfcE94270730/8bdea655c724760f.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/43558/20/9009/125822/5d25d66eE6ae6c426/f03371d208964c18.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/40674/38/15264/173769/5d81cdfcE1155d926/fd8dac48b4b66cd4.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/78281/7/4289/86108/5d25d66eEe2d3a71a/2d65430853ca2a7b.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/60531/10/10703/192936/5d81cdfcEb87a9753/8db3fa82fc49d648.jpg"
},
{
"url":"http://img14.360buyimg.com/ads/jfs/t1/77480/9/4201/123443/5d25d66eEf6a56ed8/158d5a2fdd010a56.jpg"
}
]
},
"inOrderComm30Days":1635262.43,
"inOrderCount30Days":160498,
"isHot":1,
"isJdSale":0,
"materialUrl":"item.jd.com/62699616986.html",
"owner":"p",
"pinGouInfo":[
],
"pingGouInfo":[
],
"priceInfo":{
"lowestPrice":69.9,
"lowestPriceType":1,
"price":69.9
},
"shopInfo":{a
"shopId":10063117,
"shopLevel":4,
"shopName":"映趣旗舰店"
},
"skuId":62699616986,
"skuName":"映趣电动剃须刀男士电动刮胡刀充电式三刀头家用便携式轻便胡须刀 暗夜黑",
"spuid":52260782409,
"videoInfo":[
]
}
]
}