Retrieve a list of all Users who are currently online using Platform API

I had a particular use case where I need to find the user who is currently connected/online but has been idle since threshold mins/hours. In the Platform API, I do have a List Users API however it doesn’t have an ability to send is_online in the query params. So I would have to ideally call the List Users API, get all the users, iterate over the record set, fetch the is_online users, check their last_seen at timestamp.
Another approach would have been to track it down in my database and then query for only those users, however there is an upper limit of max 250 user ids to be sent in the query param

Is there a better way to basically get around this problem?

@jimcarter

It looks like the method you’ve mentioned is likely the best scenario for this. Since the response object of List Users returns both the is_online and the last_seen_at values. If you up the limit to 100 per page, are you still limited to only 2.5 pages of data (250 users)?

If there isn’t a limit to the number of users the List Users call returns, it seems like you could quickly iterate over that JSON object to get the data you’re looking for.