API reference

The following document outlines the front facing aspects of steam.py.

Note

This module uses Python’s logging module to debug, give information and diagnose errors, it is recommended to configure this if necessary as errors or warnings will not be propagated properly.

Client

class steam.Client(*, proxy: str | None = ..., proxy_auth: aiohttp.helpers.BasicAuth | None = ..., connector: aiohttp.connector.BaseConnector | None = ..., max_messages: int | None = 1000, game: steam.game.Game | None = ..., games: list[steam.game.Game] = ..., state: steam.enums.PersonaState | None = PersonaState.Online, ui_mode: steam.enums.UIMode | None = UIMode.Desktop, flags: steam.enums.PersonaStateFlag | None = PersonaStateFlag.NONE, force_kick: bool = False, language: Language = Language.English, auto_chunk_chat_groups: bool = False)

Represents a client connection that connects to Steam. This class is used to interact with the Steam API and CMs.

Parameters:
  • proxy – A proxy URL to use for requests.

  • proxy_auth – The proxy authentication to use with requests.

  • connector – The connector to use with the aiohttp.ClientSession.

  • max_messages – The maximum number of messages to store in the internal cache, default is 1000.

  • game – A games to set your status as on connect.

  • games – A list of games to set your status to on connect.

  • state

    The state to show your account as on connect.

    Note

    Setting your status to Offline, will stop you receiving persona state updates and by extension on_user_update() will stop being dispatched.

  • ui_mode – The UI mode to set your status to on connect.

  • flags – Flags to set your persona state to.

  • force_kick – Whether to forcefully kick any other playing sessions on connect. Defaults to False.

  • language – The language to use when interacting with the API.

  • auto_chunk_chat_groups – Whether to automatically call chunk on clans and groups filling ChatGroup.members. Setting this to True isn’t recommend unless you have a good internet connection and good hardware.

property user: ClientUser

Represents the connected client. None if not logged in.

property users: Sequence[User]

A read-only list of all the users the connected client can see.

property trades: Sequence[TradeOffer]

A read-only list of all the trades the connected client can see.

property groups: Sequence[Group]

A read-only list of all the groups the connected client is in.

property messages: Sequence[Message]

A read-only list of all the messages the client has.

property clans: Sequence[Clan]

A read-only list of all the clans the connected client is in.

property licenses: Sequence[License]

A read-only list of licenses the client has access to.

property emoticons: Sequence[ClientEmoticon]

A read-only list of all the emoticons the client has.

property stickers: Sequence[ClientSticker]

A read-only list of all the stickers the client has.

property latency: float

Measures latency between a heartbeat send and the heartbeat interval in seconds.

await code()

Get the current steam guard code.

Warning

This function will wait for a Steam guard code using input() in an executor if no shared_secret is passed to run() or start(), which blocks exiting until one is entered.

Return type:

str

is_ready()

Specifies if the client’s internal cache is ready for use.

Return type:

bool

is_closed()

Indicates if connection is closed to the API or CMs.

Return type:

bool

@event(coro: None = None) Callable[[E], E]
@event(coro: E) E

A decorator that could be called. Register an event to listen to.

The events must be a coroutine, if not, TypeError is raised.

Usage:

@client.event
async def on_ready():
    print("Ready!")
Raises:

TypeError – The function passed is not a coroutine.

Return type:

Union[collections.abc.Callable[steam.client.E, steam.client.E], steam.client.E]

run(username: str, password: str, *, shared_secret: str | None = None, identity_secret: str | None = None) object

A blocking call that abstracts away the event loop initialisation from you.

It is not recommended to subclass this method, it is normally favourable to subclass start() as it is a coroutine.

Note

This takes the same arguments as start().

Return type:

builtins.object

await login(username, password, *, shared_secret=None)

Login a Steam account and the Steam API with the specified credentials.

Parameters:
  • username (str) – The username of the user’s account.

  • password (str) – The password of the user’s account.

  • shared_secret (Optional[str]) – The shared_secret of the desired Steam account, used to generate the 2FA code for login. If None is passed, the code will need to be inputted by the user via code().

Raises:
  • .InvalidCredentials – Invalid credentials were passed.

  • .LoginError – An unknown login related error occurred.

  • .NoCMsFound – No community managers could be found to connect to.

await close()

Close the connection to Steam.

clear()

Clears the internal state of the bot. After this, the bot can be considered “re-opened”, i.e. is_closed() and is_ready() both return False. This also clears the internal cache.

await start(username, password, *, shared_secret=None, identity_secret=None)

A shorthand coroutine for login() and connect().

If no shared_secret is passed, you will have to manually enter a Steam guard code using code().

Parameters:
  • username (str) – The username of the account to login to.

  • password (str) – The password of the account to login to.

  • shared_secret (Optional[str]) – The shared secret for the account to login to.

  • identity_secret (Optional[str]) – The identity secret for the account to login to.

await connect()

Initialize a connection to a Steam CM after logging in.

get_user(id)

Returns a user from cache with a matching ID or None if the user was not found.

Parameters:

id (utils.Intable) – The ID of the user, can be an SteamID.id64, SteamID.id, SteamID.id2 or an SteamID.id3.

Return type:

Optional[steam.user.User]

await fetch_user(id)

Fetches a user with a matching ID or None if the user was not found.

Parameters:

id (utils.Intable) – The ID of the user, can be an SteamID.id64, SteamID.id, SteamID.id2 or an SteamID.id3.

Return type:

Optional[steam.user.User]

await fetch_users(*ids)

Fetches a list of User or None if the user was not found, from their IDs.

Note

The User objects returned are unlikely to retain the order they were originally in.

Parameters:

ids (utils.Intable) – The user’s IDs.

Return type:

list[Optional[steam.user.User]]

await fetch_user_named(name)

Fetches a user from https://steamcommunity.com from their community URL name.

Parameters:

name (str) – The name of the user after https://steamcommunity.com/id

Return type:

Optional[steam.user.User]

get_trade(id)

Get a trade from cache with a matching ID or None if the trade was not found.

Parameters:

id (int) – The id of the trade to search for from the cache.

Return type:

Optional[steam.trade.TradeOffer]

await fetch_trade(id, *, language=None)

Fetches a trade with a matching ID or None if the trade was not found.

Parameters:
  • id (int) – The ID of the trade to search for from the API.

  • language (Language | None) – The language to fetch the trade in. None uses the current language.

Return type:

Optional[steam.trade.TradeOffer]

get_group(id)

Get a group from cache with a matching ID or None if the group was not found.

Parameters:

id (utils.Intable) – The ID of the group, can be an SteamID.id64, SteamID.id, SteamID.id2 or an SteamID.id3.

Return type:

Optional[steam.group.Group]

get_clan(id)

Get a clan from cache with a matching ID or None if the group was not found.

Parameters:

id (utils.Intable) – The ID of the clan, can be an SteamID.id64, SteamID.id, SteamID.id2 or an SteamID.id3.

Return type:

Optional[steam.clan.Clan]

await fetch_clan(id)

Fetches a clan from the websocket with a matching ID or None if the clan was not found.

Parameters:

id (utils.Intable) – The ID of the clan, can be an SteamID.id64, SteamID.id, SteamID.id2 or an SteamID.id3.

Return type:

Optional[steam.clan.Clan]

await fetch_clan_named(name)

Fetches a clan from https://steamcommunity.com with a matching name or None if the clan was not found.

Parameters:

name (str) – The name of the Steam clan.

Return type:

Optional[steam.clan.Clan]

get_game(id)

Creates a stateful game from its ID.

Parameters:

id (int | steam.game.Game) – The app id of the game or a Game instance.

Return type:

steam.game.StatefulGame

await fetch_game(id, *, language=None)

Fetch a game from its ID or None if the game was not found.

Parameters:
  • id (int | steam.game.Game) – The app id of the game or a Game instance.

  • language (Optional[Language]) – The language to fetch the game in. If None uses the current language.

Return type:

Optional[steam.game.FetchedGame]

get_package(id)

Creates a package from its ID.

Parameters:

id (int) – The ID of the package.

Return type:

steam.package.StatefulPackage

await fetch_package(id, *, language=None)

Fetch a package from its ID.

Parameters:
  • id (int) – The ID of the package.

  • language (Optional[Language]) – The language to fetch the package in. If None uses the current language.

Return type:

Optional[steam.package.FetchedPackage]

await fetch_server(*, id: utils.Intable) steam.game_server.GameServer | None
await fetch_server(*, ip: str, port: int | None = None) steam.game_server.GameServer | None

Fetch a GameServer from its ip and port or its SteamID or None if fetching the server failed.

Parameters:
  • ip – The ip of the server.

  • port – The port of the server.

  • id – The ID of the game server, can be an SteamID.id64, SteamID.id2 or an SteamID.id3. If this is passed, it makes a call to the master server to fetch its ip and port.

Note

Passing an ip, port and id to this function will raise an TypeError.

Return type:

Optional[steam.game_server.GameServer]

await fetch_servers(query, *, limit=100)

Query game servers.

Parameters:
  • query (Query[Any]) – The query to match servers with.

  • limit (int) – The maximum amount of servers to return.

Return type:

list[steam.game_server.GameServer]

await fetch_product_info(*, games: Collection[Game]) list[steam.manifest.GameInfo]
await fetch_product_info(*, packages: Collection[Package]) list[steam.manifest.PackageInfo]
await fetch_product_info(*, games: Collection[Game], packages: Collection[Package]) tuple[list[steam.manifest.GameInfo], list[steam.manifest.PackageInfo]]

Fetch product info.

Parameters:
  • games – The games to fetch info on.

  • packages – The packages to fetch info on.

Return type:

Union[list[steam.manifest.GameInfo], list[steam.manifest.PackageInfo], tuple[list[steam.manifest.GameInfo], list[steam.manifest.PackageInfo]]]

await fetch_published_file(id, *, revision=PublishedFileRevision.Default, language=None)

Fetch a published file from its ID.

Parameters:
  • id (int) – The ID of the published file.

  • revision (PublishedFileRevision) – The revision of the published file to fetch.

  • language (Optional[Language]) – The language to fetch the published file in. If None, the current language is used.

Return type:

Optional[steam.published_file.PublishedFile]

await fetch_published_files(*ids, revision=PublishedFileRevision.Default, language=None)

Fetch published files from their IDs.

Parameters:
  • ids (int) – The IDs of the published files.

  • revision (PublishedFileRevision) – The revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None, the current language is used.

Return type:

list[Optional[steam.published_file.PublishedFile]]

async for ... in trade_history(*, limit=100, before=None, after=None, language=None)

An AsyncIterator for accessing a steam.ClientUser’s steam.TradeOffer objects.

Examples

Usage:

async for trade in client.trade_history(limit=10):
    items = [getattr(item, "name", str(item.asset_id)) for item in trade.items_to_receive]
    items = ", ".join(items) or "Nothing"
    print("Partner:", trade.partner)
    print("Sent:", items)

Flattening into a list:

trades = await client.trade_history(limit=50).flatten()
# trades is now a list of TradeOffer

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of trades to search through. Default is 100. Setting this to None will fetch all of the user’s trades, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for trades before.

  • after (Optional[datetime]) – A time to search for trades after.

  • language (Optional[Language]) – The language to fetch the trade in. None uses the current language.

Yields:

TradeOffer

await change_presence(*, game=None, games=None, state=None, ui_mode=None, flags=None, force_kick=False)

Set your status.

Parameters:
  • game (Optional[Game]) – A games to set your status as.

  • games (Optional[list[steam.game.Game]]) – A list of games to set your status to.

  • state (Optional[PersonaState]) –

    The state to show your account as.

    Warning

    Setting your status to Offline, will stop you receiving persona state updates and by extension on_user_update() will stop being dispatched.

  • ui_mode (Optional[UIMode]) – The UI mode to set your status to.

  • flags (Optional[PersonaStateFlag]) – The flags to update your account with.

  • force_kick (bool) – Whether to forcefully kick any other playing sessions.

await trade_url(generate_new=False)

Fetches this account’s trade url.

Parameters:

generate_new (bool) – Whether or not to generate a new trade token, defaults to False.

Return type:

str

await wait_until_ready()

Waits until the client’s internal cache is all ready.

await fetch_price(name, game, currency=None)

Fetch the PriceOverview for an item.

Parameters:
  • name (str) – The name of the item.

  • game (Game) – The game the item is from.

  • currency (Optional[int]) – The currency to fetch the price in.

Return type:

steam.models.PriceOverview

await on_reaction_add(reaction)

Called when a reaction is added to a message.

Parameters:

reaction (MessageReaction) – The reaction that was added.

await on_reaction_remove(reaction)

Called when a reaction is removed from a message.

Parameters:

reaction (MessageReaction) – The reaction that was removed.

await wait_for(event: ~typing.Literal['connect', 'disconnect', 'ready', 'login', 'logout'], *, check: ~collections.abc.Callable[[], bool] = <return_true>, timeout: float | None = None) None
await wait_for(event: ~typing.Literal['error'], *, check: ~collections.abc.Callable[[str, Exception, tuple[typing.Any, ...], dict[str, typing.Any]], bool] = <return_true>, timeout: float | None = None) tuple[str, Exception, tuple[Any, ...], dict[str, Any]]
await wait_for(event: ~typing.Literal['message'], *, check: Callable[[Message], bool] = <return_true>, timeout: float | None = None) Message
await wait_for(event: ~typing.Literal['comment'], *, check: Callable[[Comment], bool] = <return_true>, timeout: float | None = None) Comment
await wait_for(event: ~typing.Literal['user_update'], *, check: Callable[[User, User], bool] = <return_true>, timeout: float | None = None) tuple[User, User]
await wait_for(event: ~typing.Literal['clan_update'], *, check: Callable[[Clan, Clan], bool] = <return_true>, timeout: float | None = None) tuple[Clan, Clan]
await wait_for(event: ~typing.Literal['group_update'], *, check: Callable[[Group, Group], bool] = <return_true>, timeout: float | None = None) tuple[Group, Group]
await wait_for(event: ~typing.Literal['typing'], *, check: Callable[[User, datetime.datetime], bool] = <return_true>, timeout: float | None = None) tuple[User, datetime.datetime]
await wait_for(event: ~typing.Literal['trade_receive', 'trade_send', 'trade_accept', 'trade_decline', 'trade_cancel', 'trade_expire', 'trade_counter'], *, check: Callable[[TradeOffer], bool] = <return_true>, timeout: float | None = None) TradeOffer
await wait_for(event: ~typing.Literal['user_invite', 'user_invite_accept', 'user_invite_decline'], *, check: Callable[[UserInvite], bool] = <return_true>, timeout: float | None = None) UserInvite
await wait_for(event: ~typing.Literal['friend_add', 'friend_remove'], *, check: Callable[[Friend], bool] = <return_true>, timeout: float | None = None) User
await wait_for(event: ~typing.Literal['clan_invite', 'clan_invite_accept', 'clan_invite_decline'], *, check: Callable[[ClanInvite], bool] = <return_true>, timeout: float | None = None) ClanInvite
await wait_for(event: ~typing.Literal['clan_join', 'clan_leave'], *, check: Callable[[Clan], bool] = <return_true>, timeout: float | None = None) Clan
await wait_for(event: ~typing.Literal['group_join', 'group_leave'], *, check: Callable[[Group], bool] = <return_true>, timeout: float | None = None) Group
await wait_for(event: ~typing.Literal['event_create'], *, check: Callable[[Event], bool] = <return_true>, timeout: float | None = None) Event
await wait_for(event: ~typing.Literal['announcement_create'], *, check: Callable[[Announcement], bool] = <return_true>, timeout: float | None = None) Announcement
await wait_for(event: ~typing.Literal['socket_receive', 'socket_send'], *, check: ~collections.abc.Callable[[ProtoMsgs | GCMsgs], bool] = <return_true>, timeout: float | None = None) Msgs

Wait for the first event to be dispatched that meets the requirements, this by default is the first event with a matching event name.

Parameters:
  • event – The event name from the event reference, but without the on_ prefix, to wait for.

  • check – A callable predicate that checks the received event. The arguments must match the parameters of the event being waited for and must return a bool.

  • timeout – By default, wait_for() function does not timeout, however, in the case a timeout parameter is passed after the amount of seconds passes asyncio.TimeoutError is raised.

Raises:

asyncio.TimeoutError – If the provided timeout was reached.

Returns:

Returns None, a single argument or a tuple of multiple arguments that mirrors the parameters for the event parameter from the event reference.

Return type:

Any

Event Reference

This page outlines the different types of events listened for by the Client.

There are two ways to register an event, the first way is through the use of Client.event(). The second way is through subclassing Client and overriding the specific events. For example:

import steam


class MyClient(steam.Client):
    async def on_trade_receive(self, trade: steam.TradeOffer) -> None:
        await trade.partner.send('Thank you for your trade')
        print(f'Received trade: #{trade.id}')
        print('Trade partner is:', trade.partner)
        print('We would send:', len(trade.items_to_send), 'items')
        print('We would receive:', len(trade.items_to_receive), 'items')

        if trade.is_gift():
            print('Accepting the trade as it is a gift')
            await trade.accept()

If an event handler raises an exception, Client.on_error() will be called to handle it, which by default prints a traceback and ignoring the exception.

Warning

All the events must be a coroutine function. If they aren’t, a TypeError will be raised.

await Client.on_connect()

Called when the client has successfully connected to Steam. This is not the same as the client being fully prepared, see on_ready() for that.

The warnings on on_ready() also apply.

await Client.on_disconnect()

Called when the client has disconnected from Steam. This could happen either through the internet disconnecting, an explicit call to logout, or Steam terminating the connection.

This function can be called multiple times.

await Client.on_ready()

Called after a successful login and the client has handled setting up everything.

Warning

This function is not guaranteed to be the first event called. Likewise, this function is not guaranteed to only be called once. This library implements reconnection logic and will therefore end up calling this event whenever a CM disconnects.

await Client.on_login()

Called when the client has logged into https://steamcommunity.com.

await Client.on_error(event, error, *args, **kwargs)

The default error handler provided by the client.

Usually when an event raises an uncaught exception, a traceback is printed to sys.stderr and the exception is ignored. If you want to change this behaviour and handle the exception yourself, this event can be overridden. Which, when done, will suppress the default action of printing the traceback.

If you want exception to propagate out of the Client class you can define an on_error handler consisting of a single empty The raise statement. Exceptions raised by on_error will not be handled in any way by Client.

Parameters:
  • event (str) – The name of the event that errored.

  • error (Exception) – The error that was raised.

  • args – The positional arguments associated with the event.

  • kwargs – The key-word arguments associated with the event.

Return type:

Any

await Client.on_message(message)

Called when a message is created.

Parameters:

message (steam.Message) – The message that was received.

await Client.on_typing(user, when)

Called when typing is started.

Parameters:
await Client.on_trade_receive(trade)

Called when the client receives a trade offer.

Parameters:

trade (steam.TradeOffer) – The trade offer that was received.

await Client.on_trade_send(trade)

Called when the client sends a trade offer.

Parameters:

trade (steam.TradeOffer) – The trade offer that was sent.

await Client.on_trade_accept(trade)

Called when the client or the trade partner accepts a trade offer.

