Question

When interacting with eBay's API using the URL format, the MinPrice item filter works, but the MaxPrice does not. My guess is that it has something to do with the enumeration, but I don't completely understand how that works, and I'm not sure what to change it to. Code is below.

<script src=http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=*APP ID GOES HERE*&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&callback=_cb_findItemsByKeywords&REST-PAYLOAD&sortOrder=PricePlusShippingLowest&paginationInput.entriesPerPage=6&outputSelector=AspectHistogram&itemFilter(0).name=Condition&itemFilter(0).value(0)=New&itemFilter(1).name=MaxPrice&itemFilter(1).value=201.00&itemFilter(0).paramName=Currency&itemFilter(0).paramValue=USD&itemFilter(1).name=MinPrice&itemFilter(1).value=200.00&itemFilter(1).paramName=Currency&itemFilter.name=ListingType&itemFilter.value=FixedPrice&itemFilter(1).paramValue=USD&keywords=iphone%205%2016gb%20unlocked>
</script>
Was it helpful?

Solution

Both maxPrice and minPrice filter names are assigned to the same itemFilter element

itemFilter(1).name=MaxPrice&itemFilter(1).name=MinPrice

which is incorrect you should specify each filter on a different itemFilter element, i.e.

itemFilter(1).name=MaxPrice&itemFilter(2).name=MinPrice

Also you have itemFilter.name=ListingType which is not valid either, the name property is on an element of itemFilter not on the itemFilter list itself, it should be itemFilter(3).name=ListingType

The correct url would look something like:

http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=*APP ID GOES HERE*&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&callback=_cb_findItemsByKeywords&REST-PAYLOAD&sortOrder=PricePlusShippingLowest&paginationInput.entriesPerPage=6&outputSelector=AspectHistogram&itemFilter(0).name=Condition&itemFilter(0).value(0)=New&itemFilter(1).name=MaxPrice&itemFilter(1).value=201.00&itemFilter(1).paramName=Currency&itemFilter(1).paramValue=USD&itemFilter(2).name=MinPrice&itemFilter(2).value=200.00&itemFilter(2).paramName=Currency&itemFilter(2).paramValue=USD&itemFilter(3).name=ListingType&itemFilter(3).value=FixedPrice&keywords=iphone%205%2016gb%20unlocked
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top