Skip to content

Subscription statistics ​

Who fetched which subscription, with which app, how many bytes.

5 endpoints

DELETE /api/sub-stats ​

Clear

Delete every subscription-fetch record (the statistics log). Settings are kept.

Sudo admin only

Response 200 Successful Response

Errors: 401 Unauthorized

bash
curl -X DELETE 'https://YOUR-PANEL/api/sub-stats' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/sub-stats/log ​

Log

List individual subscription fetches, newest first. Filter by user, ip, app, fmt (format) and status; page with before (the id of the last row you got) and limit. Non-sudo admins only see fetches of their own users.

Any admin

Parameters

NameInTypeRequiredDescription
userquerystringno
ipquerystringno
appquerystringno
fmtquerystringno
statusqueryintegerno
hoursqueryintegerno
beforequeryintegerno
limitqueryintegerno

Response 200 Successful Response

Errors: 401 Unauthorized

bash
curl -X GET 'https://YOUR-PANEL/api/sub-stats/log' \
  -H 'Authorization: Bearer $TOKEN'

GET /api/sub-stats/settings ​

Get Stats Settings

Read subscription-statistics settings: enabled, retention_days, ip_per_min, user_per_hour and sub_rate_limit (minimum seconds between two fetches of the same user). 0 means no limit.

Sudo admin only

Response 200 Successful Response · StatsSettingsOut

Response fields
FieldTypeDescription
enabledboolean
retention_daysinteger
ip_per_mininteger
user_per_hourinteger
sub_rate_limitinteger
json
{
  "enabled": true,
  "retention_days": 30,
  "ip_per_min": 0,
  "user_per_hour": 0,
  "sub_rate_limit": 0
}

Errors: 401 Unauthorized

bash
curl -X GET 'https://YOUR-PANEL/api/sub-stats/settings' \
  -H 'Authorization: Bearer $TOKEN'

PUT /api/sub-stats/settings ​

Put Stats Settings

Change subscription-statistics settings and limits. Fetches over a limit get HTTP 429 with a Retry-After header.

Sudo admin only

Request body application/json · StatsSettingsIn

FieldTypeRequiredDescription
enabledbooleannoDefault: true.
retention_daysintegernoDefault: 30.
ip_per_minintegernoDefault: 0.
user_per_hourintegernoDefault: 0.
sub_rate_limitintegernoDefault: 0.
json
{
  "enabled": true,
  "retention_days": 30,
  "ip_per_min": 0,
  "user_per_hour": 0,
  "sub_rate_limit": 0
}

Response 200 Successful Response · StatsSettingsOut

Response fields
FieldTypeDescription
enabledboolean
retention_daysinteger
ip_per_mininteger
user_per_hourinteger
sub_rate_limitinteger
json
{
  "enabled": true,
  "retention_days": 30,
  "ip_per_min": 0,
  "user_per_hour": 0,
  "sub_rate_limit": 0
}

Errors: 401 Unauthorized

bash
curl -X PUT 'https://YOUR-PANEL/api/sub-stats/settings' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"enabled": true, "retention_days": 30, "ip_per_min": 0, "user_per_hour": 0, "sub_rate_limit": 0}'

GET /api/sub-stats/summary ​

Summary

Totals for the last hours hours: fetch count, unique users and IPs, bytes sent, average/max size, average duration, limited/blocked/error counts; plus breakdowns by app and format, top users, top IPs and a time series (hourly when hours is 72 or less, otherwise daily).

Any admin

Parameters

NameInTypeRequiredDescription
hoursqueryintegerno
topqueryintegerno

Response 200 Successful Response

Errors: 401 Unauthorized

bash
curl -X GET 'https://YOUR-PANEL/api/sub-stats/summary' \
  -H 'Authorization: Bearer $TOKEN'

Alexen v2.3.14 · 204 API endpoints