Paginate the 2019-07 REST Product API

30 3 4

Hi @jeffBlum_ffa


Did the older version on the API worked?

Do you have more than 50 orders in your store?

New Member
2 0 0

No i am using 2019-07 only. 


not for order. i want to use for products. 


pagination want to use. i have 100 products i dont want to load 100 products in 1 request.



Shopify Partner
156 4 16

Anyone know how to parse link data in PHP? so I can get proper next and previous page links?

30 3 4

I am using this function to navigate to the next link

It's in VBA but should be easy to translate it.


Function getNextPageURL(ByRef linkHeader As String) As String
    Dim linkArray() As String: linkArray = Split(linkHeader, ",")
    For Each link In linkArray
        link = Trim(link)
        Dim linkfields() As String: linkfields = Split(link, ">;")
        If linkfields(1) Like "*next*" Then
            getNextPageURL = Right(linkfields(0), Len(linkfields(0)) - 1)
            Exit Function
            getNextPageURL = ""
        End If
    Next link
End Function

It only finds the next link as I never need to go back

Also I wrote this specifically for Shopify APIs so there are good chances that it won't work with other applications.

1 Like
Shopify Staff
Shopify Staff
1555 80 246

@Jivan_Suhagiya I answered a similar question elsewhere today, try preg_match():


preg_match("/<(.*)>; rel={next}/", $link_str, $matches);

$matches[1] will in the above case be the next link. There's probably a better expression to use, but that works for me in PHP.

Shopify Partner
1 0 1

I also wasn't getting the link header when performing a get request and figured out the solution.


The solution was to state the API Version in the get request URL ex:

setting the API version to 2019-10 in my private app settings then using this URL for get request did not produce the link header:


All I had to do to get the link header was include the API version in the URL ex:





1 Like


30 3 4

To sum up:

The page parameter was dropped from all the REST Admin API endpoints (Some in the 07/2019 and the rest in the 10/2019 release)

Now  in order to navigate the API response you will need to parse the HTTP LINK response header, which will contain if they exists, the URLs to the NEXT and PREVIOUS page. You can also set the LIMIT parameter in the HTTP LINK header.


Page-based pagination replaced by cursor-based pagination across multiple REST endpoints (Shopify)

Making requests to paginated REST Admin API endpoints (Shopify)

The HTTP Link entity-header field (MDN)

RFC 5988, section 5: The Link Header Field (IETF)



This has basically killed async requesting as now you have to wait a request's response before you can send another one.



Previously, I can use the page & limit parameters to visit the X-th page I want. I cannot do so with the new API?

SPO - SEO App to research keywords & edit social link preview
30 3 4

Try to export all the products

Order them by product id

and then use the ?since_id=

This kinda recreates the old pagination