Skip to main content
GET
/
api
/
admin
/
stats
Admin - Statistics
curl --request GET \
  --url https://api.example.com/api/admin/stats
{
  "totalUsers": 123,
  "totalOwners": 123,
  "totalPlayers": 123,
  "totalVenues": 123,
  "activeVenues": 123,
  "pendingVenues": 123,
  "totalResources": 123,
  "activeResources": 123,
  "pendingResources": 123,
  "pendingOwnerRequests": 123,
  "revenueThisMonth": 123,
  "totalBookings": 123
}
This endpoint requires ADMIN role. Unauthorized requests will return 403 Forbidden.

Get Admin Statistics

Retrieve comprehensive statistics about the platform including users, venues, resources, bookings, and revenue.
curl -X GET 'https://api.sportshub.com/api/admin/stats' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Response

totalUsers
integer
Total number of registered users in the system
totalOwners
integer
Total number of users with OWNER role
totalPlayers
integer
Total number of users with PLAYER role
totalVenues
integer
Total number of venues registered on the platform
activeVenues
integer
Number of active venues currently accepting bookings
pendingVenues
integer
Number of venues awaiting admin approval
totalResources
integer
Total number of bookable resources (courts, fields, etc.)
activeResources
integer
Number of active resources available for booking
pendingResources
integer
Number of resources awaiting admin approval
pendingOwnerRequests
integer
Number of users requesting OWNER role approval
revenueThisMonth
decimal
Total revenue generated in the current month
totalBookings
integer
Total number of bookings created on the platform

Example Response

{
  "totalUsers": 1542,
  "totalOwners": 87,
  "totalPlayers": 1443,
  "totalVenues": 45,
  "activeVenues": 42,
  "pendingVenues": 3,
  "totalResources": 234,
  "activeResources": 218,
  "pendingResources": 16,
  "pendingOwnerRequests": 12,
  "revenueThisMonth": 24567.50,
  "totalBookings": 8932
}

Use Cases

Dashboard Overview

Use this endpoint to populate admin dashboard with key metrics:
  • User Growth: Track total users, owners, and players
  • Venue Management: Monitor active vs pending venues
  • Resource Availability: Track total and active resources
  • Revenue Tracking: Monitor monthly revenue trends
  • Approval Queue: See pending owner requests and venue/resource approvals

Reporting

This data can be used for:
  • Monthly business reports
  • Growth analytics
  • Resource utilization analysis
  • Revenue forecasting

Build docs developers (and LLMs) love