Product Advertising API
Developer Guide (API Version 2013-08-01)

Traverse the Browse Node Hierarchy

You move down the hierarchy to refine your search. You might also move up the hierarchy to find a parent browse node or even the root category of a product.

For example, if you have an item like a carving knife, you might find its node and go up the hierarchy to find the root product category of knives. In another request, use the TopSellers response group to return the top sellers in the product category.

BrowseNodeLookup operation is the most direct way of traversing the browse node hierarchy. When you supply it a browse node ID, it returns the name of the browse node as well as its direct descendants and a lineage of ancestors. Look at the response to the following request.

Copy Service=AWSECommerceService& AWSAccessKeyId=[Access Key ID]& AssociateTag=[Associate Tag]& Operation=BrowseNodeLookup& BrowseNodeId=11232& ResponseGroup=BrowseNodeInfo &Timestamp=[YYYY-MM-DDThh:mm:ssZ] &Signature=[Request Signature]

A snippet of its response follows.

<Item> <ASIN>0131856340</ASIN> <BrowseNodes> <BrowseNode> <BrowseNodeId>11232</BrowseNodeId> <Name> Social Sciences</Name> <Ancestors> <BrowseNode> <BrowseNodeId>53</BrowseNodeId> <Name>Nonfiction</Name> <Ancestors> <BrowseNode> <BrowseNodeId>1000</BrowseNodeId> <Name>Subjects</Name> <Ancestors> <BrowseNode> <BrowseNodeId>283155</BrowseNodeId> <Name>Books</Name> </BrowseNode> </Ancestors> </BrowseNode> </Ancestors> </BrowseNode> </Ancestors> <Children> <BrowseNode> <BrowseNodeId>11233</BrowseNodeId> <Name>Anthropology</Name> </BrowseNode> <BrowseNode> <BrowseNodeId>11242</BrowseNodeId> <Name>Archaeology</Name> </BrowseNode> <BrowseNode> <BrowseNodeId>3048861</BrowseNodeId> <Name>Children's Studies</Name> </BrowseNode> </Children> </BrowseNodes>

To move down the hierarchy, choose the browse node ID that is relevant and repeat the BrowseNodeLookup operation until you find to the appropriate browse node.

Moving up the hierarchy is similar. Although the BrowseNodeLookup operation, by default, returns the complete ancestral lineage of the subject browse node, there is a limit. The request only returns one parent browse node for each node. If a node has more than one parent, the response will only show one of the parent nodes. The parent browse node returned is arbitrary. For that reason, you might want to move up the hierarchy one node level at a time.

Related Topics