Vehicle Statistics
Retrieve statistics for vehicles.
Endpoint
INFO
GET /api/v1/dashboard/vehicles-stats
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
agency_id | integer | - | Filter by agency |
station_id | integer | - | Filter by station |
period | string | month | Period: day, week, month, year |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/vehicles-stats?period=month" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Vehicle statistics retrieved",
"data": {
"summary": {
"total_vehicles": 50,
"by_status": {
"available": 35,
"booked": 8,
"in_use": 4,
"maintenance": 3
},
"average_utilization": 72.5
},
"by_category": {
"sedan": { "count": 20, "utilization": 78.5 },
"suv": { "count": 15, "utilization": 82.3 },
"compact": { "count": 10, "utilization": 65.0 },
"luxury": { "count": 5, "utilization": 55.0 }
},
"top_performers": [
{
"id": 1,
"plate_number": "ABC-123",
"brand": "Toyota",
"model": "Corolla",
"bookings": 15,
"revenue": 1200.00,
"utilization": 92.5
}
],
"maintenance_due": [
{
"id": 5,
"plate_number": "DEF-456",
"reason": "Mileage service due",
"mileage": 29500
}
],
"revenue": {
"total": 75000.00,
"average_per_vehicle": 1500.00,
"currency": "USD"
}
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}