我用下面的(很簡單的功能,從易趣獲得項目細節):
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;
}
什麼是購物API和查找的區別API? – daviesgeek
發現API是一個輕量級API,旨在允許您的應用程序提供項目的快速列表(又名無細節)。 – Nazin
啊...非常感謝! – daviesgeek