Get total result rows data of query

I’m new using redash. I have an application that call redash to get data and then show result data on UI web. I need to to paginate on UI. My question is how to get total item when execute query in just one query. I’m using API https://redash.xxx/queries/<my_query_id>/results/<my_query_result_id> (method GET). Thanks for any help.

Here is my usecase
Query on redash
select * from fee_report
where {{ filters }}
limit {{ limit }}
offset {{ offset }};

Expected on frontend UI:

What do you want to do? Redash already doesn’t paginate the API calls. You can find the length easily: it’s the length of the array of returned rows.

No, the query I’m using to call API have limit and offset value but I want to know total length of return rows without limit (on UI, frontend need to know total rows to paginate)
I want’t to get all row then paginate on frontend because execute the query runtime is too long without limit

You haven’t mentioned what the data source is but you’ll probably need to include an ORDER BY clause otherwise your query results will be non-deterministic.
Also, some database platforms will need to scan the rows determined by OFFSET before they can start returning results, so this approach may not be any faster than returning the whole result set.