Why "xxxx.myshopify.com/admin/api/2023-10/products/count.json" not giving actual product count

I am new to Shopify, with referrence of Dev. docs an app developed using .Net Framework and installed it in partner api to get total products count with the client request uri as “xxxx.myshopify.com/admin/api/2023-10/products/count.json”.

There is no error on the request but getting always with “count”:0 as response, though the store is having many products . Anybody can help me to figure out the code/configuration where I’m doing wrong to get the total products count.

Here’s the C# code to get products count.

var client = new RestClient(“https://xxx.myshopify.com/”);
var request = new RestRequest(“admin/api/2023-10/products/count.json”, Method.Get);

request.RequestFormat = DataFormat.Json;
request.AddHeader(“X-Shopify-Access-Token”, “xxxtoaken”);

var response = client.ExecuteAsync(request);

var r = JsonConvert.DeserializeObject(response.Result.Content);

var count = r.count; // here r.count={0}

1 Like

Hi @ds_2
Can you share the store URL.