<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="淘宝网搜索查询商品接口代码（php版）示例" id="card1">
<p> 游客</p><p>
标题:淘宝网搜索查询商品接口代码（php版）示例<br/>
正文:<br/>
今天介绍一个php版淘宝网查询商品接口代码的例子，下面要改成你的信息的在代码后面都有说明了，同时sdk包我们也要官方下载。下载SDK后直接引用包，并创建如下的类，并运行之，即完成了调用接口(taobao.user.seller.get)的过程（调用接口说明可见下载的SDK）<br/>说明：<br/>    TopClient为调用SDK的实例化类<br/>    UserSellerGetRequest为API的请求参数封装类<br/><br/>注：该接口是在沙箱环境下调用，获取的数据，也是沙箱中数据。若要获取线上环境，请填写自己创建应用获取过来的appkey,appsecret,并更改调用接口的环境地址,同时修改nick为淘宝登陆名。下载SDK包解压后与该文件放在同一目录下。代码如下:&amp;lt;?php<br/>header(&quot;Content-type: text/html; charset=utf-8&quot;);<br/>include &quot;TopSdk.php&quot;;<br/>//将下载SDK解压后top里的TopClient.php第8行$gatewayUrl的值改为沙箱地址:http://gw.api.tbsandbox.com/router/rest,<br/>//正式环境时需要将该地址设置为:http://gw.api.taobao.com/router/rest<br/><br/>//实例化TopClient类<br/>$c = new TopClient;<br/>$c-&amp;gt;appkey = &quot;xxxxxx&quot;; //换成你的appkey<br/>$c-&amp;gt;secretKey = &quot;xxxxxxxx&quot;; //换成你的secretKey<br/>$sessionkey= &quot;xxxxxx&quot;;   //如沙箱测试帐号sandbox_c_1授权后得到的sessionkey<br/>//实例化具体API对应的Request类<br/>$req = new UserSellerGetRequest;<br/>$req-&amp;gt;setFields(&quot;nick,user_id,type&quot;);<br/>//$req-&amp;gt;setNick(&quot;sandbox_c_1&quot;);<br/><br/>//执<br/><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1528&amp;Page=1">[&lt;&lt;]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1528&amp;Page=1">[[1]]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1528&amp;Page=2">[2]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1528&amp;Page=2">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=1528">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=1528">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://camnpr.com/wap.asp">首页</a>
</p>
</card>
</wml>