"xxxx.myshopify.com/admin/api/2023-10/products/count.json" responding with "count":0

Topic summary

A developer is encountering an issue where the Shopify Admin API endpoint for product count returns {"count": 0} despite expecting products to exist in their store.

Code Details:

  • Using RestClient in C# to call /admin/api/2023-10/products/count.json
  • Implementing GET request with X-Shopify-Access-Token header
  • Setting request format to JSON
  • Deserializing response to extract count value

Current Status:

  • The API call appears to execute successfully but returns zero products
  • No responses or solutions have been provided yet
  • Possible causes could include: incorrect authentication, API version compatibility, missing product data, or scope/permission issues with the access token
Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Here the code, please suggest to get the 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;