Trying to Implement pagination option using since_id and Link header. (Products API)

New Member
3 0 0

I'm trying to implement pagination in products API. The programing language is PHP

Pagination with since_id

In the first iteration, the endpoint is:-
and the second iteration the endpoint is:-{last_product_id}
and so on...
I have a total of 65 products. if my limit is 2 then the total iteration will be 33.
but using this technique I will get only 20 products. 

After debugging the code I saw an Issue. That is, After 10 times iteration, we get the first product's id that's why we get the repeated product.

Pagination with a link header

Also, I am trying to implement pagination using the Link header.
In the first iteration, the endpoint is:-
After getting the response of the first iteration, I do not get any Link header. 


How to solve this problem. Please share with me some suggestions.