Wowpedia
Advertisement
Townlong-Yak Globe.png  Townlong-Yak BAD.png  ProfIcons engineering.png C_BattleNet.GetAccountInfoByID Shadowlands-Icon-Inline.png + 8.2.5
Townlong-Yak Globe.png  Townlong-Yak BAD.png  ProfIcons engineering.png C_BattleNet.GetAccountInfoByGUID Shadowlands-Icon-Inline.png + 8.2.5
Townlong-Yak Globe.png  Townlong-Yak BAD.png  ProfIcons engineering.png C_BattleNet.GetFriendAccountInfo Shadowlands-Icon-Inline.png + 8.2.5
Townlong-Yak Globe.png  Wowprogramming.png BNGetFriendInfo Bc icon.gif + 3.3.5 / 1.13.2 - 8.2.5
Townlong-Yak Globe.png  Wowprogramming.png BNGetFriendInfoByID Bc icon.gif + 3.3.5 / 1.13.2 - 8.2.5

Returns information about a Battle.net friend account.

accountInfo = C_BattleNet.GetAccountInfoByID(id [, wowAccountGUID])
            = C_BattleNet.GetAccountInfoByGUID(guid)
            = C_BattleNet.GetFriendAccountInfo(friendIndex [, wowAccountGUID])

Arguments

GetAccountInfoByID

id 
number - This is the same ID as the bnetAccountID return field.
wowAccountGUID 
string? : BNetAccountGUID

GetAccountInfoByGUID

guid 
string : UnitGUID

GetFriendAccountInfo

friendIndex 
number - Index ranging from 1 to BNGetNumFriends()
wowAccountGUID 
string? : BNetAccountGUID

Returns

/spew output

accountInfo 
BNetAccountInfo?
Key Type Description
bnetAccountID number Unique numeric identifier for the friend's Battle.net account during this session
accountName string A protected string representing the friend's full name or BattleTag name
battleTag string The friend's BattleTag (e.g., "Nickname#0001")
isFriend boolean
isBattleTagFriend boolean Whether or not the friend is known by their BattleTag
lastOnlineTime number The number of seconds elapsed since this friend was last online (from the epoch date of January 1, 1970). Returns nil if currently online.
isAFK boolean Whether or not the friend is flagged as Away
isDND boolean Whether or not the friend is flagged as Busy
isFavorite boolean Whether or not the friend is marked as a favorite by you
appearOffline boolean
customMessage string The Battle.net broadcast message
customMessageTime number The number of seconds elapsed since the current broadcast message was sent
note string The contents of the player's note about this friend
rafLinkType Enum.RafLinkType Enum.RafLinkType
gameAccountInfo BNetGameAccountInfo
BNetGameAccountInfo
Key Type Description
gameAccountID number? Unique numeric identifier for the friend's Battle.net game account
clientProgram string BNET_CLIENT
isOnline boolean
isGameBusy boolean
isGameAFK boolean
wowProjectID number?
characterName string? The name of the logged in toon/character
realmName string? The name of the logged in realm
realmDisplayName string?
realmID number? The ID for the logged in realm
factionName string? The englishFaction name (i.e., "Alliance" or "Horde")
raceName string? The localized race name (e.g., "Blood Elf")
className string? The localized class name (e.g., "Death Knight")
areaName string? The localized zone name (e.g., "The Undercity")
characterLevel number? The current level (e.g., "90")
richPresence string? For WoW, returns "zoneName - realmName". For StarCraft 2 and Diablo 3, returns the location or activity the player is currently engaged in.
playerGuid string? A unique numeric identifier for the friend's character during this session.
isWowMobile boolean
canSummon boolean
hasFocus boolean Whether or not this toon is the one currently being displayed in Blizzard's FriendFrame
regionID number Added in 9.1.0
isInCurrentRegion boolean Added in 9.1.0
BNET_CLIENT
Global Value Description
BNET_CLIENT_WOW WoW World of Warcraft
BNET_CLIENT_SC2 S2 StarCraft 2
BNET_CLIENT_D3 D3 Diablo 3
BNET_CLIENT_WTCG WTCG Hearthstone
BNET_CLIENT_APP App Battle.net desktop app
BSAp Battle.net mobile app
BNET_CLIENT_HEROES Hero Heroes of the Storm
BNET_CLIENT_OVERWATCH Pro Overwatch
BNET_CLIENT_CLNT CLNT
BNET_CLIENT_SC S1 StarCraft: Remastered
BNET_CLIENT_DESTINY2 DST2 Destiny 2
BNET_CLIENT_COD VIPR Call of Duty: Black Ops 4
BNET_CLIENT_COD_MW ODIN Call of Duty: Modern Warfare
BNET_CLIENT_COD_MW2 LAZR Call of Duty: Modern Warfare 2
BNET_CLIENT_COD_BOCW ZEUS Call of Duty: Black Ops Cold War
BNET_CLIENT_WC3 W3 Warcraft III: Reforged
BNET_CLIENT_ARCADE RTRO Blizzard Arcade Collection
BNET_CLIENT_CRASH4 WLBY Crash Bandicoot 4
BNET_CLIENT_D2 OSI Diablo II: Resurrected
BNET_CLIENT_COD_VANGUARD FORE Call of Duty: Vanguard

Example

Shows your own account info.

/dump C_BattleNet.GetAccountInfoByID(select(3, BNGetInfo()))

Shows your Battle.net friends' account information.

for i = 1, BNGetNumFriends() do
	local acc = C_BattleNet.GetFriendAccountInfo(i)
	local game = acc.gameAccountInfo
	print(acc.bnetAccountID, acc.accountName, game.gameAccountID, game.isOnline, game.clientProgram)
end
-- 1, "|Kq2|k", 5, true, "BSAp"
-- 2, "|Kq1|k", nil, false, ""

Patch changes

  • Battle for Azeroth Patch 8.2.5 / API (2019-09-24): Reworked and moved to C_BattleNet.GetFriendAccountInfo() and C_BattleNet.GetAccountInfoByID(). The previous alias is deprecated. [1]
  • Warlords of Draenor Patch 6.2.4 / API (2016-03-22): Replaced presenceID and presenceName with bnetIDAccount and accountName.
  • Mists of Pandaria Patch 5.0.4 / API (2012-08-28): Replaced givenName and surname with presenceName, battleTag, and isBattleTagPresence.
  • Wrath of the Lich King Patch 3.3.5 / API (2010-06-22): Added as BNGetFriendInfo() and BNGetFriendInfoByID().
Advertisement