Is there an API to get Universe ID using Game ID?

I’m creating a discord bot that when a command is executed, gets some game information and returns a message with the information, but most of the information needs the Universe ID, which you can only access if you’re a developer, or if you somehow get the game place ID and put it into one of the APIs and get the universe ID, so I wanted to make it easier and just use the game ID, not the universe ID, so is there an API for that?

3 Likes

https://api.roblox.com/universes/get-universe-containing-place?placeid=[PLACEID]
Is this what you’re looking for?
Taken from How do I get UniverseId from PlaceId? (ROBLOX API).

2 Likes

Nope, that one uses the place ID, i want to use the game ID

Isn’t the game ID the universe ID? Sorry it took long, I wasn’t here (I had to do something).

No the universe ID is not the same thing as the game ID, and I don’t think there’s a way to use the game ID… I’ll check through all of the APIs and get back to you once I have. Here’s a list of them all for you so you can check too APIs.

I tried this out with a random game I just published.
image
You can see I printed game.GameId.
Now I put this into https://develop.roblox.com/v1/universes/[Id].
Taadaa. (https://develop.roblox.com/v1/universes/2810104337)


And since the link has “universes” in it, I would guess that UniverseId == GameId. Correct me if I am wrong though.

Sorry, it looks like the only way to get the universe ID is with the place ID… Using this request:
https://games.roblox.com/v1/games/multiget-place-details?placeIds=[PLACEIDHERE]

3 Likes

Ah, that’s odd because I tried that and it didn’t seem to work…
I have a feeling that I might have been using the place ID though.

@SleepyLuc let me know if it works for you.

2 Likes

wait… what? i’m so confused, i used the game id replacing [PLACEID] and i got my universe id? thats so odd… i never knew about that lol, thanks btw!

1 Like

We can troubleshoot this.
What you probably meant by “GameId” is this (since you said it’s easy to access).image
This is actually the PlaceId, not the GameId, even though it looks like it should be the GameId.
It’s somewhat confusing, I understand.
Hope that clears up the confusion though.

1 Like

ohhhh i got it, thanks for explaining (:

1 Like

Yeah, I realised this after talking to you, Roblox has this feature so you can have different pages for each place in your game, which is overall easier than having a game ID and then the place ID in the URL.

Thanks for your help :slightly_smiling_face:

1 Like