Get a list of ALL Products (not just the first 50)

Solved
TxBob77
Excursionist
15 1 4

If I use the Products API it only returns 50. I realize this is a limit, but I new the whole list returned or a way of looping through and get the whole list 50 at a time.  How can this be done?  What is the API call?

Replies 10 (10)
tewe
Trailblazer
211 39 90

Hi @TxBob77 ,

some additional hints in respect to the REST API:

  • There is a paramter limit which is defaulted to 50. You can set it up to 250, see documentation
  • If you make a get request you also receive header links in the response header which you can use to retrieve the next set of products. These header links look somehow like below

     

 

{'next': {'url': 'https://plattenladen1.myshopify.com/admin/api/2020-
10/products.json?
limit=3&fields=id%2Ctitle&page_info=eyJsYXN0X2lkIjo1OTk5NzU1OTE5NTI2LCJsYXN
0X3ZhbHVlIjoiQWRhbSBBbmQgVGhlIEFudHMgLSBEaXJrIFdlYXJzIFdoaXRlIFNveCIsImRpcm
VjdGlvbiI6Im5leHQifQ',
'rel': 'next'}}​

 

Hope that this helps somebody

Regards

Thomas

• Was my reply helpful? Click Like to let me know!
• Was your question answered? Mark it as an Accepted Solution
• Check out our Price Updater App