2011-08-09 18 views
6

Ebay APIで説明を返すにはどうすればよいですか?Ebay API with description

私は次のようにAPI呼び出しを行い、いくつかのコードを持っている:

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

をそれはアイテムを返しますが、それは完全な説明文が欠落しています。私は詳細な説明を求める次のステップを見ていない。あなたは、例えば、ショッピングAPIを使用する必要が

答えて

1

(イーベイからのアイテムの詳細を取得するための非常に簡単な関数)を以下:

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; 
}