Hello, this is the third topic I made so if there is something wrong you can tell me.
I want to know how to see if a user that is not in-game has Premium Membership.
I’ve done a lot of research and I found this API: https://premiumfeatures.roblox.com/docs#!/PremiumFeaturesUsers/get_v1_users_userId_validate_membership
I tried it with the https://rprxy.xyz proxy but it responds with Code 401 (Unauthorized) even though I was logged in, but when I tried the original from the browser it worked.
I looked through other topics like this and I found the same API.
I want to achieve this because I’m working on a model that will create a GUI that shows the info of any player that is put on a TextBox.
This is the code I used:
local HttpService = game:GetService("HttpService")
print(HttpService:GetAsync("https://premiumfeatures.rprxy.xyz/v1/users/1/validate-membership")) -- Check if ROBLOX has Premium Membership.
How can I fix this error? Are there any other ways to check if an offline user has Premium Membership?
Roblox doesn’t allow you to send http requests to their own servers from Roblox’s Http Service. You need to setup an external server, send request to that server, which will send request to Roblox.
The reason this one doesn’t work with a proxy is due to the fact that it requires a login cookie. You cannot make requests to this endpoint without being logged in.
You will have to either make your own proxy which is authenticated with a disposable account, or scrape the profile HTML to check for the Premium icon of the user.
Although it’s not a solution, for older user accounts that were previously BC, you can always check if they own any of the BC hard hats.
Nice… I completely missed that. I am over here reading through rprxy’s source code to see who’s at fault. Ridiculous that ROBLOX doesn’t document ANYTHING PROPERLY. How could they leave out that you need the proper cookies/authentication for the endpoint? Or am I the idiot here?
EDIT I am just going to blame ROBLOX here they could’ve at least added cookies to the cURL example they show.
If you right click on the Premium icon on someone’s profile, you can generally use an Inspect Element option to identify the HTML. You can use things like the class name of the icon to reference it. It’s likely that this icon doesn’t exist on non-Premium profiles.
@hamsterloverboy3 not your fault at all. Roblox APIs are generally lacking in documentation, but then I would assume the APIs are there for their own developers to use more than us. If Roblox were keen on us to create bots, automate and pull data, they’d document it all properly (or even create an official framework for it).
For a really crude attempt you could create your own service to scrape https://www.roblox.com/users/USER_ID/profile to look for an element with classes icon-premium-medium or icon-premium-small
This works when logged out without cookies, but obviously is a bit slower and clunkier and requires you to either make your own scraper to do it on your own web server, or in Lua if you want to continue using the https://rprxy.xyz/users/USER_ID/profile proxy.
Edit: Didn’t see that someone had suggested similar in the last reply.
If you want to do it in Lua and still use the proxy then yes, exactly that.
You have to escape the hyphen due to its special (or “magic”) meaning in string patterns. Check out the documentation for string.find and string.match if you’re unsure how they work.
Try the following:
local HttpService = game:GetService("HttpService")
print(string.find(string.lower(HttpService:GetAsync("https://www.rprxy.xyz/users/1/profile")), "icon%-premium"))
-- Note % is used to escape special characters that have extra meaning in string patterns
Thank you, now it’s working!
I’m not very experienced with string formatting, I will look for some information about it.
Thanks also to the others who replied (@hamsterloverboy3, @cxmeels, @StrategicPlayZ).