Getting a profile's region and realm IDs

Hello there,

I’m trying to get a profile’s region and realm ID for a specific account. Based on the documentation it should be possible by making a request to GET /player/{accountId} . The response should include the user’s name, profile URL, avatar URL, profile ID, region ID, and realm ID. However, a 404 Not Found is returned.

E.g. GET https://us.battle.net/player/2037802

I retrieved the accountId by making a GET request to https://us.battle.net/oauth/userinfo

What am I missing here?

Hi Kult,

Can you share which documentation you are referring to? I am not familiar with any APIs that expose a /player endpoint. Additionally, all public APIs are generally off of the {region}.api.blizzard.com domain.

You can find a full reference to our OAuth APIs can here.

Hi Maguthul,

Here is the link to the documentation: Blizzard Battle.net Developer Portal

Hi Kult,

Apologies, I didn’t initially recognize that this documentation was referencing the Starcraft II APIs.

The Starcraft II APIs are currently offline. You can find more information on that here.

Apologies for the confusion.

Indeed, that was not clear for me as well. The size of the heading is a bit misleading. My use case is relatively simple: I would like to avoid that the user logged in with a Battle.NET account in my application has to select the region before making any API calls. For example to get all WoW characters, the region must be known before making this request:

https:// us.api.blizzard. com/profile/user/wow?namespace=profile-us&locale=en_US&access_token=1234

Is it possible to get the region for a specific account with the API?

Unfortunately, I do not believe it is currently possible to determine the regional affinity of an account using the existing APIs.

I’ll start some discussions and see if we can provide additional functionality to support this; however, I cannot provide any timeline or promise that we can support this use-case. Thanks for the inquiry.

2 Likes

As a workaround you can ask the user for their account region during the authorization process by creating multiple OAuth2 authorization links - one for each region - like you can see on warcraftlogs or you can change the region of the OAuth link dynamically by having the user selecting the region on a dropdown menu.

1 Like