Ok so i want to get the players UserID from username and profile picture and account created and friends and Followers if that is posible
But if i use the https://friends.roblox.com/v1/my/friends/count api it says my friends count and if i change my to one of my friends usernames i get a error
Its not in lua its in js and html i Will make it so its js
Can you help cause if i use the https://friends.roblox.com/v1/my/friends/count api it says my friends count and if i change my to one of my friends usernames i get a error
all except for friends and followers need roblox api request, you dont need “js” or “html” to perform the request (read roblox api docs)
The https://friends.roblox.com/v1/my/friends/count api does not work if i change it to https://friends.roblox.com/v1/Ander507Farm1/friends/count and that is my account also but it does not work
this is because/my/ is the only valid link which gets the user that is currently logged in on that browser/device
How do i get How many friends and followers then?
cookies, your browser store cookies that include your roblox account private keys so when you access roblox’s website, your browser include your cookies when the browser fetches a website’s code
Its not Lua but js i Can try make it in lua then
nope i cant use lua in a browser extension
You must use your UserId, not your username.
Change this:
https://friends.roblox.com/v1/Ander507Farm1/friends/count
To this:
https://friends.roblox.com/v1/users/376850929/friends/count
EDIT: I typed the wrong url, I have fixed it now.
You will need to learn how to use HTTP requests in order to communicate with the Roblox APIs. Look into some basic tutorials about how to use web APIs with JavaScript, once you have learned that, this should be easy to do.
My apologies, I made an error.
Try this instead:
https://friends.roblox.com/v1/users/376850929/friends/count
This is the solution but What about followers and get the userid from username and get the thumbnail picture from username or userid
Getting followers:
https://friends.roblox.com/v1/users/376850929/followers/count
Prints: Your Follower Count
Getting User Id from Username:
An example function that you can use to fetch the UserId of a User:
// Since you are doing this in a browser, I recommend using the built-in fetch api.
function GetIdFromUsername(Username) {
const usernameRequestBody = { // Body used for the request
"usernames": [`${Username}`],
"excludeBannedUsers": false
}
return fetch(`https://users.roblox.com/v1/usernames/users`, {
method: 'POST',
body: JSON.stringify(usernameRequestBody)
}).then((response) => response.json())
.then((data) => {
return data.data[0].id;
})
.catch(error => console.warn(error));
}
GetIdFromUsername("koko10233").then((id) => {
console.log(id)
})
// Prints: 376850929 (Your UserId)
Getting a User’s thumbnail:
https://thumbnails.roblox.com/v1/users/avatar-headshot userIds=USER_ID_HERE&size=48x48&format=Png&isCircular=false
Why not
.then(data => data.data[0].id)
?
Edit: No semicolon