Skip to content
Advertisement

How to get ALL shopify orders via API (limited to 250)

Hi I am trying to get all Orders from a shopify store via shopify API, I am using an R script and so far I am only able to get 250 records that is the limit per page, if I dont use the limit keyword in the php it defaults it to 50.

Here is what I have so far

library(dplyr)
library(httr)
library(rlist)
library(jsonlite)

apikey <- "xxxxxxxxxx1d2fd1fb8710"
pass <- "xxxxxxxxxxxx3e4d38d476fdb188ac7"

orders <- GET(
  url = "https://xxxxx-xxxxx.myshopify.com/admin/orders.json?query=&limit=250&status=any", 
  authenticate(user = apikey, password = pass)
)

If I want to do the same via PHP I use the https call and I get the same 250 results

https://1x877xxxxbd3ed99ae30d1eb4d71cxxx:dcfee3235061bd149ebxxxxxxxxxxxxx@store.myshopify.com/admin/orders.json?query=&limit=250&status=any

Is there a way that I can get ALL orders in one call?

Or if not, is there a way to get different pages, like page 1,2,3,4,5 etc and later on I can union those dataframes into 1.

Advertisement

Answer

Use paging. Clearly described in the documentation.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement