Pagination and ProductVariants count is inconsistent

Highlighted
New Member
2 0 0

Hi guys I have an App that loads all the products of my clients into the database and does stuff with it. So when the app is installed first I am fetching the products variants count using this API call 

admin/api/2019-10/variants/count.json

after that, I am starting to fetch all the products from the shop using pagination first call uses 

admin/api/2019-10/products.json?published_status=published

 And from that point, I am getting responses with 250 products and header that holds something like this 'Link': '<https://mycoolshop.myshopify.com/admin/api/2019-10/products.json?limit=250&page_info=jfgkjfbgfdkjhgd>; rel="next"' now this value is the cursor for the next 250 products and mostly it works fine but in some cases, I am getting this value empty although from what I got from variants count I should get more, Here is an example I have a client with 1730522 product variants so I am starting to load his products I am counting all the product variants he has and around 1M instead of getting next page I am getting empty value for that header. So my question is what am I doing wrong why can't I load all the products?

(Note I tried to use

admin/api/2019-10/variants/count.json?published_status=published

instead but it gives me the same amount)

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 165

@yg19 are you able to provide an example link that has an empty 'next' value?

0 Likes