Getting a List of Categories a Seller Has Items In
Hi, I have been trying to achieve this for a while, but I keep coming up short. Any help will be greatly appreciated. I am trying to get the list of eBay categories that a seller has items listed in, category title and category ID is the only data I am interested in. I am not interested in store categories. The following shows the content I am interested in: ![alt text] The only way I can think of is iterating over every item for the seller grabbing the primary category and then looking each up in the category tree. Which could be pretty call intensive. I found a similar question from 2013 in which it seemed that this wasn't possible, but maybe something has changed since then:
https://forums.developer.ebay.com/questions/3600/can-i-get-somehow-ebay-categories-that-saler-have.html Any thoughts? Many thanks, Joe : /storage/temp/1501-seller-categories.jpg
You have to retrieve the items, then lookup the categories. You can store the category data used by your sellers as it doesn't change too often, but you'd still need to sync it periodically to make sure it's current. The least call-intensive approach I know uses a trick to get the category info from Shopping GetMultipleItems instead of making hundreds of category info calls. Do findItemsAdvanced calls to get all the items, make a list of the unique categories and one of the item numbers for each category, then request those items using GetMultipleItems to fetch them 20 at a time. That call returns the full category path without having to walk the tree. So this approach only requires one call per 20 unique categories. You get two nodes back that contain the full category hierarchy for the item and the corresponding category numbers. Collectibles:Comics:Copper Age (1984-1991):Superhero:Iron Man 1:63:165364:165386:165411 If these nodes were returned in the findItemsAdvanced, you wouldn't have to make any additional calls. Add your voice to this request. I've been asking for 4 years.
https://forums.developer.ebay.com/questions/9322/feature-request-add-category-path-from-shopping-to.html Also watch out for categories with colons in the name:
Nice approach, if it works for you. Careful though, the response is limited to top level categories and up to 10 of their immediate children. It doesn't return 3rd level or lower, even if you specifically select an item. example: Item: 322574190093 GetSingleItem returns: 293:3270:60207:12040 The Finding histogram will return 293 and 3270 but not 60207 or 12040. The item category field will have 12040. For items 5 levels deep, two categories will be missing, etc. And those would probably be more important than the top level for most uses. You can't build a complete category hierarchy from that. So it doesn't suit all applications.
Good to know the limitations, thanks. I had noticed that not all child categories were being returned, but I hadn't quite worked out the logic yet. I believe this is sufficient for my application however, so I was happy to find an easy solution. I appreciate your time (as always).