Best way to get Top Selling Products in a Given Timeframe (for Basic and Shopify Plans)?

Milkman1
Shopify Partner
12 1 1

I am interested in compiling a list of Top Selling products by unit within an app I'm building. I see this report in the Analytics dashboard of the admin area, so I know the data is available, but there are only two ways that I have found to get this each with a caveat...

1) Using the Report API, but that is only available to merchants on higher end plans. Or,

2) Using the Orders API and using code extract every product_id, counting them and sort them. While it works to some degree, I am only able to gather a list of the first 250 returned orders. Therefore, if I have a 30 day range that looks like below, the numbers will not be accurate.

top_products.jpg

I have read about the Analytics API being a way to get this data, but it is now deprecated. Is there any other way I can achieve the result I'm looking for?

Cheers!

Reply 1 (1)
Milkman1
Shopify Partner
12 1 1

Just updating this thread with what I found in the meantime. Using the Orders API in a "for" loop, I was able to retrieve all the orders I needed in chunks of 250. Using the since_id value each time to get the next 250 in the date range, I then merged all the arrays to get the total I was looking for. Very slow and leaky, but got what I needed.

However, I would still love to know if there is a quicker and simpler way to derive the data that I need. Thanks