Skip to main content
Published: May 21 2010, 3:31:00 PMUpdated: November 28 2020, 8:24:54 PM

I am looking for the best method of getting and refining my searches with the Finding APIs. I know I can refine with ItemFilters and they are well defined but I need help refining the search by brand. What is the best way to accomplish this?

Detailed Description

Item filters are well defined as they almost universally apply to any item that can be sold on the site. However, certain information, like Brand, are specific aspects to a collection of products and do not apply universally. In order to refine your search on these aspects, you first need to know what those aspects are. The first step is to modifiy your initial call. I think an example will help. For this example we will use Women's Shoes (category ID 63889). Here is an example to get some shoes:

(line breaks put in for readablity only) 
http://svcs.ebay.com/services/search/FindingService/v1
?OPERATION-NAME=findItemsByCategory
&SECURITY-APPNAME=YourAppID
&RESPONSE-DATA-FORMAT=XML
&categoryId=63889

We are going to make one small call to this so that we can get a list of aspects we can use to refine the search:

http://svcs.ebay.com/services/search/FindingService/v1 
?OPERATION-NAME=findItemsByCategory
&SECURITY-APPNAME=YourAppID
&RESPONSE-DATA-FORMAT=XML
&categoryId=63889
&outputSelector=AspectHistogram

With this change, you will now get a aspectHistogramContainer that will hold a list of aspect items. The aspect's name can be used for future calls to refine the search. Here is an example of one of the aspects:

   <aspect name="Style"> 
<valueHistogram valueName="Sandals">
<count>386377</count>
</valueHistogram>
<valueHistogram valueName="Heels, Pumps">
<count>368833</count>
</valueHistogram>
<valueHistogram valueName="Boots">
<count>236353</count>
</valueHistogram>
<valueHistogram valueName="Athletic">
<count>104586</count>
</valueHistogram>
<valueHistogram valueName="Platforms, Wedges">
<count>98123</count>
</valueHistogram>
<valueHistogram valueName="Flats">
<count>95928</count>
</valueHistogram>
<!-- snipped out some -->
</aspect>

So, to filter on shoes that are styled like boots:

http://svcs.ebay.com/services/search/FindingService/v1 
?OPERATION-NAME=findItemsByCategory
&SECURITY-APPNAME=YourAppID
&RESPONSE-DATA-FORMAT=XML
&categoryId=63889
&outputSelector=AspectHistogram
&aspectFilter(0).aspectName=Style
&aspectFilter(0).aspectValueName=Boots

Additional Resources

How well did this answer your question?
Answers others found helpful