Who's online "API"?

We are looking into monitoring the activity of the forum (number of users online over time) using an external tool like grafana. We already use the whos-online plugin so I was wondering if there’s a way we can fetch the number of online people (as calculated by the plugin) through some API request or route? It’s fine if it returns more than needed as it can be parsed.

Or, is there perhaps a simpler way to do this with the existing core API that I’m not aware of?

1 Like

You can pull the data from the whos-online plugin at /whosonline/get.json, but note that the URL and the data format shouldn’t really be considered a public API - it could be removed or changed at any time.

Another option is to make a data explorer query and call it with the API. A query like this should do essentially the same thing as the whos-online plugin:

SELECT id AS user_id 
FROM users 
WHERE last_seen_at >= NOW() - INTERVAL '5 minutes'

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.