🡺 How to get a players followers by userId?

This is an example I created, also you dont need to create an account to use roproxy as far as I am aware because I dont have one.

local url = "https://friends.RoProxy.com/v1/users/1/followers/count"
local httpservice = game:GetService("HttpService")
local gettable = httpservice:GetAsync(url)
local decodedtable = httpservice:JSONDecode(gettable)

for i, v in pairs(decodedtable) do
	print(i, v)
end

In the url we are making a url with the userId of a player, in this case I have the number 1 which is the userId of Roblox which has aproxx 8M followers right now.
In the second line we are just referring to the game’s service, while on the thrid like we are getting the url. In simple terms what the third line is doing is just copying the url that we give it and copy pastes it into the search bar and brings us back the result. On the fourth line because most websites return the values in JSON we need to decode it into a normal lua table which we are then accessing from a loop.

no offense but tf am i looking at


is it down? that means its not reliable

okay so how do i get a players followers by userid with this

The v value is the player’s follower count.

will it still work even if its not the local players follower count

also where do i put the userId to get the info

You need to create variable for local player’s userId and just put that in the URL. Also here is an video explaining HTTP Service:

1 Like

im not seeing a part that i would replace in the url. there isnt a userid in the url

edit: this is also a followers count. i need the name of every indivual follower


In the above place where it wars Request URL, just before the word followers you can see a number which is the userId, which in this case is 1 for ROBLOX. And the response that we get is below that which you can use.

okay but how do i get the name of every indiviual player and not just a number count. they already have built in functions for the count i just need every individual players name for my game

I dont think you can do that, and if you can I dont know how to.

This might help you out here:

there is a website posted by roblox with a system that does that however the website is shitty


this is exactly what i want. just a table off all the names of the followers. iv seen other games do this as well i just dont know what roblox was smoking when they made this as a resource for devs

This is a basic example of how to do this.
This example is not the best because it is slow.

RobloxStudioBeta_fiJNM513Yz

local HttpService = game:GetService("HttpService");

function getFollowersForUserId(userId, cursor)
	local followers = {};
	local url = ("https://friends.roproxy.com/v1/users/%s/followers?limit=100"):format(tostring(userId));
	if(typeof(cursor) == "string") then
		url = ("%s&cursor=%s"):format(url, cursor);
	end
	local success, output = pcall(function() return HttpService:JSONDecode(HttpService:GetAsync(url)) end);
	if not (success) then
		return followers;
	end
	for _, v in pairs(output.data) do
		table.insert(followers, {
			name = v.name;
			displayName = v.displayName;
			userId = v.id;
		});
	end
	if(output.nextPageCursor) then
		local nextFollowers = getFollowersForUserId(userId, output.nextPageCursor);
		for _, v in pairs(nextFollowers) do
			table.insert(followers, v);
		end
	end
	return followers;
end

--// With over 2,000 followers, it may take more than 23 seconds
local start = os.time();
warn("Followers:", getFollowersForUserId(2465383470));
warn("Process took", (os.time() - start), "seconds");

You must enable the “Allow HTTP requests” option in "Game Settings > Security"

1 Like

it appears to not have worked in the output your showing me

You must enable the “Allow HTTP requests” option in “Game Settings > Security”

what about this:


wait(4)


local url = "https://friends.RoProxy.com/v1/users/"..game.Players:FindFirstChildOfClass("Player").UserId .."/followers"
local httpservice = game:GetService("HttpService")
local gettable = httpservice:GetAsync(url)
local decodedtable = httpservice:JSONDecode(gettable)


for i, v in pairs(decodedtable) do
	print(i, v)
end

how do i know which is better? this one provided a lot of information

source:

https://friends.roblox.com/docs#!/Friends/get_v1_users_targetUserId_followers

This way, you will only get one page of followers and not all of them.
(only 10 followers by default)

okay i got it so yours is better then since mine sucks even though mine is by roblox (im suprised roblox made it if it only even gets the first page lol)

You can go through each page using cursor right?

1 Like

hey how do i turn this into a table by the way?