500 Internal Server Error while calling product_listings/count API (2025-10)

I am unable to fetch the product count for one of the Shopify stores using the following Admin API endpoint:
GET https://XXX.myshopify.com/admin/api/2025-10/product_listings/count.json

Status Code: 500

Response Headers

Date: Wed, 11 Feb 2026 12:56:27 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-stats-apiclientid: 5045527
x-stats-apipermissionid: 924271771936
x-request-id: b0c2bf51-8277-4e7f-a346-d261d2a08bb4-1770814576
CF-RAY: 9cc4015fdb88ffc8-BOM

Response Body

{“errors”:“Internal Server Error”}

Hey @Himanshu_Sahu, I looked into this using your request ID.

The 500 is coming from a query timeout on the server side. The product_listings/count.json endpoint runs a count query against the store’s published products table, and for stores with very large catalogs that query can exceed the execution time limit and fail with a 500 instead of returning a result. So this is specific to the volume of data on this particular store rather than a general API outage.

The REST Admin API is legacy as of October 2024, and the documented GraphQL equivalent for this endpoint is publishedProductsCount. It takes a publicationId and has a limit parameter (defaults to 10,000) with a precision field that tells you whether the count is exact or capped. This makes it much better suited for large catalogs since it doesn’t need to scan the entire table.

query PublishedProductCount($publicationId: ID!) {
  publishedProductsCount(publicationId: $publicationId) {
    count
    precision
  }
}

You can get your app’s publicationId by querying appByHandle or listing publications. If you just need a total product count for the store regardless of publication, productsCount also works.

I’d recommend migrating to the GraphQL approach here. Let me know if you run into any issues with it.