GET (all) product objects using REST

J_Valencia
New Member
6 0 0

My goal is to get an Array of all of the Product Objects so that we can make use of that data using our simple Node app

I tried making an http request to this endpoint

/admin/api/2021-01/products.json?limit=250

but we have over 600+ products and the limit for the request is 250

I read a documentation about cursor-based pagination
https://shopify.dev/tutorials/make-paginated-requests-to-rest-admin-api 

But I can't understand it, I mean how can I apply this to a get request then get the response object?

Hopefully someone can help me with this matter

0 Likes
Greg_Kujawa
Shopify Partner
951 80 203

In short, you see the next link identifier in the response header, and include that identifier as a query parameter in the URL of your next request. An easier way to pull all products in one shot is if you use the GraphQL API bulk operation. Then you just issue your request once, monitor the progress of the request, and then retrieve your result by downloading a JSONL file. But then again since you are just talking about a couple pages of products I guess the REST API isn't too ungainly!

0 Likes