Parameters:

trade (steam.TradeOffer) – The trade offer that was accepted.

await Client.on_trade_decline(trade)

Called when the client or the trade partner declines a trade offer.

Parameters:

trade (steam.TradeOffer) – The trade offer that was declined.

await Client.on_trade_cancel(trade)

Called when the client or the trade partner cancels a trade offer.

Note

This is called when the trade state becomes Canceled and CanceledBySecondaryFactor.

Parameters:

trade (steam.TradeOffer) – The trade offer that was cancelled.

await Client.on_trade_expire(trade)

Called when a trade offer expires due to being active for too long.

Parameters:

trade (steam.TradeOffer) – The trade offer that expired.

await Client.on_trade_counter(trade)

Called when the client or the trade partner counters a trade offer.

Parameters:

trade (steam.TradeOffer) – The trade offer that was countered.

await Client.on_comment(comment)

Called when the client receives a comment notification.

Parameters:

comment (steam.Comment) – The comment received.

await Client.on_user_invite(invite)

Called when the client receives/sends an invite from/to a User to become a friend.

Parameters:

invite (steam.UserInvite) – The invite received.

await Client.on_user_invite_accept(invite)

Called when the client/invitee accepts an invite from/to a User to become a friend.

Parameters:

invite (steam.UserInvite) – The invite that was accepted.

await Client.on_user_invite_decline(invite)

Called when the client/invitee declines an invite from/to a User to become a friend.

Parameters:

invite (steam.UserInvite) – The invite that was declined.

await Client.on_friend_add(friend)

Called when a friend is added to the client’s friends list.

Parameters:

friend (steam.Friend) – The friend that was added.

await Client.on_user_update(before, after)

Called when a user is updated, due to one or more of the following attributes changing:

Parameters:
  • before (steam.User) – The user’s state before it was updated.

  • after (steam.User) – The user’s state now.

await Client.on_friend_remove(friend)

Called when you or the friend remove each other from your friends lists.

Parameters:

friend (steam.Friend) – The friend who was removed.

await Client.on_clan_invite(invite)

Called when the client receives/sends an invite from/to a User to join a Clan.

Parameters:

invite (steam.ClanInvite) – The invite received.

await Client.on_clan_invite_accept(invite)

Called when the client/invitee accepts an invite to join a Clan.

Parameters:

invite (steam.ClanInvite) – The invite that was accepted.

await Client.on_clan_invite_decline(invite)

Called when the client/invitee declines an invite to join a Clan.

Parameters:

invite (steam.ClanInvite) – The invite that was declined.

await Client.on_clan_join(clan)

Called when the client joins a new clan.

Parameters:

clan (steam.Clan) – The joined clan.

await Client.on_clan_update(before, after)

Called when a clan is updated, due to one or more of the following attributes changing:

Parameters:
  • before (steam.Clan) – The clan’s state before it was updated.

  • after (steam.Clan) – The clan’s state now.

await Client.on_clan_leave(clan)

Called when the client leaves a clan.

Parameters:

clan (steam.Clan) – The left clan.

await Client.on_group_join(group)

Called when the client joins a new group.

Parameters:

group (steam.Group) – The joined group.

await Client.on_group_update(before, after)

Called when a group is updated.

Parameters:
  • before (steam.Group) – The group’s state before it was updated.

  • after (steam.Group) – The group’s state now.

await Client.on_group_leave(group)

Called when the client leaves a group.

Parameters:

group (steam.Group) – The left group.

await Client.on_event_create(event)

Called when an event in a clan is created.

Parameters:

event (steam.Event) – The event that was created.

await Client.on_announcement_create(announcement)

Called when an announcement in a clan is created.

Parameters:

announcement (steam.Announcement) – The announcement that was created.

await Client.on_socket_receive(msg)

Called when the connected CM parses a received Msg/MsgProto

Parameters:

msg (Msg | MsgProto) – The received message.

await Client.on_socket_send(msg)

Called when the client sends a Msg/MsgProto to the connected CM.

Parameters:

msg (Msg | MsgProto) – The sent message.

Utilities

steam.py provides some utility functions.

steam.utils.make_id64(id=0, type=None, universe=None, instance=None)

Convert various representations of Steam IDs to its Steam 64-bit ID.

Parameters:
  • id (Intable) – The ID to convert.

  • type (TypeType | None) – The type of the ID. Can be the name, the integer value of the type or the recommended way is to use steam.Type.

  • universe (UniverseType | None) – The universe of the ID. Can be the name, the integer value of the universe or the recommended way is to use steam.Universe.

  • instance (InstanceType | None) – The instance of the ID.

Examples

make_id64()  # invalid
make_id64(12345)
make_id64("12345")  # account ids
make_id64(12345, type=steam.Type.Clan)  # makes the clan id into a clan id64
make_id64(103582791429521412)
make_id64("103582791429521412")  # id64s
make_id64("STEAM_1:0:2")  # id2
make_id64("[g:1:4]")  # id3
Raises:

.InvalidSteamID – The created 64-bit Steam ID would be invalid.

Returns:

The 64 bit Steam ID.

Return type:

int

steam.utils.parse_trade_url(url)

Parses a trade URL for useful information.

Parameters:

url (StrOrURL) – The trade URL to search.

Returns:

A re.Match object with token and user_id re.Match.group() objects or None.

Return type:

Optional[Match[str]]

Then some functions from discord.py

steam.utils.get(iterable, **attrs)

A helper that returns the first element in the iterable that meets all the traits passed in attrs. This is an alternative for find().

Examples

bff = steam.utils.get(client.users, name="Gobot1234")
trade = steam.utils.get(client.trades, state=TradeOfferState.Active, partner=message.author)
# multiple attributes are also accepted
Parameters:
  • iterable (Iterable[_T]) – An iterable to search through.

  • attrs (Any) – Keyword arguments that denote attributes to match.

Returns:

The first element from the iterable which matches all the traits passed in attrs or None if no matching element was found.

Return type:

Optional[Any]

steam.utils.find(predicate, iterable)

A helper to return the first element found in the sequence.

Examples

first_active_offer = steam.utils.find(
    lambda trade: trade.state == TradeOfferState.Active,
    client.trades,
)
# how to get an object using a conditional
Parameters:
  • predicate (Callable[[_T], bool]) – A function that returns a boolean and takes an element from the iterable as its first argument.

  • iterable (Iterable[_T]) – The iterable to search through.

Returns:

The first element from the iterable for which the predicate returns True or if no matching element was found returns None.

Return type:

Optional[steam.reaction.PartialMessageReaction]

Enumerations

class steam.Result

An enumeration.

Invalid = 0

Invalid Result.

OK = 1

Success.

Fail = 2

Generic failure.

NoConnection = 3

Your Steam client doesn’t have a connection to the back-end.

InvalidPassword = 5

Password/ticket is invalid.

LoggedInElsewhere = 6

Same user logged in elsewhere.

InvalidProtocolVersion = 7

Protocol version is incorrect.

InvalidParameter = 8

A parameter is incorrect.

FileNotFound = 9

File was not found.

Busy = 10

Called method busy - action not taken.

InvalidState = 11

Called object was in an invalid state.

InvalidName = 12

The name was invalid.

InvalidEmail = 13

The email was invalid.

DuplicateName = 14

The name is not unique.

AccessDenied = 15

Access is denied.

Timeout = 16

Operation timed out.

Banned = 17

VAC2 banned.

AccountNotFound = 18

Account not found.

InvalidSteamID = 19

The Steam ID was invalid.

ServiceUnavailable = 20

The requested service is currently unavailable.

NotLoggedOn = 21

The user is not logged on.

Pending = 22

Request is pending (may be in process, or waiting on third party).

EncryptionFailure = 23

Encryption or decryption failed.

InsufficientPrivilege = 24

Insufficient privilege.

LimitExceeded = 25

Too much of a good thing.

Revoked = 26

Access has been revoked (used for revoked guest passes).

Expired = 27

License/Guest pass the user is trying to access is expired.

AlreadyRedeemed = 28

Guest pass has already been redeemed by account, cannot be acknowledged again.

DuplicateRequest = 29

The request is a duplicate, ignored this time.

AlreadyOwned = 30

All the games in guest pass redemption request are already owned by the user.

IPNotFound = 31

IP address not found.

PersistFailed = 32

Failed to write change to the data store.

LockingFailed = 33

Failed to acquire access lock for this operation.

LogonSessionReplaced = 34

The logon session has been replaced.

ConnectFailed = 35

Failed to connect.

HandshakeFailed = 36

The authentication handshake has failed.

IOFailure = 37

Generic IO failure.

RemoteDisconnect = 38

The remote server has disconnected.

ShoppingCartNotFound = 39

Failed to find the shopping cart requested.

Blocked = 40

A user blocked the action.

Ignored = 41

The target is ignoring sender.

NoMatch = 42

Nothing matching the request found.

AccountDisabled = 43

The account is disabled.

ServiceReadOnly = 44

This service is not accepting content changes right now.

AccountNotFeatured = 45

Account doesn’t have value, so this feature isn’t available.

AdministratorOK = 46

Allowed to take this action, but only because requester is admin.

ContentVersion = 47

A Version mismatch in content transmitted within the Steam protocol.

TryAnotherCM = 48

The current CM can’t service the user making a request, should try another.

PasswordRequiredToKickSession = 49

You are already logged in elsewhere, this cached credential login has failed.

AlreadyLoggedInElsewhere = 50

You are already logged in elsewhere, you must wait.

Suspended = 51

Long running operation (content download) suspended/paused.

Cancelled = 52

Operation canceled (typically by user content download).

DataCorruption = 53

Operation canceled because data is malformed or unrecoverable.

DiskFull = 54

Operation canceled - not enough disk space.

RemoteCallFailed = 55

An remote call or IPC call failed.

ExternalAccountUnlinked = 57

External account is not linked to a Steam account.

PSNTicketInvalid = 58

PSN ticket was invalid.

ExternalAccountAlreadyLinked = 59

External account is already linked to some other account.

RemoteFileConflict = 60

The sync cannot resume due to a conflict between the local and remote files.

IllegalPassword = 61

The requested new password is not legal.

SameAsPreviousValue = 62

New value is the same as the old one (secret question and answer).

AccountLogonDenied = 63

Account login denied due to 2nd factor authentication failure.

CannotUseOldPassword = 64

The requested new password is not legal.

InvalidLoginAuthCode = 65

Account login denied due to auth code invalid.

AccountLogonDeniedNoMail = 66

Account login denied due to 2nd factor authentication failure.

HardwareNotCapableOfIPT = 67

The user’s hardware does not support Intel’s identity protection technology.

IPTInitError = 68

Intel’s Identity Protection Technology has failed to initialize.

ParentalControlRestricted = 69

Operation failed due to parental control restrictions for current user.

FacebookQueryError = 70

Facebook query returned an error.

ExpiredLoginAuthCode = 71

Account login denied due to auth code expired.

IPLoginRestrictionFailed = 72

The login failed due to an IP restriction.

AccountLockedDown = 73

The current users account is currently locked for use.

VerifiedEmailRequired = 74

The logon failed because the accounts email is not verified.

NoMatchingURL = 75

There is no url matching the provided values.

BadResponse = 76

Parse failure, missing field, etc.

RequirePasswordReEntry = 77

The user cannot complete the action until they re-enter their password.

ValueOutOfRange = 78

The value entered is outside the acceptable range.

UnexpectedError = 79

Something happened that we didn’t expect to ever happen.

Disabled = 80

The requested service has been configured to be unavailable.

InvalidCEGSubmission = 81

The set of files submitted to the CEG server are not valid.

RestrictedDevice = 82

The device being used is not allowed to perform this action.

RegionLocked = 83

The action could not be complete because it is region restricted.

RateLimitExceeded = 84

Temporary rate limit exceeded. Different from LimitExceeded.

LoginDeniedNeedTwoFactor = 85

Need two-factor code to log in.

ItemDeleted = 86

The thing we’re trying to access has been deleted.

AccountLoginDeniedThrottle = 87

Login attempt failed, try to throttle response to possible attacker.

TwoFactorCodeMismatch = 88

Two-factor code mismatch.

TwoFactorActivationCodeMismatch = 89

Activation code for two-factor didn’t match.

NotModified = 91

Data not modified.

TimeNotSynced = 93

The time presented is out of range or tolerance.

SMSCodeFailed = 94

SMS code failure (no match, none pending, etc.).

AccountActivityLimitExceeded = 96

Too many changes to this account.

PhoneActivityLimitExceeded = 97

Too many changes to this phone.

RefundToWallet = 98

Cannot refund to payment method, must use wallet.

EmailSendFailure = 99

Cannot send an email.

NotSettled = 100

Can’t perform operation till payment has settled.

NeedCaptcha = 101

Needs to provide a valid captcha.

GSLTDenied = 102

A game server login token owned by this token’s owner has been banned.

GSOwnerDenied = 103

Game server owner is denied for other reason.

InvalidItemType = 104

The type of thing we were requested to act on is invalid.

IPBanned = 105

The IP address has been banned from taking this action.

GSLTExpired = 106

This Game Server Login Token has expired from disuse; can be reset for use.

InsufficientFunds = 107

User doesn’t have enough wallet funds to complete the action.

TooManyPending = 108

There are too many of this thing pending already.

NoSiteLicensesFound = 109

No site licenses found.

WGNetworkSendExceeded = 110

The WG couldn’t send a response because we exceeded max network send size.

AccountNotFriends = 111

Not friends with the relevant account.

LimitedUserAccount = 112

The account is limited and cannot perform this action.

CantRemoveItem = 113

Cannot remove the item.

AccountHasBeenDeleted = 114

The relevant account has been deleted.

AccountHasCancelledLicense = 115

The user has a user cancelled license.

DeniedDueToCommunityCooldown = 116

The request was denied due to community cooldown.

NoLauncherSpecified = 117

No launcher was specified.

MustAgreeToSSA = 118

User must agree to China SSA or global SSA before login.

LauncherMigrated = 119

The specified launcher type is no longer supported.

SteamRealmMismatch = 120

The user’s realm does not match the realm of the requested resource.

InvalidSignature = 121

Signature check did not match.

ParseFailure = 122

Failed to parse input.

NoVerifiedPhone = 123

Account does not have a verified phone number.

InsufficientBatteryCharge = 124

The device battery is too low to complete the action.

class steam.Language

An enumeration.

NONE = -1
English = 0
German = 1
French = 2
Italian = 3
Korean = 4
Spanish = 5
SimplifiedChinese = 6
TraditionalChinese = 7
Russian = 8
Thai = 9
Japanese = 10
Portuguese = 11
Polish = 12
Danish = 13
Dutch = 14
Finnish = 15
Norwegian = 16
Swedish = 17
Romanian = 18
Turkish = 19
Hungarian = 20
Czech = 21
PortugueseBrazil = 22
Bulgarian = 23
Greek = 24
Arabic = 25
Ukrainian = 26
SpanishLatinAmerican = 27
Vietnamese = 28
NATIVE_NAME_MAP = {Language.English: 'English', Language.German: 'Deutsch', Language.French: 'Français', Language.Italian: 'Italiano', Language.Korean: '한국어', Language.Spanish: 'Español-España', Language.SimplifiedChinese: '简体中文', Language.TraditionalChinese: '繁體中文', Language.Russian: 'Русский', Language.Thai: 'ไทย', Language.Japanese: '日本語', Language.Portuguese: 'Português', Language.Polish: 'Polski', Language.Danish: 'Dansk', Language.Dutch: 'Nederlands', Language.Finnish: 'Suomi', Language.Norwegian: 'Norsk', Language.Swedish: 'Svenska', Language.Romanian: 'Română', Language.Turkish: 'Türkçe', Language.Hungarian: 'Magyar', Language.Czech: 'čeština', Language.PortugueseBrazil: 'Português-Brasil', Language.Bulgarian: 'езбългарски езикик', Language.Greek: 'Ελληνικά', Language.Arabic: 'العربية', Language.Ukrainian: 'Українська', Language.SpanishLatinAmerican: 'Español-Latinoamérica', Language.Vietnamese: 'Tiếng Việt'}
API_LANGUAGE_MAP = {Language.English: 'english', Language.German: 'german', Language.French: 'french', Language.Italian: 'italian', Language.Korean: 'koreana', Language.Spanish: 'spanish', Language.SimplifiedChinese: 'schinese', Language.TraditionalChinese: 'tchinese', Language.Russian: 'russian', Language.Thai: 'thai', Language.Japanese: 'japanese', Language.Portuguese: 'portuguese', Language.Polish: 'polish', Language.Danish: 'danish', Language.Dutch: 'dutch', Language.Finnish: 'finnish', Language.Norwegian: 'norwegian', Language.Swedish: 'swedish', Language.Romanian: 'romanian', Language.Turkish: 'turkish', Language.Hungarian: 'hungarian', Language.Czech: 'czech', Language.PortugueseBrazil: 'brazilian', Language.Bulgarian: 'bulgarian', Language.Greek: 'greek', Language.Arabic: 'arabic', Language.Ukrainian: 'ukrainian', Language.SpanishLatinAmerican: 'latam', Language.Vietnamese: 'vietnamese'}
WEB_API_MAP = {Language.English: 'en', Language.German: 'de', Language.French: 'fr', Language.Italian: 'it', Language.Korean: 'ko', Language.Spanish: 'es', Language.SimplifiedChinese: 'zh-CN', Language.TraditionalChinese: 'zh-TW', Language.Russian: 'ru', Language.Thai: 'th', Language.Japanese: 'ja', Language.Portuguese: 'pt', Language.Polish: 'pl', Language.Danish: 'da', Language.Dutch: 'nl', Language.Finnish: 'fi', Language.Norwegian: 'no', Language.Swedish: 'sv', Language.Romanian: 'ro', Language.Turkish: 'tr', Language.Hungarian: 'hu', Language.Czech: 'cs', Language.PortugueseBrazil: 'pt-BR', Language.Bulgarian: 'bg', Language.Greek: 'el', Language.Arabic: 'ar', Language.Ukrainian: 'uk', Language.SpanishLatinAmerican: 'es-419', Language.Vietnamese: 'vn'}
property native_name: str

This language’s native name.

property api_name: str

This language’s Steamworks name.

property web_api_name: str

This language’s Web API name.

classmethod from_str(string)
Return type:

Self

class steam.Universe

An enumeration.

Invalid = 0

Invalid.

Public = 1

The standard public universe.

Beta = 2

Beta universe used inside Valve.

Internal = 3

Internal universe used inside Valve.

Dev = 4

Dev universe used inside Valve.

Max = 6

Total number of universes, used for sanity checks.

class steam.Type

An enumeration.

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

Valve internal content server account.

Clan = 7

Steam 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

Max of 16 items in this field

class steam.TypeChar

An enumeration.

I = 0

The character used for Invalid.

U = 1

The character used for Individual.

M = 2

The character used for Multiseat.

G = 3

The character used for GameServer.

A = 4

The character used for AnonGameServer.

P = 5

The character used for Pending.

C = 6

The character used for ContentServer.

g = 7

The character used for Clan.

T = 8

The character used for Chat (Lobby/group chat).

L = 8

