Need help in calculating total row count in serverside pagination using javaScript code

Is there any possible way using javaScript to calculate total row count.
As I dont want to write another query or api to calculate total row count. I want to use my serverside paginated api through which I want that it calculate totol row count

I am doing server side pagination based on limit offset

@jmann can you please help me here ?

Hey @Rishivendra_Gupta - Your specific API would need to return the total result number in its responses for the frontend to be able to know how many there are ahead of time. If it doesn't, the frontend would only know the total after it retrieves all the data through its pagination. Else you'll need a separate query to hit whatever endpoint the API would tell you the total results, or something like select count(*) from ... query if it's SQL-based.