Looping through and combining calls to Woocommerce REST API

First of all it’s not clear why getting all products in one go seems to not be an option if you have control on the API
you can add a custom endpoint and write your query to get all the products ( maybe in status “publish”)
something like :

global $wpdb;
$Q="SELECT * FROM ".$wpdb->prefix."posts WHERE post_type="product" AND post_status="publish"";
$completeProductList = $wpdb->get_results($Q);
return new WP_REST_Response($completeProductList, 200);

should work.

Second : without testing your function I think that

if (count($completeProductList < 1)) should be if (count($completeProductList) < 1)
your code is counting a boolean instead of a Countable interface, maybe it’s not the final solution but this looks like a bug

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)