← API

Member API

Your network's private analytics, for your own dashboards, bots and wiki: peak hours, channel mix, channel churn and daily history.

Get a key: sign in, open Account settings and create one under API keys. Keys are for members who manage a network on erkstats. Not claimed yours yet?

Read-only access to the private analytics of the networks you manage on erkstats: the same numbers as your network's Analytics page, for your own dashboards, bots, status pages or wiki.

For public numbers (people online, history, channels) you don't need a key at all: use the public API.


Getting a key

  1. Sign in, open Account settings, and find API keys.
  2. Give the key a name you will recognise (e.g. "Grafana" or "wiki bot") and create it.
  3. Copy the key straight away: it starts with erk_m_ and is shown once. We only keep a fingerprint of it, so we can't show it again.

Keys are for members who manage at least one network. A key sees every network you manage, and only those. If you leave a network, your keys stop seeing it straight away. You can have up to 10 keys, see when each was last used, and revoke any of them at any time.

Keep keys out of web pages and public repositories: anyone with the key can read your network's analytics. Call the API from a server or script, not a browser.


Sending the key

Send it in the Authorization header:

curl -H "Authorization: Bearer erk_m_..." https://erkstats.info/api/v1/member/networks

(X-Api-Key: erk_m_... works too.) A missing, wrong or revoked key gets a 401.


Endpoints

<slug> is your network's slug, as listed by /networks. Asking for a network you don't manage gets a 404.

GET /networks

The networks your key can see.

{
  "key": "Grafana",
  "networks": [
    { "slug": "austnet", "name": "AustNet", "url": "https://erkstats.info/network/austnet" }
  ]
}

GET /networks/<slug>/summary

Each metric now, and its change over the last 30 days.

{
  "network": "austnet",
  "metrics": {
    "users":    { "now": 412, "change_30d_pct": 3.2 },
    "channels": { "now": 53,  "change_30d_pct": -1.9 },
    "servers":  { "now": 4,   "change_30d_pct": 0 },
    "opers":    { "now": 9,   "change_30d_pct": null }
  }
}

GET /networks/<slug>/peaks

Average people online by day of the week and hour of the day: when your network is busiest.

ParamTypeDefaultNotes
daysint90How far back to look, 7 to 365.
tzstringUTCTime zone for the days and hours, e.g. Australia/Sydney.
{
  "network": "austnet",
  "days": 90,
  "timezone": "Australia/Sydney",
  "samples": 1062,
  "busiest":  { "day": "Sun", "hour": 21, "users": 447 },
  "quietest": { "day": "Wed", "hour": 5,  "users": 371 },
  "average_users": {
    "Sun": [402, 398, 391, ...],
    "Mon": [400, 395, 388, ...]
  }
}

Each day has 24 values, for hours 0 to 23. An hour with no readings is null.

GET /networks/<slug>/channel-mix

How your active channels (seen in the last 12 hours) break down by size.

{
  "network": "austnet",
  "active_channels": 53,
  "median_users": 4,
  "largest": { "name": "#aussies", "users": 61 },
  "by_size": { "1-5": 31, "6-25": 17, "26-100": 5, "101-500": 0, "501-2k": 0, "2k+": 0 }
}

GET /networks/<slug>/churn

New and lost channels per week: is your channel base growing or shrinking?

ParamTypeDefaultNotes
weeksint81 to 26.
tzstringUTCTime zone for the week labels.
{
  "network": "austnet",
  "weeks": [
    { "label": "9 Sep", "new": 3, "lost": 2 },
    { "label": "16 Sep", "new": 1, "lost": 4 }
  ],
  "total_new": 14,
  "total_lost": 11,
  "net": 3
}

"New" means first seen that week; "lost" means last seen that week and quiet since.

GET /networks/<slug>/daily

One row per day (UTC): average and peak people online and channels, average servers and operators, and how many readings backed the day. The same numbers as the CSV export on your Analytics page.

ParamTypeDefaultNotes
fromdate29 days before toFirst day, e.g. 2026-10-01.
todatetodayLast day (inclusive). Up to 400 days per request.
{
  "network": "austnet",
  "from": "2026-10-01",
  "to": "2026-10-31",
  "days": [
    { "date": "2026-10-01", "users_avg": 405, "users_peak": 431, "channels_avg": 52,
      "channels_peak": 55, "servers_avg": 4, "opers_avg": 9, "samples": 12 }
  ]
}

Errors

Errors are {"error": "..."} with an HTTP status:

StatusWhen
400A parameter is wrong (e.g. a bad date).
401Missing, wrong or revoked key.
404A network you don't manage, or an unknown endpoint.
429Too many requests. Wait for the Retry-After seconds.