instances icon indicating copy to clipboard operation
instances copied to clipboard

Number of active users does not match the value provided by the instance API

Open seanthegeek opened this issue 2 years ago • 3 comments
trafficstars

The active users number provided by instances.social goes not match the users.active_month value provided by the /api/v2/instance endpoint.

For example instances.social currently reports that infosec.exchange has 18266 active users, but https://infosec.exchange/api/v2/instance reports a users.active_month value of 31944.

How is the number provided by instances.social calculated?

seanthegeek avatar Jan 07 '23 02:01 seanthegeek

After a lot of digging in the code, I discovered the the active_users field returned by the instances.social is actually logins per week obtained from a Mastodon API v1 call.

https://github.com/TheKinrar/instances/blob/cb823fb96218843ccbcb84c42ffaef98f02049e1/helpers/APIUtils.js#L115 https://github.com/TheKinrar/instances/blob/bb642f743c929a47c42fb5347263da81a51ae962/worker.js#L105 https://github.com/TheKinrar/instances/blob/bb642f743c929a47c42fb5347263da81a51ae962/worker.js#L128 https://infosec.exchange/api/v1/instance/activity

Please consider renaming the misleading field name and/or using the 1active_users` count provided by the Mastodon API v2.

seanthegeek avatar Jan 09 '23 08:01 seanthegeek

I'll add the new monthly active users field to the returned object, but I can't rename an existing API field. It might be misleading now but when it was added it was the only active users stat available on Mastodon. When I start working on a v2 of the instances.social API, I'll rename the field.

TheKinrar avatar Feb 04 '23 03:02 TheKinrar

Would it be possible to add a new field in the v1 API to filter by Mastodon's users.active_month value? Something like min_monthly_users.

zacharee avatar Aug 13 '23 22:08 zacharee