The character used for Chat (Lobby/group chat).

c = 7

The character used for Clan.

a = 10

The character used for AnonUser.

class steam.InstanceFlag

An enumeration.

All = 0

The Instance for all Steam IDs

Desktop = 1

The Instance for desktop Steam IDs

Console = 2

The Instance for console Steam IDs

Web = 4

The Instance for web Steam IDs

Unknown1 = 8
Unknown2 = 16
Unknown3 = 32
Unknown4 = 64
Unknown5 = 128
Unknown6 = 256
Unknown7 = 512
Unknown8 = 1024
Unknown9 = 2048
Unknown10 = 4096
Unknown11 = 8192
Unknown12 = 16384
ChatMMSLobby = 131072

The Steam ID is for an MMS Lobby.

ChatLobby = 262144

The Steam ID is for a Lobby.

ChatClan = 524288

The Steam ID is for a Clan.

class steam.FriendRelationship

An enumeration.

NONE = 0

The user has no relationship to you.

Blocked = 1

The user has been blocked.

RequestRecipient = 2

The user has requested to be friends with you.

Friend = 3

The user is friends with you.

RequestInitiator = 4

You have requested to be friends with the user.

Ignored = 5

You have explicitly blocked this other user from comments/chat/etc.

IgnoredFriend = 6

The user has ignored the current user.

Max = 8

The total number of friend relationships used for looping and verification.

class steam.PersonaState

An enumeration.

Offline = 0

The user is not currently logged on.

Online = 1

The user is logged on.

Busy = 2

The user is on, but busy.

Away = 3

The user has been marked as AFK for a short period of time.

Snooze = 4

The user has been marked as AFK for a long period of time.

LookingToTrade = 5

The user is online and wanting to trade.

LookingToPlay = 6

The user is online and wanting to play.

Invisible = 7

The user is invisible.

Max = 8

The total number of states. Only used for looping and validation.

class steam.PersonaStateFlag

An enumeration.

NONE = 0
HasRichPresence = 1
InJoinableGame = 2
Golden = 4
RemotePlayTogether = 8
ClientTypeWeb = 16
ClientTypeMobile = 256
ClientTypeTenfoot = 1024
ClientTypeVR = 2048
LaunchTypeGamepad = 4096
LaunchTypeCompatTool = 8192
class steam.CommunityVisibilityState

An enumeration.

NONE = 0

The user has no community state.

Private = 1

The user has a private profile.

FriendsOnly = 2

The user has a friends only profile.

Public = 3

The user has a public profile.

class steam.TradeOfferState

An enumeration.

Invalid = 1

The trade offer’s state is invalid.

Active = 2

The trade offer is active.

Accepted = 3

The trade offer has been accepted.

Countered = 4

The trade offer has been countered.

Expired = 5

The trade offer has expired.

Canceled = 6

The trade offer has been cancelled.

Declined = 7

The trade offer has be declined by the partner.

InvalidItems = 8

The trade offer has invalid items and has been cancelled.

ConfirmationNeed = 9

The trade offer needs confirmation.

CanceledBySecondaryFactor = 10

The trade offer was cancelled by second factor.

StateInEscrow = 11

The trade offer is in escrow.

property event_name: str | None
class steam.ChatEntryType

An enumeration.

Invalid = 0

An Invalid Chat entry.

Text = 1

A Normal text message from another user.

Typing = 2

Another user is typing (not used in multi-user chat).

InviteGame = 3

An Invite from other user into that users current game.

LeftConversation = 6

A user has left the conversation.

Entered = 7

A user has entered the conversation (used in multi-user chat and group chat).

WasKicked = 8

A user was kicked.

WasBanned = 9

A user was banned.

Disconnected = 10

A user disconnected.

HistoricalChat = 11

A chat message from user’s chat history or offline message.

LinkBlocked = 14

A link was removed by the chat filter.

class steam.UIMode

An enumeration.

Desktop = 0

The UI mode for the desktop client.

BigPicture = 1

The UI mode for big picture mode.

Mobile = 2

The UI mode for mobile.

Web = 3

The UI mode for the web client.

class steam.UserBadge

An enumeration.

Invalid = 0

Invalid Badge.

YearsOfService = 1

The years of service badge.

Community = 2

The pillar of the community badge.

Portal2PotatoARG = 3

The portal to potato badge.

TreasureHunt = 4

The treasure hunter badge.

SummerSale2011 = 5

The Summer sale badge for 2011.

WinterSale2011 = 6

The Winter sale badge for 2011.

SummerSale2012 = 7

The Summer sale badge for 2012.

WinterSale2012 = 8

The Winter sale badge for 2012.

CommunityTranslator = 9

The community translator badge.

CommunityModerator = 10

The community moderator badge.

ValveEmployee = 11

The Valve employee badge.

GameDeveloper = 12

The game developer badge.

GameCollector = 13

The game collector badge.

TradingCardBetaParticipant = 14

The trading card beta participant badge.

SteamBoxBeta = 15

The Steam box beta badge.

Summer2014RedTeam = 16

The Summer sale badge for 2014 for the red team.

Summer2014BlueTeam = 17

The Summer sale badge for 2014 for the blue team.

Summer2014PinkTeam = 18

The Summer sale badge for 2014 for the pink team.

Summer2014GreenTeam = 19

The Summer sale badge for 2014 for the green team.

Summer2014PurpleTeam = 20

The Summer sale badge for 2014 for the purple team.

Auction2014 = 21

The auction badge for 2014.

GoldenProfile2014 = 22

The golden profile for 2014.

TowerAttackMiniGame = 23

The tower attack mini-game badge.

Winter2015ARGRedHerring = 24

The Winter ARG red herring badge for 2015.

SteamAwards2016Nominations = 25

The Steam Awards Nominations badge for 2016.

StickerCompletionist2017 = 26

The sticker completionist badge for 2017.

SteamAwards2017Nominations = 27

The Steam Awards Nominations badge for 2017.

SpringCleaning2018 = 28

The Spring cleaning badge for 2018.

Salien = 29

The Salien badge.

RetiredModerator = 30

The retired moderator badge.

SteamAwards2018Nominations = 31

The Steam Awards Nominations badge for 2018.

ValveModerator = 32

The Valve moderator badge.

WinterSale2018 = 33

The Winter sale badge for 2018.

LunarNewYearSale2019 = 34

The lunar new years sale badge for 2019.

LunarNewYearSale2019GoldenProfile = 35

The lunar new year golden profile sale badge for 2019.

SpringCleaning2019 = 36

The Spring cleaning badge for 2019.

Summer2019 = 37

The Summer sale badge for 2019.

Summer2019TeamHare = 38

The Summer sale badge for 2014 for team hare.

Summer2019TeamTortoise = 39

The Summer sale badge for 2014 for team tortoise.

Summer2019TeamCorgi = 40

The Summer sale badge for 2014 for team corgi.

Summer2019TeamCockatiel = 41

The Summer sale badge for 2014 for team cockatiel.

Summer2019TeamPig = 42

The Summer sale badge for 2014 for team pig.

SteamAwards2019Nominations = 43

The Steam Awards Nominations badge for 2019.

WinterSaleEvent2019 = 44

The Winter sale badge for 2019.

WinterSale2019Steamville = 45

The Winter sale Steamville badge for 2019.

LunarNewYearSale2020 = 46

The lunar new years sale badge for 2020.

SpringCleaning2020 = 47

The Spring cleaning badge for 2020.

AwardsCommunityContributor = 48

The Steam Awards Community Contributor badge.

AwardsCommunityPatron = 49

The Steam Awards Community Patron badge.

SteamAwards2020Nominations = 50

The Steam Awards Nominations badge for 2020.

class steam.ReviewType

An enumeration.

NONE = 0

No reviews.

OverwhelminglyNegative = 1

0 - 19% positive reviews and few of them.

VeryNegative = 2

0 - 19% positive reviews.

Negative = 3

0 - 39% positive reviews.

MostlyNegative = 4

20 - 39% positive reviews but few of them.

Mixed = 5

40 - 69% positive reviews.

MostlyPositive = 6

70 - 79% positive reviews.

Positive = 7

80 - 100% positive reviews but few of them.

VeryPositive = 8

94 - 80% positive reviews.

OverwhelminglyPositive = 9

95 - 100% positive reviews.

class steam.GameServerRegion

An enumeration.

NONE = -1

No set game region.

USEastCoast = 0

A server on the USA’s East Coast.

USWestCoast = 1

A server on the USA’s West Coast.

SouthAmerica = 2

A server in South America.

Europe = 3

A server in Europe.

Asia = 4

A server in Asia.

Australia = 5

A server in Australia.

MiddleEast = 6

A server in the Middle East.

Africa = 7

A server in Africa.

World = 255

A server somewhere in the world.

class steam.EventType

An enumeration.

Other = 1

An unspecified event.

Game = 2

A game event.

Party = 3

A party event.

Meeting = 4

An important meeting.

SpecialCause = 5

An event for a special cause.

MusicAndArts = 6

A music or art event.

Sports = 7

A sporting event.

Trip = 8

A clan trip.

Chat = 9

A chat event.

GameRelease = 10

A game release event.

Broadcast = 11

A broadcast event.

SmallUpdate = 12

A small update event.

PreAnnounceMajorUpdate = 13

A pre-announcement for a major update event.

MajorUpdate = 14

A major update event.

DLCRelease = 15

A dlc release event.

FutureRelease = 16

A future release event.

ESportTournamentStream = 17

An e-sport tournament stream event.

DevStream = 18

A developer stream event.

FamousStream = 19

A famous stream event.

GameSales = 20

A game sales event.

GameItemSales = 21

A game item sales event.

InGameBonusXP = 22

An in game bonus xp event.

InGameLoot = 23

An in game loot event.

InGamePerks = 24

An in game perks event.

InGameChallenge = 25

An in game challenge event.

InGameContest = 26

An in game contest event.

IRL = 27

An in real life event.

News = 28

A news event.

BetaRelease = 29

A beta release event.

InGameContentRelease = 30

An in game content release event.

FreeTrial = 31

A free trial event.

SeasonRelease = 32

A season release event.

SeasonUpdate = 33

A season update event.

Crosspost = 34

A cross post event.

InGameGeneral = 35

An in game general event.

class steam.ProfileItemType

An enumeration.

Invalid = 0

An invalid item type.

RareAchievementShowcase = 1

A rare achievements showcase.

GameCollector = 2

A game collector section.

ItemShowcase = 3

An item showcase.

TradeShowcase = 4

A trade info showcase.

Badges = 5

A badges showcase.

FavouriteGame = 6

A favourite game section.

ScreenshotShowcase = 7

A screenshot showcase.

CustomText = 8

A custom text section.

FavouriteGroup = 9

A favourite game showcase.

Recommendation = 10

A review showcase.

WorkshopItem = 11

A workshop item showcase.

MyWorkshop = 12

A showcase of a workshop item made by profile’s owner.

ArtworkShowcase = 13

An artwork showcase.

VideoShowcase = 14

A video showcase.

Guides = 15

A guide showcase.

MyGuides = 16

A showcase of the profile’s owner’s guides.

Achievements = 17

The owner’s profile’s achievements.

Greenlight = 18

A greenlight showcase.

MyGreenlight = 19

A showcase of a greenlight game the profiles’ owner has made.

Salien = 20

A salien showcase.

LoyaltyRewardReactions = 21

A loyalty reward showcase.

SingleArtworkShowcase = 22

A single artwork showcase.

AchievementsCompletionist = 23

An achievements completeionist showcase.

class steam.DepotFileFlag

An enumeration.

File = 0
UserConfig = 1
VersionedUserConfig = 2
Encrypted = 4
ReadOnly = 8
Hidden = 16
Executable = 32
Directory = 64
CustomExecutable = 128
InstallScript = 256
class steam.AppFlag

An enumeration.

Game = 1
Application = 2
Tool = 4
Demo = 8
Deprecated = 16
DLC = 32
Guide = 64
Driver = 128
Config = 256
Hardware = 512
Franchise = 1024
Video = 2048
Plugin = 4096
Music = 8192
Series = 16384
Comic = 32768
Beta = 65536
Shortcut = 1073741824
DepotOnly = -2147483648
classmethod from_str(name)
Return type:

Self

class steam.LicenseFlag

An enumeration.

NONE = 0
Renew = 1
RenewalFailed = 2
Pending = 4
Expired = 8
CancelledByUser = 16
CancelledByAdmin = 32
LowViolenceContent = 64
ImportedFromSteam2 = 128
ForceRunRestriction = 256
RegionRestrictionExpired = 512
CancelledByFriendlyFraudLock = 1024
NotActivated = 2048
class steam.LicenseType

An enumeration.

NoLicense = 0
SinglePurchase = 1
SinglePurchaseLimitedUse = 2
RecurringCharge = 3
RecurringChargeLimitedUse = 4
RecurringChargeLimitedUseWithOverages = 5
RecurringOption = 6
LimitedUseDelayedActivation = 7
class steam.BillingType

An enumeration.

NoCost = 0
BillOnceOnly = 1
BillMonthly = 2
ProofOfPrepurchaseOnly = 3
GuestPass = 4
HardwarePromo = 5
Gift = 6
AutoGrant = 7
OEMTicket = 8
RecurringOption = 9
BillOnceOrCDKey = 10
Repurchaseable = 11
FreeOnDemand = 12
Rental = 13
CommercialLicense = 14
FreeCommercialLicense = 15
NumBillingTypes = 16
class steam.PaymentMethod

An enumeration.

NONE = 0
ActivationCode = 1
CreditCard = 2
Giropay = 3
PayPal = 4
Ideal = 5
PaySafeCard = 6
Sofort = 7
GuestPass = 8
WebMoney = 9
MoneyBookers = 10
AliPay = 11
Yandex = 12
Kiosk = 13
Qiwi = 14
GameStop = 15
HardwarePromo = 16
MoPay = 17
BoletoBancario = 18
BoaCompraGold = 19
BancoDoBrasilOnline = 20
ItauOnline = 21
BradescoOnline = 22
Pagseguro = 23
VisaBrazil = 24
AmexBrazil = 25
Aura = 26
Hipercard = 27
MastercardBrazil = 28
DinersCardBrazil = 29
AuthorizedDevice = 30
MOLPoints = 31
ClickAndBuy = 32
Beeline = 33
Konbini = 34
EClubPoints = 35
CreditCardJapan = 36
BankTransferJapan = 37
PayEasy = 38
Zong = 39
CultureVoucher = 40
BookVoucher = 41
HappymoneyVoucher = 42
ConvenientStoreVoucher = 43
GameVoucher = 44
Multibanco = 45
Payshop = 46
MaestroBoaCompra = 47
OXXO = 48
ToditoCash = 49
Carnet = 50
SPEI = 51
ThreePay = 52
IsBank = 53
Garanti = 54
Akbank = 55
YapiKredi = 56
Halkbank = 57
BankAsya = 58
Finansbank = 59
DenizBank = 60
PTT = 61
CashU = 62
AutoGrant = 64
WebMoneyJapan = 65
OneCard = 66
PSE = 67
Exito = 68
Efecty = 69
Paloto = 70
PinValidda = 71
MangirKart = 72
BancoCreditoDePeru = 73
BBVAContinental = 74
SafetyPay = 75
PagoEfectivo = 76
Trustly = 77
UnionPay = 78
BitCoin = 79
Wallet = 128
Valve = 129
MasterComp = 130
Promotional = 131
MasterSubscription = 134
Payco = 135
MobileWalletJapan = 136
OEMTicket = 256
Split = 512
Complimentary = 1024
class steam.PackageStatus

An enumeration.

Available = 0
Preorder = 1
Unavailable = 2
Invalid = 3
class steam.PublishedFileRevision

An enumeration.

Default = 0
Latest = 1
ApprovedSnapshot = 2
ApprovedSnapshotChina = 3
RejectedSnapshot = 4
RejectedSnapshotChina = 5

Guard

steam.guard.generate_one_time_code(shared_secret, timestamp=None)

Generate a Steam Guard code for signing in or at a specific time.

Parameters:
  • shared_secret (str) – Shared secret from steam guard.

  • timestamp (Optional[int]) – The unix timestamp to generate the key for.

Return type:

str

steam.guard.generate_confirmation_code(identity_secret, tag, timestamp=None)

Generate a trade confirmation code.

Parameters:
  • identity_secret (str) – Identity secret from steam guard.

  • tag (str) – Tag to encode to.

  • timestamp (Optional[int]) – The time to generate the key for.

Return type:

str

steam.guard.generate_device_id(user_id64)

Generate the device id for a user’s 64-bit ID.

Parameters:

user_id64 (Intable) – The 64 bit steam id to generate the device id for.

Return type:

str

Async Iterators

An async iterator is a class that is capable of being used with the syntax async for.

They can be used as follows:

async for trade in client.trade_history():
    ...  # do stuff with trade here
class steam.iterators.AsyncIterator

A class from which async iterators (see PEP 525) can ben easily derived.

async for y in x

Iterates over the contents of the async iterator.

before

When to find objects before.

Type:

datetime.datetime

after

When to find objects after.

Type:

datetime.datetime

limit

The maximum number of elements to be yielded.

Type:

Optional[int]

await get(**attrs)

A helper function which is similar to get() except it runs over the async iterator.

This is roughly equivalent to:

elements = await async_iterator.flatten()
element = steam.utils.get(elements, name="Item")

Example

Getting the last comment from a user named ‘Dave’ or None:

comment = await user.comments().get(author__name="Dave")
Parameters:

attrs (Any) – Keyword arguments that denote attributes to match.

Returns:

The first element from the iterable which matches all the traits passed in attrs or None if no matching element was found.

Return type:

Optional[steam.iterators.T]

await find(predicate)

A helper function which is similar to find() except it runs over the async iterator. However, unlike find(), the predicate provided can be a coroutine.

This is roughly equivalent to:

elements = await async_iterator.flatten()
element = steam.utils.find(elements, lambda e: e.name == "Item")

Example

Getting the last trade with a message or None:

def predicate(trade: steam.TradeOffer) -> bool:
    return trade.message is not None

trade = await client.trade_history().find(predicate)
Parameters:

predicate (MaybeCoro[T]) – A callable/coroutine that returns a boolean.

Returns:

The first element from the iterator for which the predicate returns True or None if no matching element was found.

Return type:

Optional[steam.iterators.T]

await flatten()

A helper function that iterates over the AsyncIterator returning a list of all the elements in the iterator.

This is equivalent to:

elements = [element async for element in async_iterator]
Return type:

list[steam.iterators.T]

filter(predicate)

Filter members of the async iterator according to a predicate. This function acts similarly to filter().

Examples

for dave in async_iterator.filter(lambda x: x.name == "Dave"):
    ...  # the element now has to have a name of Dave.
Parameters:

predicate (Callable[[T], bool]) – The predicate to filter elements through.

Return type:

steam.iterators.FilteredIterator[steam.iterators.T]

map(func)

Map the elements of the async iterator through a function. This function acts similarly to map().

Examples

for name in async_iterator.map(lambda x: x.name):
    ...  # name is now the iterators element's name.
Parameters:

func (Callable[[TT], Any]) – The function to map the elements through.

