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'