Skip to content
You are reading the HappyView v2 docs, which are no longer updated. Read the v3 docs.

Stats

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };
GET /admin/stats
interface CollectionCount {
collection: string;
count: number;
}
interface Stats {
total_records: number;
collections: CollectionCount[];
}
const response = await fetch("http://127.0.0.1:3000/admin/stats", {
headers,
});
const data: Stats = await response.json();

Response: 200 OK

{
"total_records": 12345,
"collections": [{ "collection": "xyz.statusphere.status", "count": 500 }]
}