Metrics API
Get peak metrics for a service or submit new metrics data.
GET /api/metrics
Retrieve peak metrics (24-hour and all-time) for a specific service.
Query Parameters
The service slug to get metrics for
Response
Peak online count in the last 24 hours
All-time peak online count
Example Request
curl -X GET "https://www.lormex.xyz/api/metrics?slug=example-service"
Example Response
{
"top24": 5420,
"topAll": 12850
}
POST /api/metrics
Submit metrics data for a service. Used by service integrations to report online counts.
Request Body
Service identifier (1-64 alphanumeric characters, hyphens, underscores)
Current online player count (0 to 1,000,000)
Whether the service check was successful
Example Request
curl -X POST "https://www.lormex.xyz/api/metrics" \
-H "Content-Type: application/json" \
-d '{"slug": "example-service", "online": 1250}'
Response
Error Responses
| Code | Error | Description |
|---|
| 400 | Invalid body | Request body validation failed |
| 415 | Unsupported Media Type | Content-Type must be application/json |
| 500 | Internal error | Server error |
{
"top24": 5420,
"topAll": 12850
}