Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get the eBay Category List via an API programmatically?

My goal is to get a list of eBay categories programmatically.

It appears that the GetCategories method is only available from the Trading API. If I understand correctly, there is user interaction required to log into the Trading API: http://developer.ebay.com/DevZone/XML/docs/HowTo/Tokens/GettingTokens.html

Is there another method to get the eBay categories list programmatically?

I'm using Drupal 7, so PHP.

like image 301
Justin Avatar asked Dec 01 '22 01:12

Justin


2 Answers

You do not need a token to get the categories. All you need is your App-ID

The link below with your APP-ID will return the XML category listing from site: UK (siteid=3) Setting CategoryID=-1 starts the list at the root level, you can start from any category, just use IncludeSelector=ChildCategories to get children

http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=YOUR-APP-ID&siteid=3&CategoryID=-1&version=729&IncludeSelector=ChildCategories

Now just use SimpleXML or whatever to parse.

like image 161
James Jenkins Avatar answered Dec 03 '22 13:12

James Jenkins


This may have been correct at the time, however this call in the API now only returns you one level of categories, not the entire hierarchy. To do it for a whole site, in one request (which can get quite large) you need to use the GetCategories call with a valid Ebay token, and specify <DetailLevel>ReturnAll</DetailLevel> and <ViewAllNodes>true</ViewAllNodes>.

Also note you will need to update these regularly and provide a mapping algorithm as Ebay expires and remaps categories to new names / ids over time.

like image 24
robbie613 Avatar answered Dec 03 '22 14:12

robbie613