TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
SpuSearchRequest req = new SpuSearchRequest();
req.setSort("id");
req.setKeyPropertyText("品牌:xx;型号:xx");
req.setStatus(1L);
req.setPageSize(20L);
req.setPageNum(1L);
req.setKeyProperties("100:100;98:98");
req.setTitle("iphone 6s");
req.setOrder("DESC");
req.setCatId(12L);
req.setCreateBegin(StringUtils.parseDateTime("2017-05-02 21:16:13"));
req.setChannel("zcy");
req.setCreateEnd(StringUtils.parseDateTime("2017-05-02 21:16:13"));
SpuSearchResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
SpuSearchRequest req = new SpuSearchRequest();
req.Sort = "id";
req.KeyPropertyText = "品牌:xx;型号:xx";
req.Status = 1L;
req.PageSize = 20L;
req.PageNum = 1L;
req.KeyProperties = "100:100;98:98";
req.Title = "iphone 6s";
req.Order = "DESC";
req.CatId = 12L;
req.CreateBegin = DateTime.Parse("2017-05-02 21:16:13");
req.Channel = "zcy";
req.CreateEnd = DateTime.Parse("2017-05-02 21:16:13");
SpuSearchResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new SpuSearchRequest;
$req->setSort("id");
$req->setKeyPropertyText("品牌:xx;型号:xx");
$req->setStatus("1");
$req->setPageSize("20");
$req->setPageNum("1");
$req->setKeyProperties("100:100;98:98");
$req->setTitle("iphone 6s");
$req->setOrder("DESC");
$req->setCatId("12");
$req->setCreateBegin("2017-05-02 21:16:13");
$req->setChannel("zcy");
$req->setCreateEnd("2017-05-02 21:16:13");
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.spu.search' \
-d 'partner_id=apidoc' \
-d 'session=cca86a68-3372-4a93-9b76-f209531f97c6' \
-d 'sign=2326E7BF9053796881C9733C5A546CAD' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-25+22%3A46%3A53' \
-d 'v=2.0' \
-d 'cat_id=12' \
-d 'channel=zcy' \
-d 'create_begin=2017-05-02+21%3A16%3A13' \
-d 'create_end=2017-05-02+21%3A16%3A13' \
-d 'key_properties=100%3A100%3B98%3A98' \
-d 'key_property_text=%E5%93%81%E7%89%8C%3Axx%3B%E5%9E%8B%E5%8F%B7%3Axx' \
-d 'order=DESC' \
-d 'page_num=1' \
-d 'page_size=20' \
-d 'sort=id' \
-d 'status=1' \
-d 'title=iphone+6s'
# -*- coding: utf-8 -*-
import top.api
req=top.api.SpuSearchRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.sort="id"
req.key_property_text="品牌:xx;型号:xx"
req.status=1
req.page_size=20
req.page_num=1
req.key_properties="100:100;98:98"
req.title="iphone 6s"
req.order="DESC"
req.cat_id=12
req.create_begin="2017-05-02 21:16:13"
req.channel="zcy"
req.create_end="2017-05-02 21:16:13"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.spu.search");
add_param(pRequest,"sort","id");
add_param(pRequest,"key_property_text","品牌:xx;型号:xx");
add_param(pRequest,"status","1");
add_param(pRequest,"page_size","20");
add_param(pRequest,"page_num","1");
add_param(pRequest,"key_properties","100:100;98:98");
add_param(pRequest,"title","iphone 6s");
add_param(pRequest,"order","DESC");
add_param(pRequest,"cat_id","12");
add_param(pRequest,"create_begin","2017-05-02 21:16:13");
add_param(pRequest,"channel","zcy");
add_param(pRequest,"create_end","2017-05-02 21:16:13");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.spu.search', {
'sort':'id',
'key_property_text':'品牌:xx;型号:xx',
'status':'1',
'page_size':'20',
'page_num':'1',
'key_properties':'100:100;98:98',
'title':'iphone 6s',
'order':'DESC',
'cat_id':'12',
'create_begin':'2017-05-02 21:16:13',
'channel':'zcy',
'create_end':'2017-05-02 21:16:13'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})