Return type:

steam.iterators.MappedIterator[steam.iterators.T, steam.iterators.TT]

await next()

Advances the iterator by one, if possible.

Raises:

StopAsyncIteration – There are no more elements in the iterator.

Return type:

steam.iterators.T

Abstract Base Classes

An abstract base class (also known as an abc) is a class that models can inherit their behaviour from.

class steam.abc.BaseUser

An ABC that details the common operations on a Steam user. The following classes implement this ABC:

x == y

Checks if two users are equal.

str(x)

Returns the user’s name.

name

The user’s username.

Type:

str

state

The current persona state of the account (e.g. LookingToTrade).

Type:

Optional[steam.enums.PersonaState]

game

The Game instance attached to the user. Is None if the user isn’t in a game or one that is recognised by the api.

Type:

Optional[steam.game.StatefulGame]

primary_clan

The primary clan the User displays on their profile.

Note

This can be lazily awaited to get more attributes of the clan.

Type:

Optional[steam.clan.Clan]

avatar_url

The avatar url of the user. Uses the large (184x184 px) image url.

Type:

Optional[str]

real_name

The user’s real name defined by them. Could be None.

Type:

Optional[str]

created_at

The time at which the user’s account was created. Could be None.

Type:

Optional[datetime.datetime]

last_logoff

The last time the user logged into steam. Could be None (e.g. if they are currently online).

Type:

Optional[datetime.datetime]

country

The country code of the account. Could be None.

Type:

Optional[str]

flags

The persona state flags of the account.

Type:

Optional[steam.enums.PersonaStateFlag]

rich_presence

The user’s rich presence.

Type:

Optional[dict[str, str]]

property mention: str

The string used to mention the user in chat.

await inventory(game, *, language=None)

Fetch a user’s Inventory for trading.

Parameters:
  • game (Game) – The game to fetch the inventory for.

  • language (Optional[Language]) – The language to fetch the inventory in. If None will default to the current language.

Raises:

Forbidden – The user’s inventory is private.

Return type:

steam.trade.BaseInventory[steam.trade.Item]

await friends()

Fetch the list of the users friends.

Return type:

list[steam.user.User]

await games(*, include_free=True)

Fetches the Games the user owns.

Parameters:

include_free (bool) – Whether to include free games in the list. Defaults to True.

Return type:

list[steam.game.UserGame]

await clans()

Fetches a list of Clans the user is in.

Return type:

list[steam.clan.Clan]

await bans()

Fetches the user’s Bans.

Return type:

steam.models.Ban

await badges()

Fetches the user’s UserBadgess.

Return type:

steam.badge.UserBadges

await level()

Fetches the user’s level if your account is premium, otherwise it’s cached.

Return type:

int

await wishlist()

Get the WishlistGames the user has on their wishlist.

Return type:

list[steam.game.WishlistGame]

await favourite_badge()

The user’s favourite badge.

Return type:

Optional[steam.badge.FavouriteBadge]

await equipped_profile_items(*, language=None)

The user’s equipped profile items.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.profile.EquippedProfileItems

await profile_customisation_info(*, language=None)

Fetch a user’s profile customisation information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.profile.ProfileCustomisation

await profile(*, language=None)

Fetch a user’s entire profile information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Note

This calls all the profile related functions to return a Profile object which has all the info set.

Return type:

steam.profile.Profile

is_commentable()

Specifies if the user’s account can be commented on.

Return type:

bool

is_private()

Specifies if the user has a private profile.

Return type:

bool

await is_banned()

Specifies if the user is banned from any part of Steam.

Shorthand for:

bans = await user.bans()
bans.is_banned()
Return type:

bool

