curl -L -X GET 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/stats' \
-H 'Authorization: Bearer TOKEN'
{
"top_queries": [
{
"query": "SELECT COUNT(*), CustomerID FROM Orders GROUP BY CustomerID HAVING COUNT(*) > 5;",
"rows_read": 123,
"rows_written": 4567
}
]
}{
"error": "could not find database with name [databaseName]: record not found"
}Databases
Retrieve Database Stats
Fetch the top queries of a database, including the count of rows read and written.
GET
/
v1
/
organizations
/
{organizationSlug}
/
databases
/
{databaseName}
/
stats
curl -L -X GET 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/stats' \
-H 'Authorization: Bearer TOKEN'
{
"top_queries": [
{
"query": "SELECT COUNT(*), CustomerID FROM Orders GROUP BY CustomerID HAVING COUNT(*) > 5;",
"rows_read": 123,
"rows_written": 4567
}
]
}{
"error": "could not find database with name [databaseName]: record not found"
}curl -L -X GET 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/stats' \
-H 'Authorization: Bearer TOKEN'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The slug of the organization or user account.
The name of the database.
Response
Successful response
The top queries performed on the given database as well as the total rows read and written.
Show child attributes
Show child attributes
Was this page helpful?