steamid
- class steam.steamid.SteamID(*args, **kwargs)
Bases:
intObject for converting steamID to its’ various representations
SteamID() # invalid steamid SteamID(12345) # accountid SteamID('12345') SteamID(id=12345, type='Invalid', universe='Invalid', instance=0) SteamID(103582791429521412) # steam64 SteamID('103582791429521412') SteamID('STEAM_1:0:2') # steam2 SteamID('[g:1:4]') # steam3
- class EType(*values)
Bases:
SteamIntEnumreference to EType
- Invalid = 0
Used for invalid Steam IDs
- Individual = 1
single user account
- Multiseat = 2
multiseat (e.g. cybercafe) account
- GameServer = 3
game server account
- AnonGameServer = 4
anonymous game server account
- Pending = 5
pending
- ContentServer = 6
content server
- Clan = 7
Steam Group (clan)
- Chat = 8
Steam group chat or lobby
- ConsoleUser = 9
Fake SteamID for local PSN account on PS3 or Live account on 360, etc
- AnonUser = 10
Anonymous user account. (Used to create an account or reset a password)
- Max = 11
- class EUniverse(*values)
Bases:
SteamIntEnumreference to EUniverse
- Invalid = 0
- Public = 1
- Beta = 2
- Internal = 3
- Dev = 4
- Max = 6
- class EInstanceFlag(*values)
Bases:
SteamIntEnumreference to EInstanceFlag
- MMSLobby = 131072
- Lobby = 262144
- Clan = 524288
- property type
- Return type:
steam.enum.EType
- property universe
- Return type:
steam.enum.EUniverse
- property as_steam2
- Returns:
steam2 format (e.g
STEAM_1:0:1234)- Return type:
Note
STEAM_X:Y:Z. The value ofXshould represent the universe, or1forPublic. However, there was a bug in GoldSrc and Orange Box games andXwas0. If you need that format useSteamID.as_steam2_zero
- property as_steam2_zero
For GoldSrc and Orange Box games. See
SteamID.as_steam2- Returns:
steam2 format (e.g
STEAM_0:0:1234)- Return type:
- property community_url
- Returns:
- Return type:
- static from_csgo_friend_code(code, universe=EUniverse.Public)
Takes CS:GO friend code and returns SteamID
- static from_invite_code(code, universe=EUniverse.Public)
Invites urls can be generated at https://steamcommunity.com/my/friends/add
- static from_url(url, http_timeout=30)
Takes Steam community url and returns a SteamID instance or
NoneSee
steam64_from_url()for details
- steam.steamid.steam2_to_tuple(value)
- Parameters:
value (
str) – steam2 (e.g.STEAM_1:0:1234)- Returns:
(accountid, type, universe, instance)
- Return type:
tupleorNone
Note
The universe will be always set to
1. SeeSteamID.as_steam2
- steam.steamid.steam3_to_tuple(value)
- steam.steamid.steam64_from_url(url, http_timeout=30)
Takes a Steam Community url and returns steam64 or None
Warning
Each call makes a http request to
steamcommunity.comNote
For a reliable resolving of vanity urls use
ISteamUser.ResolveVanityURLweb api- Parameters:
- Returns:
steam64, or
Noneifsteamcommunity.comis down- Return type:
intorNone
Example URLs:
https://steamcommunity.com/gid/[g:1:4] https://steamcommunity.com/gid/103582791429521412 https://steamcommunity.com/groups/Valve https://steamcommunity.com/profiles/[U:1:12] https://steamcommunity.com/profiles/76561197960265740 https://steamcommunity.com/id/johnc https://steamcommunity.com/user/cv-dgb/
- steam.steamid.from_url(url, http_timeout=30)
Takes Steam community url and returns a SteamID instance or
NoneSee
steam64_from_url()for details