jsaya Member
5 months ago

Getting 550+ orders for net 30 days. This post is outdated

Hello does anyone have an efficent way to get bulk orders for the last 30 days?

We are using this informaiton to structure our billing and the time it takes to retrieve the amount of orders on big stores makes it seem like the app loads are going to time out. 

We are currently using the following:


        for p in range(1, 4):
            order_get = shopify.Order.find(created_at_min=start_date, page=p, status='any', limit=250)
            total_orders += len(order_get)

Any help would be awesome thanks!

Busfox Shopify Employee
5 months ago

Hi Jsaya,

Finding orders by created_at is going to be fairly inefficient from a performance view. I'd recommend using since_id. Basically, you want to use an existing known order_id as a start point. Order created since the one you are including will be returned. You can then use the last order_id as the new since_id value. It can be used like so: 


If the last id returned is 173, then your next call would look like this:


This way you don't need to worry about pagination.


Andrew McCauley | Developer Experience @ Shopify | 1-888-746-7439