Metrics
curl --request GET \
--url https://api.example.com/api/metrics \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"online": 123,
"success": true
}
'import requests
url = "https://api.example.com/api/metrics"
payload = {
"slug": "<string>",
"online": 123,
"success": True
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({slug: '<string>', online: 123, success: true})
};
fetch('https://api.example.com/api/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'online' => 123,
'success' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/metrics"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/metrics")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}"
response = http.request(request)
puts response.read_body{
"top24": 5420,
"topAll": 12850
}
Metrics
Metrics
Get and submit metrics for services
GET
/
api
/
metrics
Metrics
curl --request GET \
--url https://api.example.com/api/metrics \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"online": 123,
"success": true
}
'import requests
url = "https://api.example.com/api/metrics"
payload = {
"slug": "<string>",
"online": 123,
"success": True
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({slug: '<string>', online: 123, success: true})
};
fetch('https://api.example.com/api/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'online' => 123,
'success' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/metrics"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/metrics")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"online\": 123,\n \"success\": true\n}"
response = http.request(request)
puts response.read_body{
"top24": 5420,
"topAll": 12850
}
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
string
required
The service slug to get metrics for
Response
number
Peak online count in the last 24 hours
number
All-time peak online count
Example Request
curl -X GET "https://www.orcrev.fit/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
string
required
Service identifier (1-64 alphanumeric characters, hyphens, underscores)
number
Current online player count (0 to 1,000,000)
boolean
Whether the service check was successful
Example Request
curl -X POST "https://www.orcrev.fit/api/metrics" \
-H "Content-Type: application/json" \
-d '{"slug": "example-service", "online": 1250}'
Response
{
"ok": true
}
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
}
⌘I

