I have so many pages of products on my development store.But when I try to use products.json to get all of my products, it only take 50 listings(one page).Could anybody solve my doubt?
<?php
$url = 'https://myshopifystore/admin/api/2019-07/products.json';
$result = file_get_contents($url);
$data = json_decode($result, true);
dd($data);
2
Answers
The limit property on the request has a default of 50 up to 250. In case you want more use a loop to search though every page until the end.
Use
to get the total product you want to search.
More info about paginated page here
EDIT 1 : The paginated ?page= is now deprecated. It will be remove in version 2020-07. You should use cursor-based pagination.
Below function can help to fetch resources with cursor based pagination in new shopify API
using above function in controller