6

如何让 Ebay API 返回描述?

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

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

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

4

2 回答 2

4

您必须使用 Shopping API,例如:http: //developer.ebay.com/DevZone/shopping/docs/CallRef/GetSingleItem.html#sampledescriptionitemspecifics

于 2011-08-09T20:43:17.913 回答
1

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

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;
}
于 2016-10-01T20:30:55.297 回答