GET (all) product objects using REST

AI-generated summary

Getting all product objects from the Shopify Admin REST API is the main issue. The original problem is that /admin/api/2021-01/products.json?limit=250 only returns up to 250 products per request, while the store has 600+ products, and cursor-based pagination was unclear.

Key clarification:

  • REST pagination works by reading the Link header in the response.
  • The next link contains an identifier that must be added to the next request URL as a query parameter.
  • Repeating that process lets the app fetch all product pages.

An alternative approach was also suggested:

  • Use the GraphQL Admin API bulk operation.
  • This allows requesting all products in one bulk job, checking its progress, and then downloading the results as a JSONL file (JSON Lines, a format where each line is a JSON object).

No final implementation was posted. The discussion provides guidance, but the original question about how to code the full request flow remains only partially resolved.

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

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!