---
title: "Retrieve Database Stats"
method: GET
path: "/v1/organizations/{organizationSlug}/databases/{databaseName}/stats"
---

# Retrieve Database Stats

`GET /v1/organizations/{organizationSlug}/databases/{databaseName}/stats`

Fetch the top queries of a database, including the count of rows read and written.

## Path parameters

- `organizationSlug` string, required
- `databaseName` string, required

## Response `200`

Successful response

- object
  - `top_queries` DatabaseStatsOutput[], nullable — The top queries performed on the given database as well as the total rows read and written.
    - `query` string — A string representing the SQL query executed.
    - `rows_read` integer — An integer indicating the number of rows read by the query, which reflects the volume of data the query processed from the database.
    - `rows_written` integer — An integer indicating the number of rows written (inserted, updated, or deleted) by the query, which reflects the impact of the query on the database data.

## Other responses

- `404` — Database not found

---

[API](https://skmtc.dev/turso/apis/turso-platform-api.md) · [All operations](https://skmtc.dev/turso/apis/turso-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/turso/turso-platform-api/revisions/6c99e4c88978/schema)