async for ... in reviews(*, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s Reviews.

Examples

Usage:

async for review in user.reviews(limit=10):
    print(f"Author: {review.author} {'recommended' if review.recommend 'doesn\'t recommend'} {review.game}")

Flattening into a list:

reviews = await user.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Setting this to None will fetch all the user’s reviews.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

await fetch_review(game)

Fetch this user’s review for a game.

Parameters:

game (Game) – The games to fetch the reviews for.

Return type:

steam.review.Review

await fetch_reviews(*games)

Fetch this user’s review for games.

Parameters:

games (Game) – The games to fetch the reviews for.

Return type:

list[steam.review.Review]

async for ... in published_files(*, game=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s PublishedFiles.

Examples

Usage:

async for file in user.published_files(limit=10):
    print("Author:", file.author, "Published:", file.name)

Flattening into a list:

files = await user.published_files(limit=50).flatten()
# files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • game (Optional[Game]) – The game to fetch published files in.

  • type (PublishedFileType) – The type of published file to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published file to fetch.

  • language (Optional[Language]) – The language to fetch the published file in. If None, the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Setting this to None will fetch all of the user’s published files.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.comment.Comment

comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (int | None) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (datetime | None) – A time to search for comments before.

  • after (datetime | None) – A time to search for comments after.

Yields:

Comment

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.comment.Comment

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

is_valid()

Whether the SteamID is valid.

Return type:

bool

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

Methods
class steam.abc.Channel
abstractmethod history(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a channel’s steam.Messages.

Examples

Usage:

async for message in channel.history(limit=10):
    print("Author:", message.author, "Said:", message.content)

Flattening into a list:

messages = await channel.history(limit=50).flatten()
# messages is now a list of Message

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of messages to search through. Setting this to None will fetch all of the channel’s messages, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for messages before.

  • after (Optional[datetime]) – A time to search for messages after.

Yields:

Message

await send(content=None, image=None)

Send a message to a certain destination.

Parameters:
  • content (Any) – The content of the message to send.

  • image (Image | None) – The image to send to the user.

Note

Anything as passed to content is implicitly cast to a str.

Raises:
Returns:

The sent message, only applicable if content is passed.

Return type:

Optional[steam.abc.M_co]

Methods
class steam.abc.Messageable

An ABC that details the common operations on a Steam message. The following classes implement this ABC:

await send(content=None, image=None)

Send a message to a certain destination.

Parameters:
  • content (Optional[Any]) – The content of the message to send.

  • image (Optional[Image]) – The image to send to the user.

Note

Anything as passed to content is implicitly cast to a str.

Raises:
Returns:

The sent message, only applicable if content is passed.

Return type:

Optional[steam.abc.M_co]

Steam Models

steam.py provides wrappers around common Steam API objects. These are not meant to be constructed by the user instead you receive them from methods/events.

Announcements

class steam.Announcement(state, clan, data)

Represents an announcement in a clan.

id

The announcement’s ID.

Type:

int

author

The announcement’s author.

Type:

Optional[Union[steam.user.User, steam.abc.SteamID]]

name

The announcement’s name.

Type:

str

content

The announcement’s content.

Type:

str

game

The game that the announcement is for.

Type:

Optional[steam.game.StatefulGame]

clan

The announcement’s clan.

Type:

steam.clan.Clan

starts_at

The announcement’s start time.

Type:

datetime.datetime

becomes_visible

The time at which the announcement becomes visible.

Type:

Optional[datetime.datetime]

stops_being_visible

The time at which the announcement stops being visible.

Type:

Optional[datetime.datetime]

ends_at

The time at which the announcement ends.

Type:

Optional[datetime.datetime]

type

The announcement’s type.

Type:

steam.event.ClanEventT

last_edited_at

The time the announcement was last edited at.

Type:

Optional[datetime.datetime]

last_edited_by

The user who made the announcement last edited.

Type:

Optional[Union[steam.user.User, steam.abc.SteamID]]

hidden

Whether the announcement is currently hidden.

Type:

bool

published

Whether the announcement is currently published.

Type:

bool

upvotes

The number of up votes on the announcement.

Type:

int

downvotes

The number of down votes on the announcement.

Type:

int

comment_count

The number of comments on the announcement.

Type:

int

topic_id

The id of the forum post comments are sent to.

Type:

Optional[int]

created_at

The time at which the announcement was created at.

Type:

datetime.datetime

updated_at

The time at which the announcement was last updated_at.

Type:

datetime.datetime

approved_at

The time at which the announcement was approved by a moderator.

Type:

Optional[datetime.datetime]

tags

The announcement’s tags.

Type:

Sequence[str]

await edit(name=None, content=None)

Edit the announcement’s details.

Note

If parameters are omitted they use what they are currently set to.

Parameters:
  • name (Optional[str]) – The announcement’s name.

  • content (Optional[str]) – The announcement’s content.

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.comment.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

await delete()

Delete this announcement.

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.comment.Comment

await upvote()

Upvote this announcement.

await downvote()

Downvote this announcement.

Badge

class steam.Badge

Represents a Steam badge.

id

The badge’s ID.

Type:

int

level

The badge’s level.

Type:

int

game

The game associated with the badge.

Type:

Optional[steam.game.StatefulGame]

xp

The badge’s XP.

Type:

int

completion_time

The time the badge was completed at.

Type:

datetime.datetime

scarcity

The scarcity of the badge.

Type:

int

class steam.UserBadges

Represents a Steam User’s badges/level.

level

The badge’s level.

Type:

int

xp

The badge’s XP.

Type:

int

xp_needed_to_level_up

The amount of XP the user needs to level up.

Type:

int

xp_needed_for_current_level

The amount of XP the user’s current level requires to achieve.

Type:

int

badges

A list of the user’s badges.

Type:

Sequence[steam.Badge]

class steam.FavouriteBadge

Represents a User’s favourite badge.

id

The badge’s ID.

Type:

int

level

The badge’s level.

Type:

int

game

The game associated with the badge.

Type:

Optional[steam.game.StatefulGame]

item_id

The badge’s item’s ID.

Type:

int

type

The badge’s type.

Type:

int

border_colour

The colour of the boarder of the badge.

Type:

int

Ban

class steam.Ban

Represents a Steam ban.

since_last_ban

How many days since the user was last banned

Type:

datetime.timedelta

number_of_game_bans

The number of game bans the user has.

Type:

int

is_banned()

Species if the user is banned from any part of Steam.

Return type:

bool

is_vac_banned()

Whether or not the user is VAC banned.

Return type:

bool

is_community_banned()

Whether or not the user is community banned.

Return type:

bool

is_market_banned()

Whether or not the user is market banned.

Return type:

bool

Channel

Attributes
Methods
class steam.DMChannel

Represents the channel a DM is sent in.

participant

The recipient of any messages sent.

Type:

steam.user.User

async with typing()

Send a typing indicator continuously to the channel while in the context manager.

Note

This only works in DMs.

Usage:

async with channel.typing():
    ...  # do your expensive operations
Return type:

contextlib._AsyncGeneratorContextManager[None]

await trigger_typing()

Send a typing indicator to the channel once.

Note

This only works in DMs.

async for ... in history(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a channel’s steam.Messages.

Examples

Usage:

async for message in channel.history(limit=10):
    print("Author:", message.author, "Said:", message.content)

Flattening into a list:

messages = await channel.history(limit=50).flatten()
# messages is now a list of Message

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of messages to search through. Setting this to None will fetch all of the channel’s messages, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for messages before.

  • after (Optional[datetime]) – A time to search for messages after.

Yields:

Message

await send(content=None, image=None)

Send a message to a certain destination.

Parameters:
  • content (Optional[Any]) – The content of the message to send.

  • image (Optional[Image]) – The image to send to the user.

Note

Anything as passed to content is implicitly cast to a str.

Raises:
Returns:

The sent message, only applicable if content is passed.

Return type:

Optional[steam.abc.M_co]

Methods
class steam.GroupChannel

Represents a group channel.

id

The ID of the channel.

Type:

int

name

The name of the channel, this could be the same as the name if it’s the main channel.

Type:

Optional[str]

group

The group to which messages are sent.

Type:

Optional[steam.group.Group]

joined_at

The time the client joined the chat.

Type:

Optional[datetime.datetime]

position

The position of the channel in the channel list.

Type:

Optional[int]

last_message

The last message sent in the channel.

Type:

Optional[steam.chat.ChatMessageT]

history(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a channel’s steam.Messages.

Examples

Usage:

async for message in channel.history(limit=10):
    print("Author:", message.author, "Said:", message.content)

Flattening into a list:

messages = await channel.history(limit=50).flatten()
# messages is now a list of Message

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of messages to search through. Setting this to None will fetch all of the channel’s messages, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for messages before.

  • after (Optional[datetime]) – A time to search for messages after.

Yields:

Message

await send(content=None, image=None)

Send a message to a certain destination.

Parameters:
  • content (Optional[Any]) – The content of the message to send.

  • image (Optional[Image]) – The image to send to the user.

Note

Anything as passed to content is implicitly cast to a str.

Raises:
Returns:

The sent message, only applicable if content is passed.

Return type:

Optional[steam.abc.M_co]

Methods
class steam.ClanChannel

Represents a group channel.

id

The ID of the channel.

Type:

int

name

The name of the channel, this could be the same as the name if it’s the main channel.

Type:

Optional[str]

clan

The clan to which messages are sent.

Type:

Optional[steam.clan.Clan]

joined_at

The time the client joined the chat.

Type:

Optional[datetime.datetime]

position

The position of the channel in the channel list.

Type:

Optional[int]

last_message

The last message sent in the channel.

Type:

Optional[steam.chat.ChatMessageT]

history(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a channel’s steam.Messages.

Examples

Usage:

async for message in channel.history(limit=10):
    print("Author:", message.author, "Said:", message.content)

Flattening into a list:

messages = await channel.history(limit=50).flatten()
# messages is now a list of Message

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of messages to search through. Setting this to None will fetch all of the channel’s messages, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for messages before.

  • after (Optional[datetime]) – A time to search for messages after.

Yields:

Message

await send(content=None, image=None)

Send a message to a certain destination.

Parameters:
  • content (Optional[Any]) – The content of the message to send.

  • image (Optional[Image]) – The image to send to the user.

Note

Anything as passed to content is implicitly cast to a str.

Raises:
Returns:

The sent message, only applicable if content is passed.

Return type:

Optional[steam.abc.M_co]

Clan

class steam.Clan

Represents a Steam clan.

x == y

Checks if two clans are equal.

str(x)

Returns the clan’s name.

name

The name of the clan.

Type:

str

avatar_url

The icon url of the clan. Uses the large (184x184 px) image url.

Type:

str

content

The content of the clan.

Type:

str

tagline

The clan’s tagline.

Type:

str

member_count

The amount of users in the clan.

Type:

int

online_count

The amount of users currently online.

Type:

int

active_member_count

The amount of currently users in the clan’s chat room.

Type:

int

in_game_count

The amount of user’s currently in game.

Type:

int

created_at

The time the clan was created_at.

Type:

Optional[datetime.datetime]

language

The language set for the clan.

Type:

steam.enums.Language

location

The location set for the clan.

Type:

str

game

The clan’s associated game.

Type:

Optional[steam.game.StatefulGame]

owner

The clan’s owner.

admins

A list of the clan’s administrators.

Type:

list[steam.user.ClanMember]

mods

A list of the clan’s moderators.

Type:

list[steam.user.ClanMember]

await chunk()

Get a list of all members in the group.

Return type:

Sequence[steam.user.ClanMember]

await fetch_members()

Fetches a clan’s member list.

Note

This can be a very slow operation due to the rate limits on this endpoint.

Return type:

list[steam.abc.SteamID]

property description: str

An alias to content.

Deprecated since version 0.8.0: Use content instead.

property icon_url: str

An alias to avatar_url.

Deprecated since version 0.8.0: Use avatar_url instead.

await join(*, invite_code=None)

Joins the clan.

await leave()

Leaves the clan.

await fetch_event(id)

Fetch an event from its ID.

Parameters:

id (int) – The ID of the event.

Return type:

steam.event.Event[steam.enums.EventType]

await fetch_announcement(id)

Fetch an announcement from its ID.

Parameters:

id (int) – The ID of the announcement.

Return type:

steam.Announcement

async for ... in events(*, limit=100, before=None, after=None)

An AsyncIterator over a clan’s steam.Events.

Examples

Usage:

async for event in clan.events(limit=10):
    print(event.author, "made an event", event.name, "starting at", event.starts_at)

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of events to search through. Default is 100. Setting this to None will fetch all the clan’s events, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for events before.

  • after (Optional[datetime]) – A time to search for events after.

Yields:

Event

async for ... in announcements(*, limit=100, before=None, after=None)

An AsyncIterator over a clan’s steam.Announcements.

Examples

Usage:

async for announcement in clan.announcements(limit=10):
    print(
        announcement.author,
        "made an announcement",
        announcement.name,
        "at",
        announcement.created_at,
    )

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of announcements to search through. Default is 100. Setting this to None will fetch all of the clan’s announcements, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for announcements before.

  • after (Optional[datetime]) – A time to search for announcements after.

Yields:

Announcement

property channels: Sequence[ChatT]

A list of the chat group’s channels.

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.comment.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

property default_channel: ChatT

The group’s default channel.

property default_role: Role

The group’s default role.

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.comment.Comment

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

get_channel(id)

Get a channel from cache.

Parameters:

id (int) – The ID of the channel.

Return type:

ChatT | None

get_member(id64)

Get a member of the chat group by id.

Parameters:

id64 (ID64) – The 64 bit ID of the member to get.

Return type:

MemberT | None

get_role(id)

Get a role from cache.

Parameters:

id (int) – The ID of the role.

Return type:

Role | None

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

await invite(user)

Invites a User to the chat group.

Parameters:

user (User) – The user to invite to the chat group.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

is_valid()

Whether the SteamID is valid.

Return type:

bool

property me: MemberT

The client user’s account in this chat group.

property members: Sequence[MemberT]

A list of the chat group’s members.

property roles: Sequence[Role]

A list of the group’s roles.

await search(name)

Search for members in the chat group.

Parameters:

name (str) – The name of the member to search for.

Return type:

list[MemberT]

property top_members: Sequence[Union[MemberT, SteamID]]

A list of the chat group’s top members.

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

await create_event(name: str, content: str, *, type: ~typing.Literal[<EventType.Game: 2>] = EventType.Other, starts_at: datetime.datetime | None = None, game: ~steam.game.Game, server_address: str | None = None, server_password: str | None = None) Game: 2>]]
await create_event(name: str, content: str, *, type: BoringEventT = EventType.Other, starts_at: datetime.datetime | None = None) Event[BoringEventT]

Create an event.

Parameters:
  • name – The name of the event

  • content – The content for the event.

  • type – The type of the event, defaults to ClanEvent.Other.

  • game – The game that will be played in the event. Required if type is ClanEvent.Game.

  • starts_at – The time the event will start at.

  • server_address – The address of the server that the event will be played on. This is only allowed if type is ClanEvent.Game.

  • server_password – The password for the server that the event will be played on. This is only allowed if type is ClanEvent.Game.

Note

It is recommended to use a timezone aware datetime for start.

Returns:

The created event.

Return type:

Union[steam.event.Event[Any], steam.event.Event[steam.clan.BoringEventT]]

await create_announcement(name, content, hidden=False)

Create an announcement.

Parameters:
  • name (str) – The name of the announcement.

  • content (str) – The content of the announcement.

  • hidden (bool) – Whether the announcement should initially be hidden.

Returns:

The created announcement.

Return type:

steam.Announcement

Comment

Methods
class steam.Comment

Represents a comment on a Steam profile.

x == y

Checks if two comments are equal.

hash(x)

Returns the comment’s hash.

id

The comment’s ID.

Type:

int

content

The comment’s content.

Type:

str

author

The author of the comment.

Type:

Union[steam.user.User, steam.user.ClientUser, steam.abc.SteamID]

created_at

The time the comment was posted at.

Type:

datetime.datetime

owner

The comment sections owner.

Type:

steam.comment.OwnerT

reactions

The comment’s reactions.

Type:

list[steam.reaction.AwardReaction]

await report()

Reports the comment.

await delete()

Deletes the comment.

Events

class steam.Event(state, clan, data)

Represents an event in a clan.

id

The event’s id.

Type:

int

author

The event’s author.

Type:

Optional[Union[steam.user.User, steam.abc.SteamID]]

name

The event’s name.

Type:

str

content

The event’s content.

Type:

str

game

The game that the event is going to play in.

Type:

Optional[steam.game.StatefulGame]

clan

The event’s clan.

Type:

steam.Clan

starts_at

The event’s start time.

Type:

datetime.datetime

becomes_visible

The time at which the event becomes visible.

Type:

Optional[datetime.datetime]

stops_being_visible

The time at which the event stops being visible.

Type:

Optional[datetime.datetime]

ends_at

The time at which the event ends.

Type:

Optional[datetime.datetime]

type

The event’s type.

Type:

steam.event.ClanEventT

last_edited_at

The time the event was last edited at.

Type:

Optional[datetime.datetime]

last_edited_by

The user who made the event last edited.

Type:

Optional[Union[steam.user.User, steam.abc.SteamID]]

hidden

Whether the event is currently hidden.

Type:

bool

published

Whether the event is currently published.

Type:

bool

upvotes

The number of up votes on the event.

Type:

int

downvotes

The number of down votes on the event.

Type:

int

comment_count

The number of comments on the event.

Type:

int

server_address

The event’s server address.

Type:

Optional[str]

server_password

The event’s server password.

Type:

Optional[str]

await server()

The server that the game will be run on, None if not found.

Note

This is shorthand for

await client.fetch_server(ip=event.server_address)
Return type:

Optional[steam.game_server.GameServer]

await edit(name: str, content: str, *, game: steam.game.Game | None = None, starts_at: datetime.datetime | None = None, server_address: str | None = None, server_password: str | None = None) None
await edit(name: str, content: str, *, type: ~typing.Optional[~typing.Literal[<EventType.Other: 1>, <EventType.Chat: 9>, <EventType.Party: 3>, <EventType.Meeting: 4>, <EventType.SpecialCause: 5>, <EventType.MusicAndArts: 6>, <EventType.Sports: 7>, <EventType.Trip: 8>]] = None, starts_at: datetime.datetime | None = None) None
await edit(name: str, content: str, *, type: ~typing.Literal[<EventType.Game: 2>] = None, starts_at: datetime.datetime | None = None, game: ~steam.game.Game, server_address: str | None = None, server_password: str | None = None) None

Edit the event’s details.

Note

If parameters are omitted they use what they are currently set to.

Parameters:
  • name – The event’s name.

  • content – The event’s content.

  • type – The event’s type.

  • game – The event’s game.

  • starts_at – The event’s start time.

  • server_address – The event’s server’s address.

  • server_password – The event’s server’s password.

Return type:

None

await delete()

Delete this event.

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

Game Servers

class steam.GameServer

Represents a game server.

name

The name of the server.

Type:

str

game

The game of the server.

Type:

steam.game.StatefulGame

ip

The ip of the server.

Type:

str

port

The port of the server.

Type:

int

tags

The tags of the server.

Type:

list[str]

map

The map the server is running.

Type:

str

bot_count

The number of bots in the server.

Type:

int

player_count

The number of players the server.

Type:

int

max_player_count

The maximum player count of the server.

Type:

int

region

The region the server is in.

version

The version of the server.

Type:

str

is_secure()

Whether the sever is secured, likely with VAC.

Return type:

bool

is_dedicated()

Whether the sever is dedicated.

Return type:

bool

await players(*, challenge=0)

Fetch a server’s players.

Parameters:

challenge (Literal[-1, 0]) –

The challenge for the request default is 0 can also be -1. You may need to change if the server doesn’t seem to respond.

Deprecated since version 0.9.0: This parameter no longer does anything.

Returns:

ServerPlayer is a typing.NamedTuple defined as: .. source:: steam.ServerPlayer

Return type:

list[tuple[int, str, int, datetime.timedelta]]

await rules(*, challenge=0)

Fetch a console variables. e.g. sv_gravity or sv_voiceenable.

Parameters:

challenges

The challenge for the request default is 0 can also be -1. You may need to change if the server doesn’t seem to respond.

Deprecated since version 0.9.0: This parameter no longer does anything.

Return type:

dict[str, str]

property community_url: str | None

The SteamID’s community url.

e.g https://steamcommunity.com/profiles/123456789.

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

is_valid()

Whether the SteamID is valid.

Return type:

bool

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

class steam.Query

A pathlib.Path like class for constructing Global Master Server queries.

x == y

Checks if two queries are equal, order is checked.

x / y

Appends y’s query to x.

x | y

Combines the two queries in \nor\[x\y] (not or).

x & y

Combines the two queries in \nand\[x\y] (not and).

Examples

Match games running TF2, that are not empty and are using VAC

>>> Query.running / TF2 / Query.not_empty / Query.secure
<Query query='\\appid\\440\\empty\\1\\secure\\1'>

Matches games that are not empty, not full and are not using VAC

>>> Query.not_empty / Query.not_full | Query.secure
<Query query='\\empty\\1\\nor\\[\\full\\1\\secure\\1]'>

Match games where the server name is not “A cool Server” or the server doesn’t support alltalk or increased max players

>>> Query.name_match / "A not cool server" | Query.match_tags / ["alltalk", "increased_maxplayers"]
<Query query='\\nor\\[\\name_match\\A not cool server\\gametype\\[alltalk,increased_maxplayers]]'>

Match games where the server is not on linux and the server doesn’t have no password (has a password)

>>> Query.linux & Query.no_password
property query: str

The actual query used for querying Global Master Servers.

class property all: QueryAll

Fetches any servers. Any operations on this will fail.

class property dedicated: Q

Fetches servers that are running dedicated.

class property empty: Q

Fetches servers that are empty.

class property ip: Query[str]

Fetches servers on the specified IP address, port is optional.

class property linux: Q

Fetches servers running on a Linux platform.

class property match_any_hidden_tags: Query[list[str]]

Fetches servers with any of the given tag(s) in their ‘hidden’ tags only applies for steam.LFD2.

class property match_hidden_tags: Query[list[str]]

Fetches servers with all the given tag(s) in their ‘hidden’ tags only applies for steam.LFD2.

class property match_tags: Query[list[str]]

Fetches servers with all the given tag(s) in GameServer.tags.

class property name_match: Query[str]

Fetches servers with their hostname matching “x” ("*" is wildcard).

class property no_password: Q

Fetches servers that are not password protected.

class property not_empty: Q

Fetches servers that are not empty.

class property not_full: Q

Fetches servers that are not full.

class property not_running: Query[Game | int]

Fetches servers not running a Game or an int app id.

class property proxy: Q

Fetches servers that are spectator proxies.

class property region: Query[GameServerRegion]

Fetches servers in a given region.

class property running: Query[Game | int]

Fetches servers running a Game or an int app id.

class property running_map: Query[str]

Fetches servers running the specified map (e.g. cs_italy)

class property running_mod: Query[str]

Fetches servers running the specified modification (e.g. cstrike).

class property secure: Q

Fetches servers that are using anti-cheat technology (VAC, but potentially others as well).

class property unique_addresses: Q

Fetches only one server for each unique IP address matched.

class property version_match: Query[str]

Fetches servers running version “x” ("*" is wildcard).

class property whitelisted: Q

Fetches servers that are whitelisted.

Group

class steam.Group

Represents a Steam group.

property channels: Sequence[ChatT]

A list of the chat group’s channels.

await chunk()

Get a list of all members in the group.

Return type:

Sequence[steam.user.GroupMember]

property community_url: str | None

The SteamID’s community url.

e.g https://steamcommunity.com/profiles/123456789.

property default_channel: ChatT

The group’s default channel.

property default_role: Role

The group’s default role.

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

get_channel(id)

Get a channel from cache.

Parameters:

id (int) – The ID of the channel.

Return type:

ChatT | None

get_member(id64)

Get a member of the chat group by id.

Parameters:

id64 (ID64) – The 64 bit ID of the member to get.

Return type:

MemberT | None

get_role(id)

Get a role from cache.

Parameters:

id (int) – The ID of the role.

Return type:

Role | None

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

await invite(user)

Invites a User to the chat group.

Parameters:

user (User) – The user to invite to the chat group.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

is_valid()

Whether the SteamID is valid.

Return type:

bool

await join(*, invite_code=None)

Joins the chat group.

Parameters:

invite_code (Optional[str]) – The invite code to use to join the chat group.

await leave()

Leaves the chat group.

property me: MemberT

The client user’s account in this chat group.

property members: Sequence[MemberT]

A list of the chat group’s members.

property roles: Sequence[Role]

A list of the group’s roles.

await search(name)

Search for members in the chat group.

Parameters:

name (str) – The name of the member to search for.

Return type:

list[MemberT]

property top_members: Sequence[Union[MemberT, SteamID]]

A list of the chat group’s top members.

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

Invite

Attributes
Methods
class steam.UserInvite

Represents a invite from a user to become their friend.

invitee

The user who sent the invite.

Type:

Union[steam.user.User, steam.abc.SteamID]

relationship

The relationship you have with the invitee.

Type:

Optional[steam.enums.FriendRelationship]

await accept()

Accept the invite request.

await decline()

Decline the invite request.

Methods
class steam.ClanInvite

Represents a invite to join a Clan from a user.

clan

The clan to join.

Type:

Union[steam.Clan, steam.abc.SteamID]

invitee

The user who sent the invite.

Type:

Union[steam.user.User, steam.abc.SteamID]

relationship

The relationship you have with the clan.

Type:

Optional[steam.enums.FriendRelationship]

await accept()

Accept the invite request.

await decline()

Decline the invite request.

Manifests

class steam.Manifest

Represents a manifest which is a collection of files included with a depot build on Steam’s CDN.

x == y

Checks if two manifests are equal.

len(x)

Returns the number of files this manifest holds.

name

The name of the manifest.

Type:

Optional[str]

game

The game that this manifest was fetched from.

Type:

steam.game.StatefulGame

created_at

The time at which the depot was created at.

Type:

datetime.datetime

property paths: Sequence[ManifestPath]

The depot’s files.

property id: int

The ID of this manifest. This is randomly generated by Steam.

property depot_id: int

The ID of this manifest’s depot.

property size_original: int

The size of the original depot file.

property size_compressed: int

The size of the compressed depot file.

property compressed: bool

Whether the depot is compressed.

class steam.ManifestPath

A pathlib.PurePath subclass representing a binary file in a Manifest. This class is broadly compatible with pathlib.Path.

x == y

Checks if two paths are equal.

hash(x)

Hashes this path.

x < y

Checks if one path is less than the other.

property parents: ManifestPathParents

A sequence of this path’s logical parents.

property size: int

This path’s size in bytes.

property chunks: Sequence[PayloadFileMappingChunkData]

A read-only version of this path’s chunks instances.

flags

This path’s flags.

is_dir()

Whether the path is a directory.

Return type:

bool

Whether this path is a symlink.

Return type:

bool

is_file()

Whether this path is a file or symlink.

Return type:

bool

is_executable()

Whether this file is executable.

Return type:

bool

is_hidden()

Whether this file is hidden.

Return type:

bool

If this path is a symlink where it points to. Similar to pathlib.Path.readlink()

Raises:

OSError – this path isn’t a symlink.

Return type:

Self

for ... in iterdir()

Iterate over this path. Similar to pathlib.Path.iterdir().

Return type:

Generator

for ... in glob(pattern)

Perform a glob operation on this path. Similar to pathlib.Path.glob().

Return type:

Generator

for ... in rglob(pattern)

Perform a recursive glob operation on this path. Similar to pathlib.Path.rglob().

Return type:

Generator

async with open()

Reads the entire contents of the file into a io.BytesIO object.

Raises:
  • IsADirectoryError – This path is a directory and cannot be opened.

  • RuntimeError – The depot cannot be decrypted as no key for its manifest was found.

Return type:

contextlib._AsyncGeneratorContextManager[_io.BytesIO]

await read_bytes(**kwargs)

Read the contents of the file. Similar to pathlib.Path.read_bytes()

Return type:

bytes

await read()

Read the whole contents of this file.

Return type:

Never

await read_text(encoding=None)

Read the contents of the file. Similar to pathlib.Path.read_text()

Return type:

str

await read_vdf(encoding=None)

Read the contents of the file into a VDFDict.

Return type:

multidict._multidict.MultiDict[Union[str, Any]]

property anchor

The concatenation of the drive and root, or ‘’.

as_posix()

Return the string representation of the path with forward (/) slashes.

as_uri()

Return the path as a ‘file’ URI.

property drive

The drive prefix (letter or UNC path), if any.

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

is_absolute()

True if the path is absolute (has both a root and, if applicable, a drive).

is_relative_to(*other)

Return True if the path is relative to another path or False.

is_reserved()

Return True if the path contains one of the special names reserved by the system, if any.

joinpath(*args)

Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored).

match(path_pattern)

Return True if this path matches the given pattern.

property name

The final path component, if any.

property parent

The logical parent of the path.

property parts

An object providing sequence-like access to the components in the filesystem path.

relative_to(*other)

Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError.

property root

The root of the path, if any.

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

property stem

The final path component, minus its last suffix.

property suffix

The final component’s last suffix, if any.

This includes the leading period. For example: ‘.txt’

property suffixes

A list of the final component’s suffixes, if any.

These include the leading periods. For example: [‘.tar’, ‘.gz’]

with_name(name)

Return a new path with the file name changed.

with_stem(stem)

Return a new path with the stem changed.

with_suffix(suffix)

Return a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the path.

class steam.Branch

Represents a branch on for a Steam app. Branches are specific builds of an application that have made available publicly or privately through Steam.

Read more on steamworks.

name

The name of the branch.

Type:

str

build_id

The branch’s build ID. This is a globally incrementing number. Build IDs are updated when a new build of an application is pushed.

Type:

int

password_required

Whether a password is required to access this branch.

Type:

bool

updated_at

The time this branch was last updated. This can be None if the branch is ancient and hasn’t been updated in ages.

Type:

Optional[datetime.datetime]

description

This branch’s description.

Type:

Optional[str]

depots

This branch’s depots.

Type:

list[steam.manifest.Depot]

password

This branch’s password.

Type:

Optional[str]

property manifests: list[steam.manifest.ManifestInfo]

This branch’s manifests.

await fetch_manifests()

Fetch this branch’s manifests. Similar to StatefulGame.manifests().

Return type:

list[steam.Manifest]

Attributes
Methods
class steam.ManifestInfo

Represents information about a manifest.

id

The manifest’s ID.

Type:

int

branch

The branch this manifest is for.

Type:

steam.Branch

depot

The depot this manifest is for.

Type:

steam.manifest.Depot

property name: str | None

The manifest’s name.

await fetch()

Resolves this manifest info into a full Manifest.

Return type:

steam.Manifest

class steam.HeadlessDepot

Represents a depot without a branch.

id: int
name: str
game: GameInfo
max_size: int
config: MultiDict[str]
shared_install: bool
system_defined: bool
Attributes
class steam.Depot

Represents a depot which is a grouping of files.

Read more on steamworks.

manifest: ManifestInfo
branch: Branch
class steam.GameInfo

Represents a collection of information on a game.

type

The game’s type.

has_adult_content

Whether this game has adult content according to Steam.

Type:

bool

has_adult_content_violence

Whether this game has adult violence according to Steam.

Type:

bool

market_presence

Whether this game has a market presence.

Type:

bool

workshop_visible

Whether this game has a market presence.

Type:

bool

community_hub_visible

Whether this game has a content hub visible.

Type:

bool

controller_support

This game’s level of controller support.

Type:

Union[Literal[‘full’], Literal[‘partial’], Literal[‘none’]]

publishers

This game’s publishers.

Type:

list[str]

developers

This game’s developers.

Type:

list[str]

supported_languages

This game’s supported languages.

Type:

list[steam.enums.Language]

created_at

The time this game was created.

Type:

Optional[datetime.datetime]

review_score

This game’s review score.

review_percentage

This game’s review percentage.

Type:

int

partial_dlc

This game’s downloadable content.

Type:

list[steam.StatefulGame]

icon_url

This game’s icon URL.

Type:

Optional[str]

logo_url

This game’s logo URL.

Type:

Optional[str]

website_url

This game’s URL.

Type:

Optional[str]

headless_depots

The depots for this game without a branch.

Type:

Sequence[steam.HeadlessDepot]

sha

The game’s SHA for this product info.

Type:

str

size

The product info’s size.

Type:

int

change_number

The product info’s change number.

Type:

int

get_branch(name)

Get a branch by its name.

Return type:

Optional[steam.Branch]

property branches: Sequence[Branch]

The branches for this game.

property public_branch: Branch

The public branch. Shorthand for:

game.get_branch("public")
is_on_windows()

Whether the game is playable on Windows.

Return type:

bool

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[License]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

FriendThoughts

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

GameInfo

is_on_mac_os()

Whether the game is playable on macOS.

Return type:

bool

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await packages(*, language=None)

Fetch the game’s packages.

Parameters:

language (Language | None) – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[FetchedGamePackage]

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (int | None) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Language | None) – The language the review is in.

Return type:

Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

is_on_linux()

Whether the game is playable on Linux.

Return type:

bool

has_visible_stats()

Whether the game has publicly visible stats.

Return type:

bool

is_free()

Whether the game is free to download.

Return type:

bool

Methods
class steam.PackageInfo

Represents a collection of information on a package.

games

The games included in the package.

billing_type

The billing type for the package.

license_type

The license type for the package.

status

The status for the package.

depot_ids

The depot IDs in of the depots in the package.

Type:

list[int]

app_items

The app items in the package.

Type:

list[int]

await depots()

Fetches this package’s depots.

Return type:

Sequence[Depot | HeadlessDepot]

await fetch()

Fetches this package’s information. Shorthand for:

package = await client.fetch_package(package)
Return type:

FetchedPackage

await games_info()

Shorthand for:

infos = await client.fetch_product_info(games=await package.games())
Return type:

list[GameInfo]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(packages=[package])
Return type:

PackageInfo

await games()

Fetches this package’s games.

Return type:

list[steam.StatefulGame]

Message

class steam.Message

Represents a message from a User. This is a base class from which all messages inherit.

The following classes implement this:

x == y

Checks if two messages are equal

hash(x)

Returns the hash of a message.

author: Union[User, ClientUser, SteamID]

The message’s author.

created_at: datetime

The time this message was sent at.

channel: Channel

The channel the message was sent in.

group: Optional[Group]

The group the message was sent in. Will be None if the message wasn’t sent in a Group.

clan: Optional[Clan]

The clan the message was sent in. Will be None if the message wasn’t sent in a Clan.

content: str

The message’s content.

Note

This is not what you will see in the steam client see clean_content for that.

ordinal: int

A per-channel incremented integer up to 1000 for every message sent in a second window.

clean_content: str

The message’s clean content without BBCode.

mentions: Optional[Mentions]

An object representing mentions in this message.

reactions: list[steam.reaction.MessageReaction]

The reactions this message has received.

id

A unique identifier for every message sent in a channel.

Note

This is not something Steam provides, this is meant to be a simple way to compare messages.

abstractmethod await add_emoticon(emoticon)

Adds an emoticon to this message.

Parameters:

emoticon (Emoticon) – The emoticon to add to this message.

abstractmethod await remove_emoticon(emoticon)

Removes an emoticon from this message.

Parameters:

emoticon (Emoticon) – The emoticon to remove from this message.

abstractmethod await add_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to add to this message.

abstractmethod await remove_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to remove from this message.

class steam.UserMessage

Represents a message from a user.

channel: Channel

The channel the message was sent in.

mentions: Optional[Mentions]

An object representing mentions in this message.

author: Union[User, ClientUser, SteamID]

The message’s author.

created_at: datetime

The time this message was sent at.

await add_emoticon(emoticon)

Adds an emoticon to this message.

Parameters:

emoticon (Emoticon) – The emoticon to add to this message.

await remove_emoticon(emoticon)

Removes an emoticon from this message.

Parameters:

emoticon (Emoticon) – The emoticon to remove from this message.

Return type:

Any

await add_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to add to this message.

Return type:

Any

await remove_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to remove from this message.

Return type:

Any

content: str

The message’s content.

Note

This is not what you will see in the steam client see clean_content for that.

clean_content: str

The message’s clean content without BBCode.

ordinal: int

A per-channel incremented integer up to 1000 for every message sent in a second window.

group: Optional[Group]

The group the message was sent in. Will be None if the message wasn’t sent in a Group.

clan: Optional[Clan]

The clan the message was sent in. Will be None if the message wasn’t sent in a Clan.

reactions: list[steam.reaction.MessageReaction]

The reactions this message has received.

id

A unique identifier for every message sent in a channel.

Note

This is not something Steam provides, this is meant to be a simple way to compare messages.

class steam.GroupMessage

Represents a message in a group.

channel: Channel

The channel the message was sent in.

group: Optional[Group]

The group the message was sent in. Will be None if the message wasn’t sent in a Group.

clan: Optional[Clan]

The clan the message was sent in. Will be None if the message wasn’t sent in a Clan.

author: Union[User, ClientUser, SteamID]

The message’s author.

content: str

The message’s content.

Note

This is not what you will see in the steam client see clean_content for that.

clean_content: str

The message’s clean content without BBCode.

created_at: datetime

The time this message was sent at.

ordinal: int

A per-channel incremented integer up to 1000 for every message sent in a second window.

mentions: Optional[Mentions]

An object representing mentions in this message.

reactions: list[steam.reaction.MessageReaction]

The reactions this message has received.

await add_emoticon(emoticon)

Adds an emoticon to this message.

Parameters:

emoticon (Emoticon) – The emoticon to add to this message.

await add_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to add to this message.

await fetch_reaction(emoticon)

Fetches the reactions to this message with a given emoticon.

Return type:

list[MessageReaction]

await fetch_reactions()

Fetches all this message’s reactions.

Warning

This does nothing for messages that aren’t fetched by GroupChannel.history()/ClanChannel.history().

Return type:

list[MessageReaction]

id

A unique identifier for every message sent in a channel.

Note

This is not something Steam provides, this is meant to be a simple way to compare messages.

await remove_emoticon(emoticon)

Removes an emoticon from this message.

Parameters:

emoticon (Emoticon) – The emoticon to remove from this message.

await remove_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to remove from this message.

class steam.ClanMessage

Represents a message in a clan.

channel: Channel

The channel the message was sent in.

clan: Optional[Clan]

The clan the message was sent in. Will be None if the message wasn’t sent in a Clan.

group: Optional[Group]

The group the message was sent in. Will be None if the message wasn’t sent in a Group.

author: Union[User, ClientUser, SteamID]

The message’s author.

content: str

The message’s content.

Note

This is not what you will see in the steam client see clean_content for that.

clean_content: str

The message’s clean content without BBCode.

created_at: datetime

The time this message was sent at.

ordinal: int

A per-channel incremented integer up to 1000 for every message sent in a second window.

mentions: Optional[Mentions]

An object representing mentions in this message.

reactions: list[steam.reaction.MessageReaction]

The reactions this message has received.

await add_emoticon(emoticon)

Adds an emoticon to this message.

Parameters:

emoticon (Emoticon) – The emoticon to add to this message.

await add_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to add to this message.

await fetch_reaction(emoticon)

Fetches the reactions to this message with a given emoticon.

Return type:

list[MessageReaction]

await fetch_reactions()

Fetches all this message’s reactions.

Warning

This does nothing for messages that aren’t fetched by GroupChannel.history()/ClanChannel.history().

Return type:

list[MessageReaction]

id

A unique identifier for every message sent in a channel.

Note

This is not something Steam provides, this is meant to be a simple way to compare messages.

await remove_emoticon(emoticon)

Removes an emoticon from this message.

Parameters:

emoticon (Emoticon) – The emoticon to remove from this message.

await remove_sticker(sticker)

Adds a sticker to this message.

Parameters:

sticker (Sticker) – The sticker to remove from this message.

Package

class steam.Package

Represents information on a package which is a collection of one or more applications and depots.

Read more on steamworks.

Methods
class steam.package.StatefulPackage

A package with state.

await depots()

Fetches this package’s depots.

Return type:

Sequence[Union[steam.Depot, steam.HeadlessDepot]]

await fetch()

Fetches this package’s information. Shorthand for:

package = await client.fetch_package(package)
Return type:

steam.package.FetchedPackage

await games()

Fetches this package’s games.

Return type:

list[steam.StatefulGame]

await games_info()

Shorthand for:

infos = await client.fetch_product_info(games=await package.games())
Return type:

list[steam.GameInfo]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(packages=[package])
Return type:

steam.PackageInfo

Methods
class steam.FetchedPackage
is_free()

Whether the game is free.

Return type:

bool

is_on_windows()

Whether the game is playable on Windows.

Return type:

bool

is_on_mac_os()

Whether the game is playable on macOS.

Return type:

bool

is_on_linux()

Whether the game is playable on Linux.

Return type:

bool

await depots()

Fetches this package’s depots.

Return type:

Sequence[Union[steam.Depot, steam.HeadlessDepot]]

await fetch()

Fetches this package’s information. Shorthand for:

package = await client.fetch_package(package)
Return type:

steam.FetchedPackage

await games()

Fetches this package’s games.

Return type:

list[steam.StatefulGame]

await games_info()

Shorthand for:

infos = await client.fetch_product_info(games=await package.games())
Return type:

list[steam.GameInfo]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(packages=[package])
Return type:

steam.PackageInfo

class steam.License

Represents a License to a package the client user has access to.

owner: Union[User, ClientUser, SteamID]
type
flags
created_at: Optional[datetime]
master_package: Optional[StatefulPackage]
next_process_at: datetime
time_limit: Optional[timedelta]
time_used: timedelta
await depots()

Fetches this package’s depots.

Return type:

Sequence[Union[steam.Depot, steam.HeadlessDepot]]

await fetch()

Fetches this package’s information. Shorthand for:

package = await client.fetch_package(package)
Return type:

steam.FetchedPackage

await games()

Fetches this package’s games.

Return type:

list[steam.StatefulGame]

await games_info()

Shorthand for:

infos = await client.fetch_product_info(games=await package.games())
Return type:

list[steam.GameInfo]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(packages=[package])
Return type:

steam.PackageInfo

payment_method
purchase_country_code: str
territory_code: int
change_number: int
initial_period: int
initial_time_unit: int
renewal_period: timedelta
renewal_time_unit: int
access_token: int
property time_remaining: datetime.timedelta | None

The amount of time that this license can be used for.

Methods
class steam.FetchedGamePackage
await depots()

Fetches this package’s depots.

Return type:

Sequence[Union[steam.Depot, steam.HeadlessDepot]]

await fetch()

Fetches this package’s information. Shorthand for:

package = await client.fetch_package(package)
Return type:

steam.FetchedPackage

await games()

Fetches this package’s games.

Return type:

list[steam.StatefulGame]

await games_info()

Shorthand for:

infos = await client.fetch_product_info(games=await package.games())
Return type:

list[steam.GameInfo]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(packages=[package])
Return type:

steam.PackageInfo

PriceOverview

class steam.PriceOverview

Represents the data received from https://steamcommunity.com/market/priceoverview.

currency

The currency identifier for the item e.g. “$” or “£”.

Type:

str

volume

The amount of items that sold in the last 24 hours.

Type:

int

lowest_price

The lowest price observed by the market.

Type:

Union[float, str]

median_price

The median price observed by the market.

Type:

Union[float, str]

Profile

class steam.ProfileInfo

Represents the user’s profile info.

created_at: datetime
real_name: Optional[str]
city_name: Optional[str]
state_name: Optional[str]
country_name: Optional[str]
headline: Optional[str]
summary: str
class steam.ProfileItem

Represents an item on/in a user’s profile.

id: int
url: str
name: str
title: str
description: str
game: StatefulGame
type
class_
movie: ProfileMovie
equipped_flags: int
await equip()

Equip the profile item.

await item(*, language=None)

Resolve this to an actual item in the owner’s inventory.

Return type:

steam.trade.Item

class steam.OwnedProfileItems

Represents the ClientUser's owned items.

backgrounds: list[steam.ProfileItem]
mini_profile_backgrounds: list[steam.ProfileItem]
avatar_frames: list[steam.ProfileItem]
animated_avatars: list[steam.ProfileItem]
modifiers: list[steam.ProfileItem]
class steam.EquippedProfileItems

Represents the items the user has equipped.

background: Optional[ProfileItem]
mini_profile_background: Optional[ProfileItem]
avatar_frame: Optional[ProfileItem]
animated_avatar: Optional[ProfileItem]
modifier: Optional[ProfileItem]
Methods
class steam.ProfileShowcase

ProfileShowcase(_state: ‘ConnectionState’, owner: ‘BaseUser’, type: ‘ProfileItemType’, large: ‘bool’, active: ‘bool’, purchase_id: ‘int’, level: ‘int’, style: ‘ProfileCustomisationStyle’, slots: ‘list[ProfileShowcaseSlot]’)

type: ProfileItemType
large: bool
active: bool
purchase_id: int
level: int
style: ProfileCustomisationStyle
slots: list[steam.profile.ProfileShowcaseSlot]
await items(*, language)

Fetches the associated :class:`.Item`s for the entire showcase.

Parameters:

language (steam.enums.Language | None) – The language to fetch the items in. If None, the current language is used.

Return type:

list[steam.trade.Item]

await published_file(*, revision=PublishedFileRevision.Default, language=None)

Fetches the associated PublishedFile from published_file_id.

Parameters:
  • revision (PublishedFileRevision) – The revision of the file to fetch.

  • language (Language | None) – The language to fetch the file in. If None, the current language is used.

Return type:

steam.published_file.PublishedFile

await badges()

Fetches the associated :class:`.Badge`s for the entire showcase.

Return type:

list[steam.Badge]

class steam.Profile

Represents a user’s complete profile.

PublishedFile

class steam.PublishedFile(state, proto, author)

Represents a published file on SteamPipe.

id: int
name: str
author: Union[User, ClientUser, SteamID]
game: StatefulGame
created_with: StatefulGame
created_at: datetime
updated_at: datetime
url: str
manifest_id: int
revision
available_revisions: list
change_number: int
type
views: int
youtube_id: str
description: str
visibility
flags: int
accepted: bool
show_subscribe_all: bool
number_of_developer_comments: int
number_of_public_comments: int
spoiler: bool
children: list[steam.published_file.PublishedFileChild]
filename: str
size: int
cdn_url: str
preview: PreviewInfo
previews: list[steam.published_file.DetailsPreview]
banned: bool
ban_reason: Optional[str]
banner: Optional[int]
ban_text_check_result: EBanContentCheckResult
can_be_deleted: bool
incompatible: bool
can_subscribe: bool
subscriptions: int
time_subscribed: int
favourited: int
followers: int
await award(award)

Add an Award to this piece of user generated content.

Parameters:

award (Award) – The award to add.

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

lifetime_subscriptions: int
lifetime_favourited: int
lifetime_followers: int
lifetime_playtime: int
lifetime_playtime_sessions: int
image_width: int
image_height: int
image_url: str
shortcut_id: int
shortcut_name: str
consumer_shortcut_id: int
tags: list[steam.protobufs.published_file.PublishedFileDetailsTag]
kv_tags: dict[str, str]
reports: int
upvotes: int
downvotes: int
score: float
playtime_stats: PublishedFileDetailsPlaytimeStats
for_sale_data: PublishedFileDetailsForSaleData
metadata: str
language
maybe_inappropriate_sex: bool
maybe_inappropriate_violence: bool
reactions: list[steam.reaction.AwardReaction]
await manifest()

The manifest associated with this published file.

Return type:

steam.Manifest

await fetch_children(*, revision=PublishedFileRevision.Default, language=None)

Fetches this published file’s children.

Parameters:
Return type:

list[steam.PublishedFile]

await parents(*, revision=PublishedFileRevision.Default, language=None)

Fetches this published file’s parents.

Parameters:
Return type:

list[steam.PublishedFile]

await upvote()

Upvotes this published file.

await downvote()

Downvotes this published file.

await subscribe()

Subscribes to this published file’s changes.

await unsubscribe()

Unsubscribes from this published file’s changes.

await is_subscribed()

Whether the client user is subscribed to this published file.

Return type:

bool

await add_child(child)

Adds a child to this published file.

Parameters:

child (PublishedFile) – The child to add.

await remove_child(child)

Removes a child from this published file.

Parameters:

child (PublishedFile) – The child to remove.

await history(*, language=None)

Fetches this published file’s history.

Parameters:

language (Optional[Language]) – The language to fetch history in. If None, the current language is used.

Return type:

list[steam.published_file.PublishedFileChange]

await fetch_history_entry(at, *, language=None)

Fetches the history entry at a given time.

Parameters:
  • at (datetime) – The time to fetch the history entry at.

  • language (Optional[Language]) – The language to fetch history entries in. If None, the current language is used.

Return type:

steam.published_file.PublishedFileChange

await edit(*, name=None, description=None, visibility=None, tags=(), filename=None, preview_filename=None)

Edits this published file.

Parameters:
  • name (Optional[str]) – The new name of the file.

  • description (Optional[str]) – The new description of the file.

  • visibility (Optional[PublishedFileVisibility]) – The new visibility of the file.

  • tags (Sequence[str]) – The new tags of the file.

  • filename (Optional[str]) – The new filename of the file.

  • preview_filename (Optional[str]) – The new preview filename of the file.

Trading

steam.Inventory

alias of BaseInventory[Item]

class steam.Item

Represents an item in a User’s inventory.

x == y

Checks if two items are equal.

name

The market_name of the item.

Type:

Optional[str]

display_name

The displayed name of the item. This could be different to Item.name if the item is user re-nameable.

Type:

Optional[str]

colour

The colour of the item.

Type:

Optional[int]

descriptions

The descriptions of the item.

Type:

Optional[list]

owner_descriptions

The descriptions of the item which are visible only to the owner of the item.

Type:

list

type

The type of the item.

Type:

Optional[str]

tags

The tags of the item.

Type:

Optional[list]

icon_url

The icon url of the item. Uses the large (184x184 px) image url.

Type:

Optional[str]

fraud_warnings

The fraud warnings for the item.

Type:

list[str]

actions

The actions for the item.

Type:

list

is_tradable()

Whether the item is tradable.

Return type:

bool

is_marketable()

Whether the item is marketable.

Return type:

bool

property asset_id: int

The assetid of the item.

Deprecated since version 0.9.0::: Use id instead.

game

The game the item is from.

property url: str

The URL for the asset in the owner’s inventory.

e.g. https://steamcommunity.com/profiles/76561198248053954/inventory/#440_2_8526584188

class steam.Asset

Base most version of an item. This class should only be received when Steam fails to find a matching item for its class and instance IDs.

x == y

Checks if two assets are equal.

hash(x)

Returns the hash of an asset.

id

The assetid of the item.

Type:

int

amount

The amount of the same asset there are in the inventory.

Type:

int

instance_id

The instanceid of the item.

Type:

int

class_id

The classid of the item.

Type:

int

post_rollback_id

The assetid of the item after a rollback (cancelled, etc.). None if not rolled back.

owner

The owner of the asset

Type:

steam.abc.BaseUser

property asset_id: int

The assetid of the item.

Deprecated since version 0.9.0::: Use id instead.

game

The game the item is from.

property url: str

The URL for the asset in the owner’s inventory.

e.g. https://steamcommunity.com/profiles/76561198248053954/inventory/#440_2_8526584188

class steam.MovedItem

Represents an item that has moved from one inventory to another.

new_id

The new_assetid field, this is the asset ID of the item in the partners inventory.

Type:

int

new_context_id

The new_contextid field.

Type:

int

property new_asset_id: int

The new asset ID of the item in the partner’s inventory.

Reactions

Attributes
Methods
class steam.Award

Represents an award.

id

The ID of the award.

Type:

int

name

The english localised name of the award.

Type:

str

property url: str

The reaction’s icon URL.

property animated_url: str

The reaction’s icon animated URL.

async with open(*, animated=False)

Open this file as and returns its contents as an in memory buffer.

Return type:

contextlib._AsyncGeneratorContextManager[_io.BytesIO]

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

await read(**kwargs)

Read the whole contents of this file.

Return type:

bytes

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

Attributes
class steam.AwardReaction

Represents an award on user generated content.

award

The award given to the user generated content.

Type:

steam.Award

count

The reactions count on the post.

Type:

int

Attributes
class steam.PartialMessageReaction

Represents a partial reaction to a message.

message: Message
emoticon: Optional[Emoticon]
sticker: Optional[Sticker]
Attributes
class steam.MessageReaction

Represents a reaction to a message.

user: Union[User, ClientUser, SteamID]
created_at: Optional[datetime] = None
ordinal: Optional[int] = None
Attributes
Methods
class steam.Emoticon

Represents an emoticon in chat.

str(x)

The string to send this emoticon in chat.

name

The name of this emoticon.

Type:

str

property url: str

The URL for this emoticon.

await game()

Fetches this emoticon’s associated game.

Note

This game has its name set unlike Sticker.game().

Return type:

steam.StatefulGame

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

async with open(**kwargs)

Open this file as and returns its contents as an in memory buffer.

Return type:

AsyncGenerator[BytesIO, None]

await read(**kwargs)

Read the whole contents of this file.

Return type:

bytes

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

Attributes
Methods
class steam.Sticker

Represents a sticker in chat.

str(x)

The way to send this sticker in chat.

Note

Unlike Emoticon this can only be sent in a message by itself.

name

The name of this sticker.

Type:

str

property url: str

The URL for this sticker.

await game()

Fetches this sticker’s associated game.

Return type:

steam.StatefulGame

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

async with open(**kwargs)

Open this file as and returns its contents as an in memory buffer.

Return type:

AsyncGenerator[BytesIO, None]

await read(**kwargs)

Read the whole contents of this file.

Return type:

bytes

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

Attributes
Methods
class steam.ClientEmoticon

Represents an Emoticon the ClientUser owns.

await game()

Fetches this emoticon’s associated game.

Note

This game has its name set unlike Sticker.game().

Return type:

steam.StatefulGame

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

async with open(**kwargs)

Open this file as and returns its contents as an in memory buffer.

Return type:

AsyncGenerator[BytesIO, None]

await read(**kwargs)

Read the whole contents of this file.

Return type:

bytes

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

property url: str

The URL for this emoticon.

Attributes
Methods
class steam.ClientSticker

Represents a Sticker the ClientUser owns.

await image(*, spoiler=False, **kwargs)

Return this file as an image for uploading.

Return type:

Image

async with open(**kwargs)

Open this file as and returns its contents as an in memory buffer.

Return type:

AsyncGenerator[BytesIO, None]

await read(**kwargs)

Read the whole contents of this file.

Return type:

bytes

await save(filename, **kwargs)

Save the file to a path.

Parameters:

filename (StrOrBytesPath) – The filename of the file to be created and have this saved to.

Returns:

The number of bytes written.

Return type:

int

property url: str

The URL for this sticker.

await game()

Fetches this sticker’s associated game.

Return type:

steam.StatefulGame

Reviews

class steam.Review

Represents a review for a game.

id: int
author: ReviewUser
game: ReviewGame
recommended: bool
language: Language
content: str
created_at: datetime
updated_at: datetime
votes_helpful: int
votes_funny: int
weighted_vote_score: float
commentable: Optional[bool]
comment_count: int
steam_purchase: Optional[bool]
received_compensation: bool
await award(award)

Add an Award to this piece of user generated content.

Parameters:

award (Award) – The award to add.

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

written_during_early_access: bool
developer_response: Optional[str]
developer_responded_at: Optional[datetime]
reactions: Optional[list[steam.AwardReaction]]
await mark_helpful()

Mark this review as helpful.

await mark_not_helpful()

Mark this review as not helpful.

await mark_funny()

Mark this review as funny.

await edit(content, *, public=True, commentable=None, language=None, written_during_early_access=None, received_compensation=None)

Edit this review.

Parameters:
  • content (str) – The content of the review.

  • public (bool) – Whether the review should be shown publicly on your profile.

  • commentable (Optional[bool]) – Whether the review should be commentable.

  • language (Optional[Language]) – The language of the review. Defaults to the current value.

  • written_during_early_access (Optional[bool]) – Whether the review was written during early access. Defaults to the current value.

  • received_compensation (Optional[bool]) – Whether the user received compensation for this review. Defaults to the current value.

await delete()

Delete this review.

Roles

class steam.Role

Users

class steam.ClientUser

Represents your account.

x == y

Checks if two users are equal.

str(x)

Returns the user’s name.

name

The user’s username.

Type:

str

friends

A list of the ClientUser’s friends.

state

The current persona state of the account (e.g. LookingToTrade).

Type:

Optional[steam.enums.PersonaState]

game

The Game instance attached to the user. Is None if the user isn’t in a game or one that is recognised by the api.

Type:

Optional[steam.StatefulGame]

avatar_url

The avatar url of the user. Uses the large (184x184 px) image url.

Type:

Optional[str]

real_name

The user’s real name defined by them. Could be None.

Type:

Optional[str]

primary_clan

The user’s primary clan. Could be None

Type:

Optional[steam.Clan]

created_at

The time at which the user’s account was created. Could be None.

Type:

Optional[datetime.datetime]

last_logon

The last time the user logged into steam. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

last_logoff

The last time the user logged off from steam. Could be None (e.g. if they are currently online).

Type:

Optional[datetime.datetime]

last_seen_online

The last time the user could be seen online. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

country

The country code of the account. Could be None.

Type:

Optional[str]

flags

The persona state flags of the account.

Type:

Optional[steam.enums.PersonaStateFlag]

await friends()

Returns a list of the user’s friends.

Return type:

list[steam.user.Friend]

get_friend(id)

Get a friend from the client user’s friends list.

Return type:

Optional[steam.user.Friend]

await inventory(game, *, language=None)

Fetch a user’s Inventory for trading.

Parameters:
  • game (Game) – The game to fetch the inventory for.

  • language (Optional[Language]) – The language to fetch the inventory in. If None will default to the current language.

Raises:

Forbidden – The user’s inventory is private.

Return type:

steam.trade.BaseInventory[steam.Item]

await setup_profile()

Set up your profile if possible.

await clear_nicks()

Clears the client user’s nickname/alias history.

await profile_items(*, language=None)

Fetch all the client user’s profile items.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.OwnedProfileItems

await profile(*, language=None)

Fetch a user’s entire profile information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Note

This calls all the profile related functions to return a Profile object which has all the info set.

Return type:

steam.profile.ClientUserProfile

await profile_info()

The friend’s profile info.

Return type:

steam.ProfileInfo

await edit(*, name=None, real_name=None, url=None, summary=None, country=None, state=None, city=None, avatar=None)

Edit the client user’s profile. Any values that aren’t set will use their defaults.

Parameters:
  • name (str | None) – The new name you wish to go by.

  • real_name (str | None) – The real name you wish to go by.

  • url (str | None) – The custom url ending/path you wish to use.

  • summary (str | None) – The summary/description you wish to use.

  • country (str | None) – The country you want to be from.

  • state (str | None) – The state you want to be from.

  • city (str | None) – The city you want to be from.

  • avatar (Image | None) –

    The avatar you wish to use.

    Note

    This needs to be at least 184px x 184px.

Raises:

HTTPException – Editing your profile failed.

await badges()

Fetches the user’s UserBadgess.

Return type:

steam.UserBadges

await bans()

Fetches the user’s Bans.

Return type:

steam.Ban

await clans()

Fetches a list of Clans the user is in.

Return type:

list[steam.Clan]

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

community_url: Optional[str]
await equipped_profile_items(*, language=None)

The user’s equipped profile items.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.EquippedProfileItems

await favourite_badge()

The user’s favourite badge.

Return type:

Optional[steam.FavouriteBadge]

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

await fetch_review(game)

Fetch this user’s review for a game.

Parameters:

game (Game) – The games to fetch the reviews for.

Return type:

steam.Review

await fetch_reviews(*games)

Fetch this user’s review for games.

Parameters:

games (Game) – The games to fetch the reviews for.

Return type:

list[steam.Review]

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

await games(*, include_free=True)

Fetches the Games the user owns.

Parameters:

include_free (bool) – Whether to include free games in the list. Defaults to True.

Return type:

list[steam.game.UserGame]

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

await is_banned()

Specifies if the user is banned from any part of Steam.

Shorthand for:

bans = await user.bans()
bans.is_banned()
Return type:

bool

is_commentable()

Specifies if the user’s account can be commented on.

Return type:

bool

is_private()

Specifies if the user has a private profile.

Return type:

bool

is_valid()

Whether the SteamID is valid.

Return type:

bool

await level()

Fetches the user’s level if your account is premium, otherwise it’s cached.

Return type:

int

property mention: str

The string used to mention the user in chat.

await profile_customisation_info(*, language=None)

Fetch a user’s profile customisation information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.ProfileCustomisation

async for ... in published_files(*, game=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s PublishedFiles.

Examples

Usage:

async for file in user.published_files(limit=10):
    print("Author:", file.author, "Published:", file.name)

Flattening into a list:

files = await user.published_files(limit=50).flatten()
# files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • game (Optional[Game]) – The game to fetch published files in.

  • type (PublishedFileType) – The type of published file to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published file to fetch.

  • language (Optional[Language]) – The language to fetch the published file in. If None, the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Setting this to None will fetch all of the user’s published files.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

async for ... in reviews(*, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s Reviews.

Examples

Usage:

async for review in user.reviews(limit=10):
    print(f"Author: {review.author} {'recommended' if review.recommend 'doesn\'t recommend'} {review.game}")

Flattening into a list:

reviews = await user.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Setting this to None will fetch all the user’s reviews.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

await wishlist()

Get the WishlistGames the user has on their wishlist.

Return type:

list[steam.game.WishlistGame]

class steam.User

Represents a Steam user’s account.

x == y

Checks if two users are equal.

str(x)

Returns the user’s name.

name

The user’s username.

Type:

str

state

The current persona state of the account (e.g. LookingToTrade).

Type:

Optional[steam.enums.PersonaState]

game

The Game instance attached to the user. Is None if the user isn’t in a game or one that is recognised by the api.

Type:

Optional[steam.StatefulGame]

avatar_url

The avatar url of the user. Uses the large (184x184 px) image url.

Type:

Optional[str]

real_name

The user’s real name defined by them. Could be None.

Type:

Optional[str]

primary_clan

The user’s primary clan.

Type:

Optional[steam.Clan]

created_at

The time at which the user’s account was created. Could be None.

Type:

Optional[datetime.datetime]

last_logon

The last time the user logged into steam. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

last_logoff

The last time the user logged off from steam. Could be None (e.g. if they are currently online).

Type:

Optional[datetime.datetime]

last_seen_online

The last time the user could be seen online. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

country

The country code of the account. Could be None.

Type:

Optional[str]

flags

The persona state flags of the account.

Type:

Optional[steam.enums.PersonaStateFlag]

await add()

Sends a friend invite to the user to your friends list.

await remove()

Remove the user from your friends list.

await cancel_invite()

Cancels an invitation sent to the user. This effectively does the same thing as remove().

await block()

Blocks the user.

await unblock()

Unblocks the user.

await escrow(token=None)

Check how long any received items would take to arrive. None if the user has no escrow or has a private inventory.

Parameters:

token (Optional[str]) – The user’s trade offer token, not required if you are friends with the user.

Return type:

Optional[datetime.timedelta]

await send(content=None, *, trade=None, image=None)

Send a message, trade or image to an User.

Parameters:
  • content (Any) – The message to send to the user.

  • trade (TradeOffer | None) –

    The trade offer to send to the user.

    Note

    This will have its id attribute updated after being sent.

  • image (Image | None) – The image to send to the user.

Raises:
Returns:

The sent message only applicable if content is passed.

Return type:

Optional[steam.UserMessage]

is_friend()

Whether the user is in the ClientUser’s friends.

Return type:

bool

await badges()

Fetches the user’s UserBadgess.

Return type:

steam.UserBadges

await bans()

Fetches the user’s Bans.

Return type:

steam.Ban

await clans()

Fetches a list of Clans the user is in.

Return type:

list[steam.Clan]

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

community_url: Optional[str]
await equipped_profile_items(*, language=None)

The user’s equipped profile items.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.EquippedProfileItems

await favourite_badge()

The user’s favourite badge.

Return type:

Optional[steam.FavouriteBadge]

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

await fetch_review(game)

Fetch this user’s review for a game.

Parameters:

game (Game) – The games to fetch the reviews for.

Return type:

steam.Review

await fetch_reviews(*games)

Fetch this user’s review for games.

Parameters:

games (Game) – The games to fetch the reviews for.

Return type:

list[steam.Review]

await friends()

Fetch the list of the users friends.

Return type:

list[steam.User]

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

await games(*, include_free=True)

Fetches the Games the user owns.

Parameters:

include_free (bool) – Whether to include free games in the list. Defaults to True.

Return type:

list[steam.game.UserGame]

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

await is_banned()

Specifies if the user is banned from any part of Steam.

Shorthand for:

bans = await user.bans()
bans.is_banned()
Return type:

bool

is_commentable()

Specifies if the user’s account can be commented on.

Return type:

bool

is_private()

Specifies if the user has a private profile.

Return type:

bool

is_valid()

Whether the SteamID is valid.

Return type:

bool

await level()

Fetches the user’s level if your account is premium, otherwise it’s cached.

Return type:

int

property mention: str

The string used to mention the user in chat.

await profile(*, language=None)

Fetch a user’s entire profile information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Note

This calls all the profile related functions to return a Profile object which has all the info set.

Return type:

steam.Profile

await profile_customisation_info(*, language=None)

Fetch a user’s profile customisation information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.ProfileCustomisation

async for ... in published_files(*, game=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s PublishedFiles.

Examples

Usage:

async for file in user.published_files(limit=10):
    print("Author:", file.author, "Published:", file.name)

Flattening into a list:

files = await user.published_files(limit=50).flatten()
# files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • game (Optional[Game]) – The game to fetch published files in.

  • type (PublishedFileType) – The type of published file to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published file to fetch.

  • language (Optional[Language]) – The language to fetch the published file in. If None, the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Setting this to None will fetch all of the user’s published files.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

async for ... in reviews(*, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s Reviews.

Examples

Usage:

async for review in user.reviews(limit=10):
    print(f"Author: {review.author} {'recommended' if review.recommend 'doesn\'t recommend'} {review.game}")

Flattening into a list:

reviews = await user.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Setting this to None will fetch all the user’s reviews.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

await wishlist()

Get the WishlistGames the user has on their wishlist.

Return type:

list[steam.game.WishlistGame]

class steam.Friend

Represents a Steam user’s account.

x == y

Checks if two users are equal.

str(x)

Returns the user’s name.

name

The user’s username.

Type:

str

state

The current persona state of the account (e.g. LookingToTrade).

Type:

Optional[steam.enums.PersonaState]

game

The Game instance attached to the user. Is None if the user isn’t in a game or one that is recognised by the api.

Type:

Optional[steam.StatefulGame]

avatar_url

The avatar url of the user. Uses the large (184x184 px) image url.

Type:

Optional[str]

real_name

The user’s real name defined by them. Could be None.

Type:

Optional[str]

primary_clan

The user’s primary clan.

Type:

Optional[steam.Clan]

created_at

The time at which the user’s account was created. Could be None.

Type:

Optional[datetime.datetime]

last_logon

The last time the user logged into steam. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

last_logoff

The last time the user logged off from steam. Could be None (e.g. if they are currently online).

Type:

Optional[datetime.datetime]

last_seen_online

The last time the user could be seen online. This is only None if user hasn’t been updated from the websocket.

Type:

Optional[datetime.datetime]

country

The country code of the account. Could be None.

Type:

Optional[str]

flags

The persona state flags of the account.

Type:

Optional[steam.enums.PersonaStateFlag]

await add()

Sends a friend invite to the user to your friends list.

property avatar_url

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await badges()

Fetches the user’s UserBadgess.

Return type:

steam.UserBadges

await bans()

Fetches the user’s Bans.

Return type:

steam.Ban

await block()

Blocks the user.

await cancel_invite()

Cancels an invitation sent to the user. This effectively does the same thing as remove().

await clans()

Fetches a list of Clans the user is in.

Return type:

list[steam.Clan]

await comment(content, *, subscribe=True)

Post a comment to a comments section.

Parameters:
  • content (str) – The message to add to the comment section.

  • subscribe (bool) – Whether to subscribe to notifications on any future activity in this comment’s thread.

Returns:

The created comment.

Return type:

steam.Comment

property comment_permissions

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)

An AsyncIterator for accessing a comment section’s Comment objects.

Examples

Usage:

async for comment in commentable.comments(limit=10):
    print("Author:", comment.author, "Said:", comment.content)

Flattening into a list:

comments = await commentable.comments(limit=50).flatten()
# comments is now a list of Comment

All parameters are optional.

Parameters:
  • oldest_first (bool) – Whether or not to request comments with the oldest comments first or last. Defaults to False.

  • limit (Optional[int]) – The maximum number of comments to search through. Default is None which will fetch the all the comments in the comments section.

  • before (Optional[datetime]) – A time to search for comments before.

  • after (Optional[datetime]) – A time to search for comments after.

Yields:

Comment

property community_url

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property country

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property created_at

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await equipped_profile_items(*, language=None)

The user’s equipped profile items.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.EquippedProfileItems

await escrow(token=None)

Check how long any received items would take to arrive. None if the user has no escrow or has a private inventory.

Parameters:

token (Optional[str]) – The user’s trade offer token, not required if you are friends with the user.

Return type:

Optional[datetime.timedelta]

await favourite_badge()

The user’s favourite badge.

Return type:

Optional[steam.FavouriteBadge]

await fetch_comment(id)

Fetch a comment by its ID.

Parameters:

id (int) – The ID of the comment to fetch.

Return type:

steam.Comment

await fetch_review(game)

Fetch this user’s review for a game.

Parameters:

game (Game) – The games to fetch the reviews for.

Return type:

steam.Review

await fetch_reviews(*games)

Fetch this user’s review for games.

Parameters:

games (Game) – The games to fetch the reviews for.

Return type:

list[steam.Review]

property flags

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await friends()

Fetch the list of the users friends.

Return type:

list[steam.User]

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

property game

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await games(*, include_free=True)

Fetches the Games the user owns.

Parameters:

include_free (bool) – Whether to include free games in the list. Defaults to True.

Return type:

list[steam.game.UserGame]

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property id64: ID64

The SteamID’s 64-bit ID.

property instance: InstanceFlag

The instance of the SteamID.

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

await invite_to_clan(clan)

Invites the user to a Clan.

Parameters:

clan (Clan) – The clan to invite the user to.

await invite_to_group(group)

Invites the user to a Group.

Parameters:

group (Group) – The group to invite the user to.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

await is_banned()

Specifies if the user is banned from any part of Steam.

Shorthand for:

bans = await user.bans()
bans.is_banned()
Return type:

bool

is_commentable()

Specifies if the user’s account can be commented on.

Return type:

bool

is_friend()

Whether the user is in the ClientUser’s friends.

Return type:

bool

is_private()

Specifies if the user has a private profile.

Return type:

bool

is_valid()

Whether the SteamID is valid.

Return type:

bool

property last_logoff

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property last_logon

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property last_seen_online

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await level()

Fetches the user’s level if your account is premium, otherwise it’s cached.

Return type:

int

property mention: str

The string used to mention the user in chat.

property name

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await owns(game)

Whether the game is owned by this friend.

Parameters:

game (Game) – The game you want to check the ownership of.

Return type:

bool

property primary_clan

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property privacy_state

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await profile(*, language=None)

Fetch a user’s entire profile information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Note

This calls all the profile related functions to return a Profile object which has all the info set.

Return type:

steam.profile.FriendProfile

await profile_customisation_info(*, language=None)

Fetch a user’s profile customisation information.

Parameters:

language (Optional[Language]) – The language to fetch the profile items in. If None the current language is used

Return type:

steam.ProfileCustomisation

await profile_info()

The friend’s profile info.

Return type:

steam.ProfileInfo

property profile_state

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

async for ... in published_files(*, game=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s PublishedFiles.

Examples

Usage:

async for file in user.published_files(limit=10):
    print("Author:", file.author, "Published:", file.name)

Flattening into a list:

files = await user.published_files(limit=50).flatten()
# files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • game (Optional[Game]) – The game to fetch published files in.

  • type (PublishedFileType) – The type of published file to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published file to fetch.

  • language (Optional[Language]) – The language to fetch the published file in. If None, the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Setting this to None will fetch all of the user’s published files.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

property real_name

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await remove()

Remove the user from your friends list.

async for ... in reviews(*, limit=None, before=None, after=None)

An AsyncIterator for accessing a user’s Reviews.

Examples

Usage:

async for review in user.reviews(limit=10):
    print(f"Author: {review.author} {'recommended' if review.recommend 'doesn\'t recommend'} {review.game}")

Flattening into a list:

reviews = await user.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Setting this to None will fetch all the user’s reviews.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property rich_presence

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

await send(content=None, *, trade=None, image=None)

Send a message, trade or image to an User.

Parameters:
  • content (Optional[Any]) – The message to send to the user.

  • trade (Optional[TradeOffer]) –

    The trade offer to send to the user.

    Note

    This will have its id attribute updated after being sent.

  • image (Optional[Image]) – The image to send to the user.

Raises:
Returns:

The sent message only applicable if content is passed.

Return type:

Optional[steam.UserMessage]

property state

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property trade_url

attrgetter(attr, …) –> attrgetter object

Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter(‘name’), the call f(r) returns r.name. After g = attrgetter(‘name’, ‘date’), the call g(r) returns (r.name, r.date). After h = attrgetter(‘name.first’, ‘name.last’), the call h(r) returns (r.name.first, r.name.last).

property type: Type

The Steam type of the SteamID.

await unblock()

Unblocks the user.

property universe: Universe

The Steam universe of the SteamID.

await wishlist()

Get the WishlistGames the user has on their wishlist.

Return type:

list[steam.game.WishlistGame]

Data-Classes

There are a few classes that can be constructed by the user, these include.

Game

Attributes
Methods
class steam.Game(*, id=None, name=None, title=None, context_id=None)

Represents a Steam game.

name

The game’s name.

Type:

Optional[str]

id

The game’s app ID.

Type:

int

context_id

The context id of the game normally 2.

Type:

int

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

There are some predefined games which are:

Game Name

Accessed via

Team Fortress 2

steam.TF2

DOTA2

steam.DOTA2

Counter Strike Global-Offensive

steam.CSGO

Left for Dead 2

steam.LFD2

Steam

steam.STEAM

Games can be manually constructed using there app id eg:

my_rust_instance = steam.Game(id=252490, name="Rust")
# this can then be used for trading a game name is not required for this
# but it is for setting in game statuses if the game isn't a Steam game.
steam.CUSTOM_GAME(name: str) Game

Create a custom game instance for change_presence(). The Game.id will be set to 15190414816125648896 and the Game.context_id to None.

Example:

await client.change_presence(game=steam.CUSTOM_GAME("my cool game"))
Parameters:

name – The name of the game to set your playing status to.

Return type:

Game

Attributes
Methods
class steam.game.StatefulGame

Games that have state.

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[Any]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

steam.Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[steam.game.DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

steam.game.FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

steam.Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

tuple[list[steam.Friend], list[steam.Friend]]

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[steam.Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

steam.GameInfo

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await packages(*, language=None)

Fetch the game’s packages.

Parameters:

language (Language | None) – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[steam.FetchedGamePackage]

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (int | None) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Language | None) – The language the review is in.

Return type:

steam.Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (int | None) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

class steam.UserGame

Represents a Steam game fetched by steam.User.games()

playtime_forever

The total time the game has been played for.

Type:

datetime.timedelta

icon_url

The icon url of the game.

Type:

str

playtime_two_weeks

The amount of time the user has played the game in the last two weeks.

Type:

datetime.timedelta

playtime_windows

The total amount of time the user has played the game on Windows.

Type:

datetime.timedelta

playtime_mac_os

The total amount of time the user has played the game on macOS.

Type:

datetime.timedelta

playtime_linux

The total amount of time the user has played the game on Linux.

Type:

datetime.timedelta

last_played_at

The time the user last played this game at.

Type:

datetime.datetime

has_visible_stats()

Whether the game has publicly visible stats.

Return type:

bool

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[Any]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

steam.Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[steam.game.DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

steam.game.FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

steam.Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

tuple[list[steam.Friend], list[steam.Friend]]

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[steam.Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

steam.GameInfo

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await packages(*, language=None)

Fetch the game’s packages.

Parameters:

language (Optional[Language]) – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[steam.FetchedGamePackage]

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Optional[Language]) – The language the review is in.

Return type:

steam.Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

class steam.WishlistGame

Represents a Steam game fetched by steam.User.wishlist().

priority

The priority of the game in the wishlist.

Type:

int

added_at

The time that the game was added to their wishlist.

Type:

datetime.datetime

created_at

The time the game was uploaded at.

Type:

datetime.datetime

background_url

The background URL of the game.

Type:

str

rank

The global rank of the game by popularity.

Type:

int

review_status

The review status of the game.

Type:

Any

score

The score of the game out of ten.

Type:

int

screenshots

The screenshots of the game.

Type:

list[str]

tags

The tags of the game.

Type:

list[str]

total_reviews

The total number reviews for the game.

Type:

int

type

The type of the app.

Type:

str

logo_url

The logo url of the game.

Type:

str

is_free()

Whether the game is free to download.

Return type:

bool

is_on_windows()

Whether the game is playable on Windows.

Return type:

bool

is_on_mac_os()

Whether the game is playable on macOS.

Return type:

bool

is_on_linux()

Whether the game is playable on Linux.

Return type:

bool

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[Any]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

steam.Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[steam.game.DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

steam.game.FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

steam.Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

tuple[list[steam.Friend], list[steam.Friend]]

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[steam.Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

steam.GameInfo

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await packages(*, language=None)

Fetch the game’s packages.

Parameters:

language (Optional[Language]) – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[steam.FetchedGamePackage]

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Optional[Language]) – The language the review is in.

Return type:

steam.Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

class steam.FetchedGame

Represents a Steam game fetched by steam.Client.fetch_game().

created_at

The time the game was uploaded at.

Type:

Optional[datetime.datetime]

background_url

The background URL of the game.

Type:

str

type

The type of the app.

logo_url

The logo URL of the game.

Type:

str

partial_dlc

The game’s downloadable content.

Type:

list[steam.StatefulGame]

website_url

The website URL of the game.

Type:

Optional[str]

developers

The developers of the game.

Type:

list[str]

publishers

The publishers of the game.

Type:

list[str]

description

The short description of the game.

Type:

str

full_description

The full description of the game.

Type:

str

movies

A list of the game’s movies, each of which has name, id, url and optional created_at attributes.

Type:

Optional[list[steam.game.Movie]]

price_overview

The price overview of the game.

Type:

steam.game.GamePriceOverview

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[Any]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

steam.Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[steam.game.DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

steam.FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

steam.Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

tuple[list[steam.Friend], list[steam.Friend]]

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[steam.Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

steam.GameInfo

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Optional[Language]) – The language the review is in.

Return type:

steam.Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

await packages(*, languages=None)

Fetch the game’s packages.

Parameters:

language – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[steam.FetchedGamePackage]

is_free()

Whether the game is free to download.

Return type:

bool

is_on_windows()

Whether the game is playable on Windows.

Return type:

bool

is_on_mac_os()

Whether the game is playable on macOS.

Return type:

bool

is_on_linux()

Whether the game is playable on Linux.

Return type:

bool

class steam.DLC

Represents DLC (downloadable content) for a game.

created_at

The time the DLC was released at.

Type:

datetime.datetime

logo_url

The logo url of the DLC.

Type:

str

price_overview

A price overview for the DLC.

Type:

steam.game.PartialGamePriceOverview

is_free()

Whether the game is free to download.

Return type:

bool

is_on_windows()

Whether the game is playable on Windows.

Return type:

bool

is_on_mac_os()

Whether the game is playable on macOS.

Return type:

bool

is_on_linux()

Whether the game is playable on Linux.

Return type:

bool

await add_free_licenses()

Request the free licenses for this game.

Raises:

ValueError – No licenses were granted.

Return type:

list[Any]

await clan()

Fetch this game’s clan.

This can be useful to get a Game’s updates.

clan = await game.clan()
async for update in clan.announcements().filter(
    lambda announcement: announcement.type in (steam.ClanEvent.MajorUpdate, steam.ClanEvent.SmallUpdate)
):
    ...  # do something with the update
Raises:

ValueError – This game has no associated clan.

Return type:

steam.Clan

await dlc(*, language=None)

Fetch the game’s DLC.

Parameters:

language (Optional[Language]) – The language to fetch the DLC in. If None, the current language will be used.

Return type:

list[steam.DLC]

await fetch(*, language=None)

Shorthand for:

game = await client.fetch_game(game)
Return type:

steam.FetchedGame

await fetch_manifest(*, id, depot_id, branch='public', password_hash='')

Fetch a CDN manifest for a game.

Parameters:
  • id (int) – The ID of the manifest to fetch.

  • depot_id (int) – The ID of the manifest’s associated depot.

Return type:

steam.Manifest

await friend_thoughts()

Fetch the client user’s friends who recommended and didn’t recommend this game in a review.

Return type:

tuple[list[steam.Friend], list[steam.Friend]]

await friends_who_own()

Fetch the users in your friend list who own this game.

Return type:

list[steam.Friend]

await info()

Shorthand for:

(info,) = await client.fetch_product_info(games=[game])
Return type:

steam.GameInfo

is_steam_game()

Whether the game could be a Steam game.

Return type:

bool

async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')

An AsyncIterator for accessing a steam.Game’s steam.Manifests.

Examples

Usage:

async for manifest in game.manifests(limit=10):
    print("Manifest:", manifest.name)
    print(f"Contains {len(manifest.paths)} manifests")

Flattening into a list:

manifests = await game.manifests(limit=50).flatten()
# manifests is now a list of Manifest

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of Manifests to return.

  • before (Optional[datetime]) – The time to get manifests before.

  • after (Optional[datetime]) – The time to get manifests after.

  • branch (str) – The name of the branch to fetch manifests from.

  • password (Optional[str]) – The password for the branch, if any.

  • password_hash (str) – The hashed password for a manifest.

Yields:

Manifest

await packages(*, language=None)

Fetch the game’s packages.

Parameters:

language (Optional[Language]) – The language to fetch the packages in. If None, the current language will be used.

Return type:

list[steam.FetchedGamePackage]

await player_count()

The games current player count.

Return type:

int

async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)

An AsyncIterator for accessing a game’s steam.PublishedFiles.

Examples

Usage:

async for published_file in game.published_files(limit=10):
    print("Published file:", published_file.name)
    print("Published at:", published_file.created_at)
    print("Published by:", published_file.author)

Flattening into a list:

published_files = await game.published_files(limit=50).flatten()
# published_files is now a list of PublishedFile

All parameters are optional.

Parameters:
  • type (PublishedFileQueryFileType) – The type of published files to fetch.

  • revision (PublishedFileRevision) – The desired revision of the published files to fetch.

  • language (Optional[Language]) – The language to fetch the published files in. If None the current language is used.

  • limit (Optional[int]) – The maximum number of published files to search through. Default is 100. Setting this to None will fetch all the game’s published files, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for published files before.

  • after (Optional[datetime]) – A time to search for published files after.

Yields:

PublishedFile

await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)

Review a game.

Parameters:
  • content (str) – The content of the review.

  • recommend (bool) – Whether you recommended the game.

  • public (bool) – Whether the review should be public.

  • commentable (bool) – Whether the review should allow comments.

  • received_compensation (bool) – Whether you received compensation for this review.

  • language (Optional[Language]) – The language the review is in.

Return type:

steam.Review

async for ... in reviews(*, limit=100, before=None, after=None)

An AsyncIterator for accessing a steam.Game’s steam.Reviews.

Examples

Usage:

async for review in game.reviews(limit=10):
    print("Reviewer:", review.author)
    print("Said:", review.content)

Flattening into a list:

reviews = await game.reviews(limit=50).flatten()
# reviews is now a list of Review

All parameters are optional.

Parameters:
  • limit (Optional[int]) – The maximum number of reviews to search through. Default is 100. Setting this to None will fetch all the game’s reviews, but this will be a very slow operation.

  • before (Optional[datetime]) – A time to search for reviews before.

  • after (Optional[datetime]) – A time to search for reviews after.

Yields:

Review

property title: str | None

The game’s name.

Deprecated since version 0.8.0: Use name instead.

property url: str

What should be the game’s url on steamcommunity if applicable.

Steam IDs

class steam.SteamID(id=0, type=None, universe=None, instance=None)

Convert a Steam ID between its various representations.

Note

See steam.utils.make_id64() for the full parameter list.

property instance: InstanceFlag

The instance of the SteamID.

property type: Type

The Steam type of the SteamID.

property universe: Universe

The Steam universe of the SteamID.

property id64: ID64

The SteamID’s 64-bit ID.

property id: ID32

The SteamID’s 32-bit ID.

property id2: str

The SteamID’s ID 2.

e.g STEAM_1:0:1234.

property id2_zero: str

The SteamID’s ID 2 accounted for bugged GoldSrc and Orange Box games.

Note

In these games the accounts universe, 1 for Type.Public, should be the X component of STEAM_X:0:1234 however, this was bugged and the value of X was 0.

e.g STEAM_0:0:1234.

property id3: str

The SteamID’s ID 3.

e.g [U:1:1234].

property invite_code: str | None

The SteamID’s invite code in the s.team invite code format.

e.g. cv-dgb.

property invite_url: str | None

The SteamID’s full invite code URL.

e.g https://s.team/p/cv-dgb.

property community_url: str | None

The SteamID’s community url.

e.g https://steamcommunity.com/profiles/123456789.

is_valid()

Whether the SteamID is valid.

Return type:

bool

staticmethod await from_url(url, session=None)

A helper function creates a SteamID instance from a Steam community url.

Note

See id64_from_url() for the full parameter list.

Return type:

Optional[steam.abc.SteamID]

TradeOffers

class steam.TradeOffer(*, token: str | None = ..., message: str | None = ..., item_to_send: Asset = ..., item_to_receive: Asset = ...)
class steam.TradeOffer(*, token: str | None = ..., message: str | None = ..., items_to_send: Sequence[Asset], items_to_receive: Sequence[Asset])

Represents a trade offer from/to send to a User. This can also be used in steam.User.send().

Parameters:
  • item_to_send (Asset | None) – The item to send with the trade offer. Mutually exclusive to items_to_send.

  • item_to_receive (Asset | None) – The item to receive with the trade offer. Mutually exclusive to items_to_receive.

  • items_to_send (Sequence[steam.Asset]) – The items you are sending to the other user. Mutually exclusive to item_to_send.

  • items_to_receive (Sequence[steam.Asset]) – The items you are receiving from the other user. Mutually exclusive to item_to_receive.

  • token (Optional[str]) – The trade token used to send trades to users who aren’t on the ClientUser’s friend’s list.

  • message (Optional[str]) – The offer message to send with the trade.

partner

The trade offer partner. This should only ever be a SteamID if the partner’s profile is private.

Type:

Union[steam.User, steam.abc.SteamID]

items_to_send

A list of items to send to the partner.

Type:

Sequence[steam.Asset]

items_to_receive

A list of items to receive from the partner.

Type:

Sequence[steam.Asset]

state

The offer state of the trade for the possible types see TradeOfferState.

Type:

int

message

The message included with the trade offer.

Type:

Optional[str]

id

The trade’s offer ID.

Type:

int

created_at

The time at which the trade was created.

Type:

Optional[datetime.datetime]

updated_at

The time at which the trade was last updated.

Type:

Optional[datetime.datetime]

expires

The time at which the trade automatically expires.

Type:

Optional[datetime.datetime]

escrow

The time at which the escrow will end. Can be None if there is no escrow on the trade.

Warning

This isn’t likely to be accurate, use User.escrow() instead if possible.

Type:

Optional[datetime.timedelta]

await confirm()

Confirms the trade offer. This rarely needs to be called as the client handles most of these.

Raises:
await accept()

Accepts the trade offer.

Note

This also calls confirm() (if necessary) so you don’t have to.

Raises:
await decline()

Declines the trade offer.

Raises:

ClientException – The trade is either not active, already declined or not from the ClientUser.

await cancel()

Cancels the trade offer.

Raises:

ClientException – The trade is either not active or already cancelled.

await receipt()

Get the receipt for a trade offer and the updated asset ids for the trade.

Returns:

A trade receipt. .. source:: steam.TradeOfferReceipt

Return type:

tuple[list[steam.MovedItem], list[steam.MovedItem]]

await counter(trade)

Counter a trade offer from an User.

Parameters:

trade (TradeOffer) – The trade offer to counter with.

Raises:

ClientException – The trade from the ClientUser or it isn’t active.

property url: str

The URL of the trade offer.

is_gift()

Helper method that checks if an offer is a gift to the ClientUser

Return type:

bool

is_our_offer()

Whether the offer was created by the ClientUser.

Return type:

bool

Images

class steam.Image(fp, *, spoiler=False)

A wrapper around common image files. Used for steam.User.send().

Parameters:
  • fp (ImageIO) – An image or path-like to pass to open().

  • spoiler (bool) – Whether to mark the image as a spoiler.

Note

Currently supported image types include:
  • PNG

  • JPG/JPEG

  • GIF

Exceptions

The following exceptions are thrown by the library.

exception steam.SteamException

Base exception class for steam.py.

exception steam.ClientException

Exception that’s thrown when something in the client fails.

Subclass of SteamException.

exception steam.LoginError

Exception that’s thrown when a login fails.

Subclass of SteamException.

exception steam.InvalidCredentials

Exception that’s thrown when credentials are incorrect.

Subclass of LoginError.

exception steam.NoCMsFound

Exception that’s thrown when no CMs can be found to connect to.

Subclass of LoginError.

exception steam.AuthenticatorError

Exception that’s thrown when Steam cannot authenticate your details.

Subclass of LoginError.

exception steam.ConfirmationError

Exception that’s thrown when a confirmation fails.

Subclass of AuthenticatorError.

exception steam.HTTPException(response, data)

Exception that’s thrown for any web API error.

Subclass of SteamException.

response

The response of the failed HTTP request.

message

The message associated with the error. Could be an empty string if no message can parsed.

status

The status code of the HTTP request.

code

The Steam specific error code for the failure.

exception steam.Forbidden(response, data)

Exception that’s thrown when status code 403 occurs.

Subclass of HTTPException.

exception steam.NotFound(response, data)

Exception that’s thrown when status code 404 occurs.

Subclass of HTTPException.

exception steam.WSException(msg)

Exception that’s thrown for any websocket error. Similar to HTTPException.

Subclass of SteamException.

msg

The received protobuf.

message

The message that Steam sent back with the request, could be None.

code

The Steam specific error code for the failure.

exception steam.WSForbidden(msg)

Exception that’s thrown when the websocket returns an Result that means we do not have permission to perform an action. Similar to Forbidden.

Subclass of WSException.

exception steam.WSNotFound(msg)

Exception that’s thrown when the websocket returns an Result that means the object wasn’t found. Similar to NotFound.

Subclass of WSException.

exception steam.InvalidSteamID(id, msg=None)

Exception that’s thrown when a SteamID cannot be valid.

Subclass of SteamException.

id

The invalid id.

Exception Hierarchy