I'm trying to use Web API to see Engagement Earnings on my Game and it's not working

As the title says, I am trying to see the Engagement Payouts on my game and the script returns a 401 error.
This is what I have so far:

local http = game:GetService("HttpService")
local Url = "https://engagementpayouts.roproxy.com/v1/universe-payout-history?universeId=5704561876&startDate=2024-03-12&endDate=2024-02-28"
local Result = http:GetAsync(Url)

local data = http:JSONDecode(Result)["additionalProp1"]["payoutInRobux"]
print(data)

I’m very new to the Roblox Web API so my mistake might be very stupid. Please help.

Sadly you cannot access Roblox’s resources directly from Roblox for security and If I had to take a guess, the fact that you’re using a proxy has for consequences that you’re no longer authenticated.

Why exactly are you looking for displaying those info on a Roblox game while you can see them easily on the dev dashboard?

Like @Kolbxyz said, it is an authentication error. Only people with permission can access a game’s analytics. When you are using a proxy like roproxy, it is not making the request with any cookies, and therefore no authentication. If you wish to do this, your best bet is creating your own proxy.

Put the roblox cookie in the header, this may not be a very smart method though as the person running “RoProxy” could just decide to steal your cookie.

I would not recommend manipulating that kind of sensitive information.
Moreover, the cookies sometimes reset so you’d need to refresh the script regularly or do some tricky and risky automation.

Exactly, I agree with you. Like I said its not a very smart method as its very unsecure

1 Like