Hello everyone! I want a way to retrieve data from this site: https://games.roblox.com/docs#!/Games/get_v1_games
Because I want to keep track of the visits my game has via a script/localscript. I need http service to do that. Can anyone pls help me ? Thank you so much!
local http = game:GetService('HttpService')
local url = 'https://games.roblox.com/v1/games?universeIds=UNIVERSEIDHERE'
local data = http:GetAsync(url)
local decoded = http:JSONDecode(data)
print(decoded.data[1].visits)
Thank you! But the thing is, you have to enter your universe id into the website. I have my universe Id, but your code doesnβt seem to use any. Thereβs an error. Can you help? Thanks you!
My code does. It says UNIVERSEIDHERE.
Oh wait yes I see it. Thank you so much! But I canβt use studio rn because of a server error thing with roblox. I will set as solution when roblox is working again:) thx
https://developer.roblox.com/en-us/api-reference/class/HttpService
Bare in mind the HttpService does not allow direct requests to any sites belonging to roblox.com, as such youβll need to proxy any requests you make.
You can host a proxy yourself following the steps & using:
If youβd rather use an online resource (one which you donβt need to host yourself):
ok βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