Review your in-game stats with the GameStatsAPI!

Hey there! My name is Cosmental and I have recently made a post for requested community API modules for everyone to use and enjoy.

Today I am happy to tell you that I have been able to work on and release my first API module for public usage! :smiley:

What is the GameStatsAPI?

The GameStatsAPI is an API module that allows developers to view and receive information about their game statistics.

What can you do with the API?

The module has a bunch of built in functions for anyone to use easily and without too many limitations!
You can view how many visits a place currently has, how many favorites a game has, server info from all your servers, and much more!

For Example:

local GameStatsAPI = require(6056139948)
local PlaceVisits = GameStatsAPI:RequestVisitsAsync(261, 47324) --// SFOTH
print(PlaceVisits) --// Currently over 20M+ Visits

Where can I get a copy of the API?

You can either take a copy from the link bellow or you can simply write require(6056139948) inside of a script to request the module inside of your script!
https://www.roblox.com/library/6056139948/GameStatsAPI

Limitations

This module was made possible by using the roblox games API found here.

I do not 100% know what functions can be carried out and what cant or can be done with the roblox games API, I only made the module with the type of functions I found useful or ideal. (Feel free to add your own functions!)

Some functions may return errors such as HTTP 501 (Not Implemented) or HTTP 401 (unauthorized) due to certain functions being in BETA or simply restricted towards staff members and offsite scripting. (Some functions on the official site that are not included in the API require your ROBLOSECURITY cookie to function properly)

Recommendations

If you want to add your own functions or you just have trouble understanding the functions and what they return. I recommend using repr by @Ozzypig.

Documentation

You can find the documentation inside of the actual API module!

Conclusion

If you have any questions or concerns you can post them here or DM me privately @Cosmental.
Have fun!

[ This module was requested by @zaydoudou ]

14 Likes

You dont directly require RobloSecurity to use the API.

Roblox staff probably already has access to your RobloSecurity anyways. :thinking:

from what ive heard, not fully, i dont know, i dont think either of us are staff

Indeed, Thanks for your concern nonetheless!

Hello! This seems very useful, but I keep getting the error ā€œHTTP 404 (Not Found)ā€


local servers = stats:RequestServersAsync(2317712696) -- The Wild West

print(servers)

Thought it was the placeiD, but it doesnā€™t work even if I set it to my own game?

Never mind, apparently a server type is required. (You should probably clarify)

REALLY useful module dude, thanks. This is going to be used in my game coming very very soon.

I think Iā€™ve found a bug with RequestServersAsync. It all works perfectly until I set a PageSizeLimit - which always gives me an HTTP 404 (Bad Request)

This works fine:

 stats:RequestServersAsync(targetPlace, "Public")

But this doesnā€™t: (even though the default is 10 anyway)

stats:RequestServersAsync(targetPlace, "Public", 10)

Iā€™m guessing itā€™s an issue with URL formatting but I donā€™t know how that works really so I just have to wait.

1 Like

You should probably grab a copy meanwhile,
I plan to re-organize the thread as it is very messy and I only included a documentation inside of the actual module!

Thanks for letting me know, Iā€™ll be sure to look into it! :slight_smile:

1 Like

I fixed it, it was a URL formatting issue. I just had to check the website to get the right format.

On line 120,

change this:

url = url.."&limit="..PageSizeLimit

to this:

url = url.."?sortOrder=Asc&limit="..PageSizeLimit
1 Like

Indeed, I had fixed this issue a few hours ago, I apologize for not informing you about the update. :worried:

Thanks for catching that!

1 Like

Thanks again for the module. This is extremely, extremely useful.

Being used to make a server list in my production game. (Itā€™s not actually open yet, these arenā€™t my gameā€™s servers lol)

2 Likes

Hold on so does that mean that the api will instantly get my ROBLOSECURITY when executing some functions or i have to insert my ROBLOSECURITY?

1 Like

I probably should have clarified this sooner haha! :sweat_smile:

As mentioned on the original post, this API works off of the official Roblox Games API.
This means that I only Imported the offical API into Roblox studio to make it easier to use.

Some functions on the Roblox Games API are not inside of the module script because they require ROBLOSECURITY cookies which are not really ideal when viewing your in game stats.

No this does not mean that the API module will require or get your ROBLOSECURITY cookie as the functions that do require this cookie are not inside of the actual API module.

1 Like

The RequestVisitsAsync() function appears to be slightly broken as it only seems to be getting games that are NOT on a users profile.

Iā€™ll release a fix sometime tomorrow or the day after, I apologize!

I apologize to anyone in advanced who is having issues with the module, I plan to re-release the module in a couple of days - weeks.

The reason as to why is because I want to add a more efficient set of functions to the API as well as improving previous functions like RequestVisitsAsync()! :sweat_smile:

Have you released a new version of this yet? It seems to not be working for me.

I have not lately released a new version but I plan to rework it when I have time. :grin:

1 Like

It wonā€™t work now, because rprxy has been shutdowned, please make it work with for example ProxyService or how it was @Cosmental

Could you please elaborate as to what rprxy is? This was originally made to work with Robloxā€™s default HTTPService but the script may be out of date at this point and a rework is currently highly unlikely.

It was a proxy, but it is no longer available