Get List Of Players or UserId's from a group

I wanted to see if it was possible to get a list of all usernames from a certain group.
Specifically a list.

I’ve seen one other post about this.
https://devforum.roblox.com/t/script-to-print-all-usernames-and-user-ids-from-a-group-rank-in-the-form-of-a-list/1218666?
And I didn’t quite understand what exactly happened or how to do it.

I’ve tried GroupService:GetAlliesAsync as well, and I’m pretty sure it only gets allies. By the name. As well as any of the other group functions don’t seem to do anything that would help this.

I was wondering if anyone has some insight on this, because it would be pretty neat.

1 Like

Send a GET request to https://groups.roblox.com/v1/groups/{groupId}/users
Then you need to parse the json which would return a lua table. Then you can iterate that table and go through the “user” key in each data field and then either make a string that’s separated by \n or just put all the usernames in a table and concat the table

Example:

local HttpService = game:GetService'HttpService'
-- use proxy such as rprxy.xyz if you're doing this from inside a game
local response = HttpService:GetAsync("https://groups.rprxy.xyz/v1/groups/{groupId}/users?sortOrder=Asc&limit=100")
response = HttpService:JSONDecode(response)

local userNames = {}
for i, memberData in pairs(response.data) do
    table.insert(userNames, memberData.user.username)
end

print(table.concat(userNames, "\n"))

You would have to repeat the HttpGet until “nextPageCursor” in the response fields is null if you want to get all members and not just 100

https://groups.roblox.com/docs#!/Membership/get_v1_groups_groupId_users

6 Likes

Is rprxy safe though? I looked at its safety reputation and it is low (orange).

Is there a way to getting all the user id’s through a automated way? I want to check some groups but they have over 20k members and getting the next page is hard when doing it manually every time