Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Rob Curry commented on API Call to get Total Product Variants in Database

$
0
0

Not sure what language you are using, but this is how i tend to do it in PHP:

$count = $client->call("GET", "/admin/products/count.json");
if ($count > 0) {
    $pages = ceil($count / 250);
    for ($i=0; $i<$pages; $i++) {
        $products = $client->call("GET", "/admin/products.json?limit=250&&page=".($i+1));
        foreach ($products as $product) {
            // your processing here
        }
    }
}


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>