Im trying to perform a simple call using ebays search API, when I make a call I get no response, and the problem is with the actual call itself.
$endpoint = 'http://open.api.ebay.com/shopping?';
$responseEncoding = 'XML';
$version = '631'; // API version number
$appID = 'asdf3e6e3';
$itemType = "AllItemTypes";
$itemSort = "EndTime";
//find items advanced
$apicalla = "$endpoint"
."callname=FindItemsAdvanced"
."&version=$version"
."&siteid=0"
."&appid=$appID"
."&MaxEntries=10"
."&ItemSort=EndTime"
."&ItemType=AllItemTypes"
."&IncludeSelector=SearchDetails"
."&responseencoding=$responseEncoding";
$resp = simplexml_load_file($apicalla);
this call is the equivalent to
http://open.api.ebay.com/shopping?callname=FindItemsAdvanced&version=631&siteid=0&appid=asdf3e6e3&MaxEntries=10&ItemSort=EndTime&ItemType=AllItemTypes&IncludeSelector=SearchDetails&responseencoding=XML
My question is what am I missing to make this simple search call?
2
Answers
It looks like you’re trying to use eBay’s Shopping API, specifically the
FindItemsAdvanced
call which I believe was deprecated quite some time ago and may no longer be functional (I no longer see it in the call reference). What you want to do is use usefindItemsAdvanced
from eBay’s Finding API.First, you’ll need to change your API endpoint & query string parameters a bit (see the aforementioned
findItemsAdvanced
call reference for the specifics, but I believe it’ll look more like this (I haven’t touched myfindItemsAdvanced
calls in at least 6 months, so I haven’t tested this):In addition to this, to use
findItemsAdvanced
, you must specify what you’re searching for either by category (categoryId
) or by keywords (keywords
), hence the “Please specify a query!” error message.So, you also need to add something like the following (assuming keywords):
Giving you the following:
One final note: If you want to load further details of specific items that you find in your results, you’ll still want to use the Shopping API (specifically the GetSingleItem & GetMultipleItems calls). So, you may ultimately use a mix of the Shopping & Finding APIs.
It should be something like:
Log-in to your ebay developer account and click on this link: Test your calls with API Test Tool
Hope this helps.