What API should I use to check a players rap?

So I’m making a 100k+ Rap required door in a game and I used to just use rprxy when I used to mess around with studio a little bit, but that got taken down ages ago. What API would you recommend?

It seems like a really bad idea to do make a 100k+ RAP required door in your game, but I think you can use roproxy.com.

2 Likes

Hello, I decided to write a script which achieves this.

local http = game:GetService("HttpService")
local players = game:GetService("Players")

local baseUrl = "https://inventory.roproxy.com/v1/users/%d/assets/collectibles?sortOrder=Asc&limit=100&cursor=%s"

local function getTotalRecentAveragePriceRecursive(userId, recentAveragePriceCumulative, cursor)
	recentAveragePriceCumulative = recentAveragePriceCumulative or 0
	cursor = cursor or ""
	
	local requestUrl = baseUrl:format(userId, cursor)
	local success, result = pcall(function()
		return http:GetAsync(requestUrl)
	end)
	
	if success then
		if result then
			local success2, result2 = pcall(function()
				return http:JSONDecode(result)
			end)
			
			if success2 then
				if result2 then
					for _, collectible in ipairs(result2.data) do
						if collectible.recentAveragePrice then
							recentAveragePriceCumulative += collectible.recentAveragePrice
						end
					end
					
					cursor = result2.nextPageCursor
					if cursor then
						return getTotalRecentAveragePriceRecursive(userId, recentAveragePriceCumulative, cursor)
					else
						return recentAveragePriceCumulative
					end
				end
			else
				warn(result2)
				getTotalRecentAveragePriceRecursive(userId, recentAveragePriceCumulative, cursor)
			end
		end
	else
		warn(result)
		getTotalRecentAveragePriceRecursive(userId, recentAveragePriceCumulative, cursor)
	end
end

local totalRecentAveragePrice = getTotalRecentAveragePriceRecursive(1)
print(totalRecentAveragePrice) --133674592

image

You simply call the function with the ID of the user you want the total RAP of.

2 Likes