Getting visits from a respective game page using an API

,

Hello there,
I am trying to acquire visits that a game has and display that value on a website. The best way to do this would be to use the Roblox API, however I am not sure if Roblox currently supports this. Any ideas or 3rd party APIs would be really helpful to point me in the right direction.

Thank you

Here is a reference link and a screenshot of the data that I would like to acquire:

image

If you know the UniverseId, you can use:
https://games.roblox.com/v1/games?universeIds=UNIVERSEID

Otherwise you will have to use an auth token to get the UniverseId here:
https://games.roblox.com/v1/games/multiget-place-details?placeIds=PLACEID

There is a more appropriate endpoint to get the universe ID, it has been introduced during the deprecation of api.roblox.com and it is https://apis.roblox.com/universes/v1/places/{placeId}/universe

2 Likes

Thanks. That unauth endpoint definitely works better. Where did you find the full apis documentation? All I have ever been able to find is the deprecated api.roblox.com and occasionally a few endpoints for apis.roblox.com. https://apis.roblox.com/docs seems to be a dead link for me.

1 Like

The replacements for api.roblox.com endpoints are being posted in a devforum topic. The one you are looking for was announced there by a staff member.

3 Likes

Thank you @NinjaFurfante07 and @HeyWhatsHisFace for your help.

I have created the code and I have no issues accessing the API URL in-browser. https://games.roblox.com/v1/games?universeIds=2440500124
However, when I make a request on the website, it works fine to acquire the universe, but it seems to fail to access the actual game data. It throws an HTTP Internal Server Error.

Any idea why the Roblox API might be behaving this way?

You can’t directly send requests to roblox domains from games, you need to use a proxy.

Ah, I see, using a proxy did indeed resolve my issue. Thank you for your help!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.