Ebay API及其说明

时间:2011-08-09 20:32:22

标签: ebay ebay-api

如何让Ebay API返回说明?

我有一些代码可以进行API调用,如下所示:

http://svcs.ebay.com/services/search/FindingService/v1?
callname=findItemsAdvanced&
responseencoding=XML&
appid=appid&
siteid=0&
version=525&
QueryKeywords=keywords;

它会返回项目,但它缺少完整的描述文本。我没有看到要求详细描述的下一步。

2 个答案:

答案 0 :(得分:4)

答案 1 :(得分:2)

我使用以下(非常简单的函数从ebay获取Item详细信息):

function eBayGetSingle($ItemID){
   $URL = 'http://open.api.ebay.com/shopping';

   //change these two lines
   $compatabilityLevel = 967; 
   $appID = 'YOUR_APP_ID_HERE';

   //you can also play with these selectors
   $includeSelector = "Details,Description,TextDescription,ShippingCosts,ItemSpecifics,Variations,Compatibility";


   // Construct the GetSingleItem REST call         
   $apicall = "$URL?callname=GetSingleItem&version=$compatabilityLevel"
            . "&appid=$appID&ItemID=$ItemID"
            . "&responseencoding=XML"
            . "&IncludeSelector=$includeSelector"; 
   $xml = simplexml_load_file($apicall);

   if ($xml) {
     $json = json_encode($xml);
     $array = json_decode($json,TRUE);
     return $array;
   }
   return false;
}