How I'm I supposed to get the player place visits on my game?

I tried using apis but can’t understand really how to use them please help :

local players = game:GetService("Players")
local HTTP = game:GetService("HttpService")
local ProxyService = require(game:GetService('ServerScriptService').ProxyService)
local Proxy = ProxyService:New('https://devplaceroblox.herokuapp.com', 'acceskeywontshare')
local Time_Cap = 35 



local function OnAdded(player)
	print("welcome, ", player.Name)
	
	local id = player.UserId
	local endpoint, place_details = how to get the player profile and check the visits
	local data, tries, completed = nil, 0, false

	local ids, visits = {}, {}

	ids[player.Name] = {}
	visits[player.Name] = 0


	coroutine.wrap(function()
		local started = os.time()
		while not completed do 
			if os.time() - started >= Time_Cap then print("aborting operation") -- can be eliminated with an 'and' above
				return
			end
			wait(0.2)
		end
	end)()


	while not data and tries < 4 do 

		pcall(function()
			data = HTTP:GetAsync(endpoint)
		end)
		tries += 1
		wait(3)
	end

	if data then	
		data = HTTP:JSONDecode(data).data
		for _, value in pairs(data) do		
			table.insert(ids[player.Name], value.id) print("inserted place id: ", value.id)
		end
	end

	local throttle = 0

	for _, id in pairs(ids[player.Name]) do

		if throttle == 5 then wait(4) throttle = 0 end
		pcall(function()
			data = HTTP:GetAsync(place_details..id)
		end)

		if data then
			data = HTTP:JSONDecode(data).data[1]
			visits[player.Name] += tonumber(data.visits) print("added visits: ", data.visits)	
		end
		throttle += 1
	end

	player.leaderstats.PlaceVisits.Value = visits[player.Name]

end

players.PlayerAdded:Connect(OnAdded)
1 Like

Could you develop your question better?

2 Likes

Hey, sorry as time passed by I found a solution.

1 Like

I think you should put this at solution, so people don’t waste time looking at this just to see it was already solved. Also, try putting the script solution?

I just used something different :

local endpoint, place_details = "https://games.roproxy.com/v2/users/"..id.."/games?accessFilter=Public&sortOrder=Asc&limit=25", "https://games.roproxy.com/v1/games?universeIds="