Api is returning unexpected data in bestbuy

444 Views Asked by At

I am trying to get the iphone5 search .

This is the url which I am hitting .

http://api.remix.bestbuy.com/v1/products(search=Iphone5)?apiKey=myapi&page=1

And this response is completely different to what I am expecting .I am looking for the same data as what I got after searching the Iphone at bestbuy.com user interface .

My response contains some headphone details which is not Iphone .

May I know Y it is so .What other parameters I need to pass to get the correct data .

Please help me out .

UPdate : It shows only accessories data instead of Iphone5 product details .

1

There are 1 best solutions below

0
On

The API's search currently uses a different relevancy model than bestbuy.com's search. If you're specifically looking for iPhones, then you'd probably want to filter based on category as well. You might also want to change your query to search by 'name' for even more specificity.

A URL that worked for me:

http://api.remix.bestbuy.com/v1/products(name="iPhone*"&categoryPath.id=pcmcat209400050001)?format=json&apiKey=YourAPIKey

If you wanted to limit your results to the iPhone 5, 5c, or 5s, a better query would be:

http://api.remix.bestbuy.com/v1/products(name="iPhone 5*"&categoryPath.id=pcmcat209400050001)?format=json&apiKey=YourAPIKey

We have more extensive documentation on our different search options on our new developer site at https://developer.bestbuy.com/documentation. Make sure to check there if there's anything fancier you need to do!