Reports API
This section documents the Reports API for the BlockBet platform. The Reports API provides access to various platform statistics and metrics through GraphQL queries.
Overview​
The Reports API offers statistical information about platform usage and activity. It provides real-time metrics that can be used for monitoring, analytics, and displaying platform health information.
Authentication​
The Reports API endpoints generally do not require authentication, as they provide aggregate statistical data rather than user-specific information. This makes the data accessible for public display on the platform.
Available Metrics​
The API currently provides the following metrics:
- Online Players Count: The number of users currently online/connected to the platform
Data Freshness​
All metrics provided by the Reports API are kept up-to-date with appropriate caching strategies:
- Most metrics are cached for short durations (typically 60 seconds)
- This ensures data remains relatively fresh while preventing excessive load on underlying data sources
API Operations​
The API provides the following operations:
- Queries
onlinePlayers
: Get the count of currently online players
Integration with Frontend​
The Reports API is designed to be easily integrated with frontend components that display platform statistics. The simplicity of the queries and the absence of complex parameters make it straightforward to implement real-time dashboards and statistical displays.
Performance Considerations​
The Reports API implements efficient caching strategies to ensure good performance even under high load:
- Expensive operations (like counting online players across all Redis keys) are cached
- Cache durations are balanced to provide fresh data without overloading backend services
- All metrics are designed to be lightweight and fast to calculate