How to retrieve path ID for eBay category with developer API?

34 Views Asked by At

I would like to retrieve the category path of any given leaf category. Previously, the GetCategoryInfo API call in the Shopping API returned this information, but this API call is now deprecated. I was looking into the trading API's GetCategories API call which returns a CategoryParentID. The documentation claims the API call can return all parent ID's of a category to the root, but it's only returning the direct parent for me.

An example response can be seen below. The leaf category has two ancestors, but GetCategories returns only one:

<?xml version="1.0" encoding="UTF-8"?>
<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
    <Timestamp>2024-01-31T22:28:50.073Z</Timestamp>
    <Ack>Success</Ack>
    <Version>1347</Version>
    <Build>E1347_CORE_APICATALOG_19146446_R1</Build>
    <CategoryArray>
        <Category>
            <BestOfferEnabled>true</BestOfferEnabled>
            <AutoPayEnabled>true</AutoPayEnabled>
            <CategoryID>169291</CategoryID>
            <CategoryLevel>3</CategoryLevel>
            <CategoryName>Women&apos;s Bags &amp; Handbags</CategoryName>
            <CategoryParentID>260010</CategoryParentID>
            <LeafCategory>true</LeafCategory>
        </Category>
    </CategoryArray>
    <CategoryCount>1</CategoryCount>
    <UpdateTime>2023-10-11T09:35:36.000Z</UpdateTime>
    <CategoryVersion>130</CategoryVersion>
    <ReservePriceAllowed>true</ReservePriceAllowed>
    <MinimumReservePrice>0.0</MinimumReservePrice>
</GetCategoriesResponse>

How can I retrieve the entire taxonomy path of a category with eBay's current API?

1

There are 1 best solutions below

1
Joe On

With CategoryID, CategoryLevel, CategoryParentID and LeafCategory you can build the fullpath. There's no other way...