So the title explains it all is there any endpoint that returns users account description from username?
There is no API to get a user’s account description from a username as far as I am aware. You could use some external source and try to extract the information from the web page, but I’m not really sure if this would be easy.
Here’s a list of the API’s.
If that isn’t possible then is there an API that returns UserId from username?
I assume this is what you want.
I don’t want this for my ROBLOX game.
This documentation here has all the endpoints:
I can’t see anything, but if you can spot something I can’t, let me know.
Absolutely. Here is the main API for that:
http://api.roblox.com/docs#Users
(it’s the second one in the list)
In PHP, you can send a cURL request to the user’s profile (Log in to Roblox) and scrape their blurb. However, I’d definitely recommend learning Node.js
Have a look at this article: Parse Web Pages with PHP Simple HTML DOM Parser
I have made my own API for getting Blurbs, jsut via endpoint, I will send you it via DM
I do know node.js as well but I chose php for this project.
The library used in the linked article is one I used in a college project that scraped web pages for product allergy information. It’s excellent, but in hindsight, I wish I’d used Node, rather than PHP for the app
I usually use Node wen I want to make my own endpoints.
If you’re really leaning toward scraping the website, try this:
(I realise it’s Node.js, but I can’t find any alternatives. Maybe use the algorithm and change it to PHP?)
Ok, I’ve done some simple digging around, and I have some information for you that will hopefully help you in your web scraping efforts.
-
The CSS class for the bio is ”profile-about-content-text linkify” The profile is a span element. I can’t find anything else on the page with those exact criteria. Maybe search for that to get the text?
-
A bulky amount of the page source is JavaScript, which is useless to us. You can remove the entire head section of the page, and all script tags.
-
The page uses Angular, so you’re going to come across a load of ”ng-???” stuff here and there.
Don’t copy and paste this – it’s been several years since I’ve used PHP, but you’d probably be looking along the lines of this:
include('simple_html_dom.php');
$userId = $_GET['userId'];
$code = 'HELLO_WORLD';
$html = file_get_html('https://www.roblox.com/users/$userId/profile');
$blurb = $html->find('span.profile-about-content-text')->innertext;
echo (strpos($blurb, $code) !== false) ? 'Code found!' : 'Please add $code to your profile!';
With my PHP knowledge and with your code I think I can do it I appreciate the help.
I will update you.
I wasn’t doing this in Roblox.
- This is a really old topic
- The user is suspended
In case anyone is still wondering on how to do this, you can use the following endpoint to fetch information about the profile:
https://users.roblox.com/v1/users/{userid}
In order to get the ID from the username, request to this endpoint:
https://api.roblox.com/users/get-by-username?username={username}
Replace both the {userid} and the {username} fields by their user id and username respectively.
Hope this helps!
Note: You can also check out https://users.roblox.com/docs for more endpoints in case you need them