How to check if a game is a place or a game

so i want to make a game that teleports you to other random games but theyre often just some sub-places to other games
image
image
is it possible to somehow check if the generated id is a game or a place to prevent this from happening?

So this is a game working as a portal to random places?
Those IDs are generated randomly?
Sometimes you get the subplace instead of the StartingPlace/Game ID?

To get the startingPlace of a game when only having a subplace ID you could do an HTTP GET request to the following URL: https://api.roblox.com/marketplace/productinfo?assetId=<ASSET ID>

The response will be in JSON format, and it will contain a field called ProductId . The value of this field is the game ID of the starting place that the subplace is a part of.

local HttpService = game:GetService("HttpService")

local assetId = 123456 -- The generated ID
local url = "https://api.roblox.com/marketplace/productinfo?assetId=" .. assetId
local response = HttpService:GetAsync(url)
local data = HttpService:JSONDecode(response)
local gameId = data.ProductId

yeah that would work too, but wouldnt that end up with 50% of the teleports being notoriety, tower battles or some other popular game?
is it possible to get a boolean that would tell me wheter its a game or a subplace so i can ignore them?

Im not sure, maybe like this:

local placeId = 12345 -- Replace with the Place ID you want to check

local response = game:GetService("HttpService"):GetAsync(
  "https://www.roblox.com/api/place/get-place?placeId=" .. placeId
)

local data = game:GetService("HttpService"):JSONDecode(response)

if data.parent then
  print("This is a subplace.")
else
  print("This is a starting place.")
end

nope it gave me this error
image

What about:

local placeId = 12345 -- Replace with the Place ID you want to check

local response = game:GetService("Networking"):PostAsync(
  "https://www.roblox.com/api/place/get-place",
  "application/x-www-form-urlencoded",
  "placeId=" .. placeId
)

local data = game:GetService("HttpService"):JSONDecode(response)

if data.parent then
  print("This is a subplace.")
else
  print("This is a starting place.")
end


apparently theres no such thing as PostAsync

I like the game idea you have, if you make it work properly give priority to my games :3 haha.
Is Networking enabled for your experience?

if game:GetService("Networking") then
  print("The Networking service is available.")
else
  print("The Networking service is not available.")
end

Honestly I never tried your request before… does the other games needs to have it enabled it too? idk…

image
nope it is not, how would i enable it?