Dashboard Statistics
Retrieve detailed statistics for the dashboard.
Endpoint
INFO
GET /api/v1/dashboard/stats
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | month | Period: day, week, month, year |
start_date | date | - | Custom start date |
end_date | date | - | Custom end date |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/stats?period=month" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Statistics retrieved",
"data": {
"period": {
"start": "2024-01-01",
"end": "2024-01-31"
},
"bookings": {
"total": 150,
"completed": 120,
"cancelled": 10,
"active": 20,
"trend": "+15%"
},
"revenue": {
"total": 25000.00,
"average_per_booking": 166.67,
"trend": "+8%",
"currency": "USD",
"by_day": [
{ "date": "2024-01-01", "amount": 800.00 },
{ "date": "2024-01-02", "amount": 950.00 }
]
},
"vehicles": {
"utilization_rate": 72.5,
"average_bookings_per_vehicle": 3.0,
"top_performing": [
{ "id": 1, "name": "Toyota Corolla (ABC-123)", "bookings": 15 },
{ "id": 2, "name": "Honda CR-V (XYZ-789)", "bookings": 12 }
]
},
"clients": {
"new": 45,
"returning": 105,
"retention_rate": 70.0
}
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Statistics are calculated based on the user's scope
- Trends compare to the previous equivalent period