How would I get the universe ID by a place ID?

Hey! If you remember, I made a post about this a while ago. But now the API that ive been using is deprecated and no longer usable. I’m still new to API’s and I would need an answer and an explanation on how it works.

local HTTP = game:GetService("HttpService")
local gameRequest = "https://apis.roblox.com/universes/v1/places/[PLACEID]/universe"

local success2, result2 = pcall(function()
	return HTTP:GetAsync(gameRequest)
end)

if success2 then
	UniverseID = HTTP:JSONDecode(result2).data[1].universeid
        print(UniverseID)
end
-- no output!!

Edit: the API url you provided is still working.
Anyways, you can use this method:

local HTTP = game:GetService("HttpService")
local RequestBaseURL= "https://games.[Proxy Website's Second Level Domain].com/v1/games/multiget-place-details?placeIds="

local function GetPlacesDetails(IntegerArray: {number})
	assert(typeof(IntegerArray) == "table")

	local RequestPlaces = ""
	for index, PlaceId in ipairs(IntegerArray) do
		RequestedData = string.format("%s&placeIds=%s", RequestPlaces, PlaceId)
	end

	local RequestURL = RequestBaseURL .. RequestPlaces 
	local Success, Response = pcall(function()
		return HTTP:GetAsync(RequestURL)
	end)
	
	if Success then
		return HTTP:JSONDecode(Response)
	else return nil end
end

Documentation

Edit-2: I did some test and the method I provided is always returning unauthorized error somehow…

maybe the API that you used requires a token or some type of verification

yeah, I found out… a Cookie.

Im tryna find an API that doesn’t require a verification or a cookie. Maybe we can try this again?

local HTTP = game:GetService("HttpService")
local gameRequest = "https://apis.roblox.com/universes/v1/places/[PLACEID]/universe"

local success2, result2 = pcall(function()
	return HTTP:GetAsync(gameRequest)
end)

if success2 then
	UniverseID = HTTP:JSONDecode(result2).data[1].universeid
        print(UniverseID)
end

What is the problem with it? Doesn’t it work?

yeah, the data im trying to get doesn’t work. I don’t know if I scripted it correctly. I know the API works but but I just cant get the universe id. I think it might have to do with

UniverseID = HTTP:JSONDecode(result2).data[1].universeid

Just try

UniverseID = HTTP:JSONDecode(result2).universeId

I actually don’t have a proxy to try it, but I think it would work

I’ve tried that one too. It still doesn’t work though. This is confusing…

Sorry, didn’t you use a proxy website?

https://apis.roblox.com/universes/v1/places/[PLACEID]/universe” and before you ask, I did change the [PLACEID] into a place ID.

No no…
I mean, you can’t send requests to the roblox domain from the studio neither from a published game, you’d have to use a proxy website to make these requests…

AH. WELL. SHOOT. Is there any proxy websites that aren’t broken? I used to use
https://api.roproxy.com/universes/get-universe-containing-place?placeid=[PlaceID]” but it doesn’t work anymore…

I did some search and didn’t find an alternative.
You can host your own proxy website, tho, as there are tutorials on the forum.

Oh, thanks for clearing that up. I was starting to think that something weird was going on!