I’m trying to figure out how to get a player’s profile information, such as how many friends they have, what groups they are in, how many followers have, ect. I’m sure this is possible, how would I do this?
I’ve tried searching the Dev Forum, the Developer Hub, and videos and found nothing.
You can get this info via HTTP requests to Roblox’s web api. However, you can’t make HTTP requests to any roblox.com endpoint while in game. Instead, you can make use of some proxies such as https://rprxy.xyz/.
Thanks for the fast reply, but would I do this with HttpsService? I’ve never used it, but it sounds like my solution.
Yes you will! It’s not too hard though. If you have scripting knowledge, you’ll be good.
A link to the HtppService documentation is here:
Yep! HttpService is exactly what you’d use. For example, to get someone’s friend count, you’d do something like this:
local HS = game:GetService("HttpService")
local response = HS:JSONDecode(
HS:GetAsync("https://friends.rprxy.xyz/v1/users/64772693/friends/count")
)
print(response.count)
Make sure that HTTP requests are enabled in the Game Settings in Studio.
Edit: For a complete documentation of Roblox’s web API, look here. To be able to access these in game, just replace anything that says “roblox.com” with “rprxy.xyz”.
Edit 2: Also, keep in mind that any responses will be a string that contains JSON. You need to decode this using HttpService:JSONDecode(str). This will give you a lua table that you can manipulate.
Another question: How would I know where to reference how many friends they have? I know you put this the script above, but I would like to know how to be able to reproduce it, but with actually knowing what it means How did you know that url? There’s no link on Roblox that just tells how many friends they have, and is there something with the proxy I don’t understand?
Edit: Also, I tried figuring this out myself with the script below, but it erred in 17:48:38.862 - HttpService is not allowed to access ROBLOX resources
Script
local HS = game:GetService("HttpService")
local Data = HS:JSONDecode(HS:GetAsync("rprxy.xyz/users/106042489/Profile"))
for i, v in pairs(Data) do
print(v)
end
First, always make sure to put “https://
” in front of your requests. Roblox requires this.
Second, a list of Roblox web APIs can be found at their api documentation site. You can click on each one to test it via their website, and it will give you a URL to use.