One of the BestBuy API endpoints is:
https://api.bestbuy.com/v1/products
Their guide here (see the very last line) says that to avoid the rate limit, one can get data for multiple skus (products) in a single call like this:
https://api.bestbuy.com/v1/products(sku in(43900,2088495,7150065))?apiKey=YourAPIKey
This works. But how can I use the in operator in a similar fashion but for some of the other API end points like this one:
https://api.bestbuy.com/v1/products/**{sku here}**/viewedUltimatelyBought?apiKey=YourAPIKey
The above works with a single sku. But to get the data for multiple skus in one call, I tried variations of the query like these and all return error saying that the query is not valid:
https://api.bestbuy.com/v1/products/(sku in(6559245, 6559246, 6559247))/viewedUltimatelyBought?apiKey=YourAPIKey
https://api.bestbuy.com/v1/products/[6559245, 6559246, 6559247]/viewedUltimatelyBought?apiKey=YourAPIKey
https://api.bestbuy.com/v1/products/(6559245, 6559246, 6559247)/viewedUltimatelyBought?apiKey=YourAPIKey
Can someone construct the query correctly for me? I know it may be a bit challenging without having access to the API (obviously I can’t share my API key here) but I thought there may be a common format for requests like this that I am not aware of. If it matters, I use the following code to get the response to the queries:
json_content = json.loads(requests.get(query).content)