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(**options)#
Represents a client connection that connects to Steam. This class is used to interact with the Steam API and CMs.
- async with x
Initialises the client and closes it when the context is exited.
- 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
.intents – The intents you wish to start the client with.
max_messages – The maximum number of messages to store in the internal cache, default is 1000.
app – An app to set your status as on connect. This will take precedence over any apps set using
apps
as your current status.apps – A list of apps 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 extensionon_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 toTrue
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 trades: Sequence[TradeOffer[Asset[User], Asset[ClientUser], User]]#
A read-only list of all the trades the connected client can see.
- 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 effects: Sequence[ClientEffect]#
A read-only list of all the effects the client has.
- property latency: float#
Measures latency between a heartbeat send and the heartbeat interval in seconds.
- property refresh_token: str | None#
The refresh token for the logged in account, can be used to login.
- await code()#
Get the current steam guard code.
Warning
This will read from
sys.stdin
if no shared_secret was passed tologin()
.- Return type:
- @event(coro)#
A decorator that registers 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:
F
- run(username: str, password: str, *, shared_secret: str = ..., identity_secret: str = ..., debug: bool = False) object #
- run(*, refresh_token: str, shared_secret: str = ..., identity_secret: str = ..., debug: bool = False) object
A blocking method to start and run the client.
Shorthand for:
async def main(): async with client: await client.login(...) asyncio.run(main())
It is not recommended to subclass this method, it is normally favourable to subclass
login()
as it is a coroutine.Note
This takes the same arguments as
login()
.- Return type:
- 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()
andis_ready()
both returnFalse
. This also clears the internal cache.
- await login(username: str, password: str, *, shared_secret: str = None, identity_secret: str = None) None #
- await login(*, refresh_token: str, shared_secret: str = None, identity_secret: str = None) None
Initialize a connection to a Steam CM and login.
If no
shared_secret
is passed, you will have to manually enter a Steam guard code usingcode()
.- Parameters:
username – The username of the account to login to.
password – The password of the account to login to.
shared_secret – The shared secret for the account to login to.
identity_secret – The identity secret for the account to login to.
refresh_token – The refresh token of the account to login to.
- await anonymous_login()#
Initialize a connection to a Steam CM and login anonymously.
- get_user(id, /)#
Returns a user from cache with a matching ID or
None
if the user was not found.
- await fetch_user(id, /)#
Fetches a user with a matching ID.
- await fetch_users(*ids)#
Fetches a list of
User
.Note
The
User
objects returned are unlikely to retain the order they were originally in.
- 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:
TradeOffer | None
- await fetch_trade(id, /, *, language=None)#
Fetches a trade with a matching ID or
None
if the trade was not found.- Parameters:
- Return type:
TradeOffer[Item[User], Item[ClientUser], User] | None
- get_group(id, /)#
Get a group from cache with a matching ID or
None
if the group was not found.
- get_clan(id, /)#
Get a clan from cache with a matching ID or
None
if the group was not found.
- await fetch_clan(id, /)#
Fetches a clan from the websocket with a matching ID.
- await create_clan(name, /, *, abbreviation=None, community_url=None, public=True, headline=None, summary=None, language=None, country=None, state=None, city=None, apps=None, avatar=None)#
Create a clan.
- Parameters:
name (str) – The name of the clan.
avatar (Media | None) – The avatar of the clan.
abbreviation (str | None) – The abbreviation of the clan.
community_url (URL_ | str | None) – The community URL of the clan.
public (bool) – Whether the clan is public.
headline (str | None) – The headline of the clan.
summary (str | None) – The summary of the clan.
language (Language | None) – The language of the clan.
country (str | None) – The country of the clan.
state (str | None) – The state of the clan.
city (str | None) – The city of the clan.
apps (Iterable[App] | None) – The apps the clan is associated with.
- Return type:
- await create_group(name, /, *, members, avatar=None, tagline=None)#
Create a group.
- get_app(id, /)#
Creates a
PartialApp
instance from its ID.- Parameters:
id (int) – The app id of the app.
- Return type:
PartialApp[None]
- await fetch_app(id, /, *, language=None)#
Fetch an app from its ID.
- Parameters:
- Raises:
ValueError – Passed id isn’t for a valid app.
- Return type:
- get_package(id, /)#
Creates a
PartialPackage
from its ID.- Parameters:
id (int) – The ID of the package.
- Return type:
- await fetch_package(id, /, *, language=None)#
Fetch a package from its ID.
- Parameters:
- Raises:
ValueError – Passed id isn’t for a valid package.
- Return type:
- await redeem_package(id, /)#
Redeem a promotional free licenses package from its ID.
- get_bundle(id, /)#
Creates a
PartialBundle
instance from its ID.- Parameters:
id (int) – The ID of the bundle.
- Return type:
- await fetch_bundle(id, /, *, language=None)#
Fetch a bundle from its ID.
- Parameters:
- Return type:
- await fetch_server(*, id: int) GameServer | None #
- await fetch_server(*, ip: IPAdress | str, port: int = None) GameServer | None
Fetch a
GameServer
from its ip and port or its Steam ID orNone
if fetching the server failed.- Parameters:
ip – The ip of the server.
port – The port of the server.
id – The ID64 of the game server. If passed, it makes a call to the master server to fetch its ip and port.
Note
Passing an
ip
,port
andid
to this function will raise anTypeError
.- Return type:
GameServer | None
- await fetch_servers(query=None, /, *, limit=100)#
Query game servers.
- Parameters:
See also
- Return type:
- await fetch_product_info(*, apps: Collection[App]) list[AppInfo] #
- await fetch_product_info(*, packages: Collection[Package]) list[PackageInfo]
- await fetch_product_info(*, apps: Collection[App], packages: Collection[Package]) tuple[list[AppInfo], list[PackageInfo]]
Fetch product info.
- Parameters:
apps – The apps to fetch info on.
packages – The packages to fetch info on.
- Return type:
list[AppInfo] | list[PackageInfo] | tuple[list[AppInfo], list[PackageInfo]]
- await fetch_store_item(*, apps: Sequence[App], language: Language | None = None) list[AppStoreItem] #
- await fetch_store_item(*, packages: Sequence[Package], language: Language | None = None) list[PackageStoreItem]
- await fetch_store_item(*, bundles: Sequence[Bundle], language: Language | None = None) list[BundleStoreItem]
- await fetch_store_item(*, apps: Sequence[App], packages: Sequence[Package], language: Language | None = None) tuple[list[AppStoreItem], list[PackageStoreItem]]
- await fetch_store_item(*, packages: Sequence[Package], bundles: Sequence[Bundle], language: Language | None = None) tuple[list[PackageStoreItem], list[BundleStoreItem]]
- await fetch_store_item(*, apps: Sequence[App], bundles: Sequence[Bundle], language: Language | None = None) tuple[list[AppStoreItem], list[BundleStoreItem]]
- await fetch_store_item(*, apps: Sequence[App], packages: Sequence[Package], bundles: Sequence[Bundle], language: Language | None = None) tuple[list[AppStoreItem], list[PackageStoreItem], list[BundleStoreItem]]
Fetch store items.
- Parameters:
apps – The apps to fetch store items for.
packages – The packages to fetch store items for.
bundles – The bundles to fetch store items for.
language – The language to fetch the store items in. If
None
, the default language is used.
- Return type:
Any
- await register_cd_key(key, /)#
Register a CD key.
- Parameters:
key (str) – The CD key to register.
- Return type:
- 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile | None
- 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 (Language | None) – The language to fetch the published files in. If
None
, the current language is used.
- Return type:
list[PublishedFile | None]
- await create_post(content, /, app=None)#
Create a post.
- Parameters:
- Return type:
- async for ... in user_news(*, limit=None, before=None, after=None, app=None, flags=None, language=None)#
Fetch news for the user.
- Parameters:
limit (int | None) – The maximum number of news entries to fetch.
before (datetime.datetime | None) – The date to fetch news before.
after (datetime.datetime | None) – The date to fetch news after.
app (App | None) – The app to fetch news entries related to.
flags (UserNewsType | None) – The type of news to fetch.
language (Language | None) – The language to fetch the news in. If
None
, the current language is used.
- Return type:
AsyncGenerator[UserNews, None]
- async for ... in trade_history(*, limit=100, before=None, after=None, language=None, include_failed=True)#
An asynchronous iterator for accessing a
steam.ClientUser
’ssteam.TradeOffer
objects.Examples
Usage:
async for trade in client.trade_history(limit=10): items = [getattr(item, "name", str(item.id)) for item in trade.receiving] items = ", ".join(items) or "Nothing" print("Partner:", trade.user) print("Sent:", items)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of trades to search through. Default is
100
. Setting this toNone
will fetch all of the user’s trades, but this will be a very slow operation.before (datetime.datetime | None) – A time to search for trades before.
after (datetime.datetime | None) – A time to search for trades after.
language (Language | None) – The language to fetch the trade in.
None
uses the current language.include_failed (bool) – Whether to include trades that failed.
- Yields:
- async for ... in all_apps(*, limit=None, modified_after=None, include_games=True, include_dlc=True, include_software=True, include_videos=True, include_hardware=True)#
An asynchronous iterator over all the apps on Steam.
- Parameters:
limit (int | None) – The maximum number of apps to search through. Default is
None
. Setting this toNone
will fetch all of the apps, but this will be a very slow operation.modified_after (datetime.datetime | None) – A time to search for apps after.
include_games (bool) – Whether to include games.
include_dlc (bool) – Whether to include DLC.
include_software (bool) – Whether to include software.
include_videos (bool) – Whether to include videos.
include_hardware (bool) – Whether to include hardware.
- Yields:
AppListApp
- await change_presence(*, app=None, apps=None, state=None, ui_mode=None, flags=None, force_kick=False)#
Set your status.
- Parameters:
app (App | None) – An app to set your status as.
apps (Iterable[App] | None) – A list of apps to set your status to.
state (PersonaState | None) –
The state to show your account as.
Warning
Setting your status to
Offline
, will stop you receiving persona state updates and by extensionon_user_update()
will stop being dispatched.ui_mode (UIMode | None) – The UI mode to set your status to.
flags (PersonaStateFlag | None) – 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:
TradeURLInfo
- await wait_until_ready()#
Waits until the client’s internal cache is all ready.
- await fetch_price(name, app, currency=None)#
Fetch the
PriceOverview
for an item.- Parameters:
- Return type:
- await fetch_price_history(name, app, currency=None)#
Fetch the price history for an item.
- async for ... in fetch_listings(name, app)#
Fetch the listings for an item.
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True)#
-
- Return type:
AsyncGenerator[MarketSearchItem, None]
- 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 on_authentication_ticket_update(ticket, response, state, /)#
Called when the client’s authentication ticket is updated.
- Parameters:
ticket (steam.AuthenticationTicket) – The updated ticket.
response (steam.AuthSessionResponse) – The response code from the CM.
state (int) – The state of the ticket.
- 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'], *, check: Callable[[TradeOffer], bool] = <return_true>, timeout: float | None = None) TradeOffer
- await wait_for(event: ~typing.Literal['trade_update'], *, check: Callable[[TradeOffer, TradeOffer], bool] = <return_true>, timeout: float | None = None) tuple[TradeOffer, TradeOffer]
- 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['invite', 'invite_accept', 'invite_decline'], *, check: Callable[[UserInvite | ClanInvite | GroupInvite | AppInvite], bool] = <return_true>, timeout: float | None = None) UserInvite | ClanInvite | GroupInvite | AppInvite
- 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['authentication_ticket_update'], *, check: ~collections.abc.Callable[[~steam.app.AuthenticationTicket, ~steam.enums.AuthSessionResponse, int], bool] = <return_true>, timeout: float | None = None) tuple[AuthenticationTicket, AuthSessionResponse, int]
- await wait_for(event: ~typing.Literal['command_error'], *, check: Callable[[commands.Context, Exception], bool] = <return_true>, timeout: float | None = None) tuple[commands.Context, Exception]
- await wait_for(event: ~typing.Literal['command', 'command_completion'], *, check: Callable[[commands.Context], bool] = <return_true>, timeout: float | None = None) commands.Context
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 abool
.timeout – By default,
wait_for()
function does not timeout, however, in the case atimeout
parameter is passed after the amount of seconds passesasyncio.TimeoutError
is raised.
- Raises:
asyncio.TimeoutError – If the provided timeout was reached.
- Returns:
Returns
None
, a single argument or atuple
of multiple arguments that mirrors the parameters for theevent
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(self, trade: steam.TradeOffer) -> None:
if not trade.is_our_offer():
await trade.user.send("Thank you for your trade")
print(f"Received trade: #{trade.id}")
print("Trade partner is:", trade.user)
print("We would send:", len(trade.sending), "items")
print("We would receive:", len(trade.receiving), "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 anon_error
handler consisting of a single empty The raise statement. Exceptions raised byon_error
will not be handled in any way byClient
.
- 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:
user (steam.User) – The user that started typing.
when (datetime.datetime) – The time the user started typing at.
- await Client.on_trade(trade, /)#
Called when the client sends/receives a trade offer.
- Parameters:
trade (steam.TradeOffer) – The trade offer that was received/send.
- await Client.on_trade_update(before, after, /)#
Called when the client or the trade partner updates a trade offer.
- Parameters:
before (steam.TradeOffer) – The trade offer that was updated prior to the update.
after (steam.TradeOffer) – The trade offer now.
- await Client.on_comment(comment, /)#
Called when the client receives a comment notification.
- Parameters:
comment (steam.Comment) – The comment received.
- await Client.on_invite(invite, /)#
Called when the client receives/sends an invitation.
- Parameters:
invite (steam.Invite) – The invite received.
- await Client.on_invite_accept(invite, /)#
Called when the client/author accepts an invitation.
- Parameters:
invite (steam.Invite) – The invite that was accepted.
- await Client.on_invite_decline(invite, /)#
Called when the client/author declines an invitation.
- Parameters:
invite (steam.Invite) – 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:
avatar_url
- 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_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:
avatar_url
- 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.
Utilities#
steam.py provides some utility functions.
- steam.utils.parse_id64(id, /, *, type=None, universe=None, instance=None)#
Convert various representations of Steam IDs to its Steam 64-bit ID.
- Parameters:
id (SupportsInt | SupportsIndex | str | bytes) – The ID to convert.
type (Type | None) – The type of the ID.
universe (Universe | None) – The universe of the ID.
instance (Instance | None) – The instance of the ID.
Examples
parse_id64(12345) parse_id64("12345") # account ids parse_id64(12345, type=steam.Type.Clan) # makes what would be interpreted as a user id into a clan id64 parse_id64(103582791429521412) parse_id64("103582791429521412") # id64s parse_id64("STEAM_1:0:2") # id2 parse_id64("[g:1:4]") # id3
- Raises:
.InvalidID – The created 64-bit Steam ID would be invalid.
- Returns:
The 64-bit Steam ID.
- Return type:
ID64
- await steam.utils.id64_from_url(url, /, session=None)#
Fetches the 64-bit Steam ID from a Steam Community URL or
None
.See also
ID.from_url()
- Return type:
ID64 | None
- steam.utils.parse_trade_url(url, /)#
Parses a trade URL for useful information.
- Parameters:
url (StrOrURL) – The trade URL to search.
- Returns:
Source for TradeURLInfo:
@dataclass(slots=True) class TradeURLInfo: id: IndividualID token: str | None = None @property def url(self) -> str: """The full trade URL.""" url = URL.COMMUNITY / "tradeoffer/new" % {"partner": self.id.id} return str(url % {"token": self.token}) if self.token else str(url) def __str__(self) -> str: return self.url
- Return type:
TradeURLInfo | None
Then some functions from discord.py
- steam.utils.get(iterable: AsyncIterable[_T], /, **attrs: Any) Coro[_T | None] #
- steam.utils.get(iterable: Iterable[_T], /, **attrs: Any) _T | None
A helper that returns the first element in the iterable that meets all the traits passed in
attrs
. This is an alternative forfind()
.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 – An iterable to search through.
attrs – Keyword arguments that denote attributes to match.
- Returns:
The first element from the
iterable
which matches all the traits passed inattrs
orNone
if no matching element was found.- Return type:
_T | None | Coro[_T | None]
- steam.utils.find(predicate: Callable[[_T], bool], iterable: AsyncIterable[_T], /) Coro[_T | None] #
- steam.utils.find(predicate: Callable[[_T], bool], iterable: Iterable[_T], /) _T | None
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 – A function that returns a boolean and takes an element from the
iterable
as its first argument.iterable – The iterable to search through.
- Returns:
The first element from the
iterable
for which thepredicate
returnsTrue
or if no matching element was found returnsNone
.- Return type:
_T | Coro[_T | None] | None
Enumerations#
- class steam.Result#
The result of a Steam API call. Read more on steamworks.
- 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.
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#
The language for a request.
- NONE = -1#
No language specified.
- English = 0#
English.
- German = 1#
German.
- French = 2#
French.
- Italian = 3#
Italian.
- Korean = 4#
Korean.
- Spanish = 5#
Spanish.
- SimplifiedChinese = 6#
Simplified Chinese.
- TraditionalChinese = 7#
Traditional Chinese.
- Russian = 8#
Russian.
- Thai = 9#
Thai.
- Japanese = 10#
Japanese.
- Portuguese = 11#
Portuguese.
- Polish = 12#
Polish.
- Danish = 13#
Danish.
- Dutch = 14#
Dutch.
- Finnish = 15#
Finnish.
- Norwegian = 16#
Norwegian.
- Swedish = 17#
Swedish.
- Romanian = 18#
Romanian.
- Turkish = 19#
Turkish.
- Hungarian = 20#
Hungarian.
- Czech = 21#
Czech.
- PortugueseBrazil = 22#
Brazilian Portuguese.
- Bulgarian = 23#
Bulgarian.
- Greek = 24#
Greek.
- Arabic = 25#
Arabic.
- Ukrainian = 26#
Ukrainian.
- SpanishLatinAmerican = 27#
Latin American Spanish.
- Vietnamese = 28#
Vietnamese.
- 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'}#
- classmethod from_str(string, /)#
- Return type:
Self
- classmethod from_web_api_str(string, /)#
- Return type:
Self
- class steam.Currency#
All currencies currently supported by Steam.
- USD = 1#
The United States Dollar.
- GBP = 2#
The British Pound.
- EUR = 3#
The Euro.
- CHF = 4#
The Swiss Franc.
- RUB = 5#
The Russian Ruble.
- PLN = 6#
The Polish Zloty.
- BRL = 7#
The Brazilian Real.
- JPY = 8#
The Japanese Yen.
- NOK = 9#
The Norwegian Krone.
- IDR = 10#
The Indonesian Rupiah.
- MYR = 11#
The Malaysian Ringgit.
- PHP = 12#
The Philippine Peso.
- SGD = 13#
The Singapore Dollar.
- THB = 14#
The Thai Baht.
- VND = 15#
The Vietnamese Dong.
- KRW = 16#
The South Korean Won.
- TRY = 17#
The Turkish Lira.
- UAH = 18#
The Ukrainian Hryvnia.
- MXN = 19#
The Mexican Peso.
- CAD = 20#
The Canadian Dollar.
- AUD = 21#
The Australian Dollar.
- NZD = 22#
The New Zealand Dollar.
- CNY = 23#
The Chinese Yuan.
- INR = 24#
The Indian Rupee.
- CLP = 25#
The Chilean Peso.
- PEN = 26#
The Peruvian Sol.
- COP = 27#
The Columbian Peso.
- ZAR = 28#
The South African Rand.
- HKD = 29#
The Hong Kong Dollar.
- TWD = 30#
The Taiwanese New Taiwan Dollar.
- SAR = 31#
The Saudi Arabian Saudi Riyal.
- AED = 32#
The United Arab Emirates Dirham.
- SEK = 33#
The Swedish Krona.
- ARS = 34#
The Argentinian Argentine Peso.
- ILS = 35#
The Israeli New Shekel.
- BYN = 36#
The Belarusian Ruble.
- KZT = 37#
The Kazakhstani Tenge.
- KWD = 38#
The Kuwaiti Dinar.
- QAR = 39#
The Qatari Riyal.
- CRC = 40#
The Costa Rican Colón.
- UYU = 41#
The Uruguayan Peso.
- BGN = 42#
The Bulgarian Lev.
- HRK = 43#
The Croatian Kuna.
- CZK = 44#
The Czech Koruna.
- DKK = 45#
The Danish Krone.
- HUF = 46#
The Hungarian Forint.
- RON = 47#
The Romanian Leu.
- classmethod try_name(name, /)#
- Return type:
Self
- class steam.PurchaseResult#
- NoDetail = 0#
- AVSFailure = 1#
- InsufficientFunds = 2#
- ContactSupport = 3#
- Timeout = 4#
- InvalidPackage = 5#
- InvalidPaymentMethod = 6#
- InvalidData = 7#
- OthersInProgress = 8#
- AlreadyPurchased = 9#
- WrongPrice = 10#
- FraudCheckFailed = 11#
- CancelledByUser = 12#
- RestrictedCountry = 13#
- BadActivationCode = 14#
- DuplicateActivationCode = 15#
- UseOtherPaymentMethod = 16#
- UseOtherFunctionSource = 17#
- InvalidShippingAddress = 18#
- RegionNotSupported = 19#
- AcctIsBlocked = 20#
- AcctNotVerified = 21#
- InvalidAccount = 22#
- StoreBillingCountryMismatch = 23#
- DoesNotOwnRequiredApp = 24#
- CanceledByNewTransaction = 25#
- ForceCanceledPending = 26#
- FailCurrencyTransProvider = 27#
- FailedCyberCafe = 28#
- NeedsPreApproval = 29#
- PreApprovalDenied = 30#
- WalletCurrencyMismatch = 31#
- EmailNotValidated = 32#
- ExpiredCard = 33#
- TransactionExpired = 34#
- WouldExceedMaxWallet = 35#
- MustLoginPS3AppForPurchase = 36#
- CannotShipToPOBox = 37#
- InsufficientInventory = 38#
- CannotGiftShippedGoods = 39#
- CannotShipInternationally = 40#
- BillingAgreementCancelled = 41#
- InvalidCoupon = 42#
- ExpiredCoupon = 43#
- AccountLocked = 44#
- OtherAbortableInProgress = 45#
- ExceededSteamLimit = 46#
- OverlappingPackagesInCart = 47#
- NoWallet = 48#
- NoCachedPaymentMethod = 49#
- CannotRedeemCodeFromClient = 50#
- PurchaseAmountNoSupportedByProvider = 51#
- OverlappingPackagesInPendingTransaction = 52#
- RateLimited = 53#
- OwnsExcludedApp = 54#
- CreditCardBinMismatchesType = 55#
- CartValueTooHigh = 56#
- BillingAgreementAlreadyExists = 57#
- POSACodeNotActivated = 58#
- CannotShipToCountry = 59#
- HungTransactionCancelled = 60#
- PaypalInternalError = 61#
- UnknownGlobalCollectError = 62#
- InvalidTaxAddress = 63#
- PhysicalProductLimitExceeded = 64#
- PurchaseCannotBeReplayed = 65#
- DelayedCompletion = 66#
- BundleTypeCannotBeGifted = 67#
- BlockedByUSGov = 68#
- ItemsReservedForCommercialUse = 69#
- GiftAlreadyOwned = 70#
- GiftInvalidForRecipientRegion = 71#
- GiftPricingImbalance = 72#
- GiftRecipientNotSpecified = 73#
- ItemsNotAllowedForCommercialUse = 74#
- BusinessStoreCountryCodeMismatch = 75#
- UserAssociatedWithManyCafes = 76#
- UserNotAssociatedWithCafe = 77#
- AddressInvalid = 78#
- CreditCardNumberInvalid = 79#
- CannotShipToMilitaryPostOffice = 80#
- BillingNameInvalidResemblesCreditCard = 81#
- PaymentMethodNotSupportedForProduct = 83#
- class steam.Universe#
Steam universes. Each universe is a self-contained Steam instance.
- 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.
- class steam.Type#
Steam account types.
- 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)
- class steam.TypeChar#
Steam account type characters.
- U = Type.Individual#
The character used for
Individual
.
- G = Type.GameServer#
The character used for
GameServer
.
- A = Type.AnonGameServer#
The character used for
AnonGameServer
.
- C = Type.ContentServer#
The character used for
ContentServer
.
- class steam.Instance#
Steam account instance flags.
- 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#
The relationship between a user and another user.
- 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.
- class steam.PersonaState#
The status of a user.
- 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.
- class steam.PersonaStateFlag#
The persona state flags for a user.
- NONE = 0#
The user has no persona state flags.
- HasRichPresence = 1#
The user has a rich presence string.
- InJoinableGame = 2#
The user is in a game and the game has a joinable lobby.
- Golden = 4#
The user has a golden username and “avatar frame” (this was before avatar frames).
- RemotePlayTogether = 8#
The user is playing a game that supports remote play together.
- ClientTypeWeb = 16#
The user is using the Steam Web App.
- ClientTypeMobile = 256#
The user is using the Steam Mobile App.
- ClientTypeTenfoot = 1024#
The user is using Steam Big Picture.
- ClientTypeVR = 2048#
The user is using the Steam VR App.
- LaunchTypeGamepad = 4096#
The user is using a gamepad.
- LaunchTypeCompatTool = 8192#
The user is using a compatibility tool.
- class steam.CommunityVisibilityState#
The visibility of a user’s community profile.
- 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#
The state of a trade offer.
- 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.
- class steam.ChatEntryType#
The type of chat entry.
- 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#
The UI mode for a client.
- 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.ReviewType#
The type of review.
- 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#
The region of a game server.
- 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#
The type of an event.
- 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#
The type of profile item.
- 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.
- Replay = 24#
A Steam Replay showcase.
- class steam.CommunityItemClass#
An item class.
- Invalid = 0#
An invalid item class.
- Badge = 1#
A badge.
- GameCard = 2#
A game card.
- ProfileBackground = 3#
A profile background.
- Emoticon = 4#
An emoticon.
- BoosterPack = 5#
A booster pack.
- Consumable = 6#
A consumable.
- GameGoo = 7#
Game goo.
- ProfileModifier = 8#
A profile modifier.
- Scene = 9#
A scene.
- SalienItem = 10#
A salien item.
- Sticker = 11#
A sticker.
- ChatEffect = 12#
A chat effect.
- MiniProfileBackground = 13#
A mini profile background.
- AvatarFrame = 14#
An avatar frame.
- AnimatedAvatar = 15#
An animated avatar.
- SteamDeckKeyboardSkin = 16#
A Steam Deck keyboard skin.
- class steam.DepotFileFlag#
Flags for a depot file.
- File = 0#
A file.
- UserConfig = 1#
A user configuration file.
- VersionedUserConfig = 2#
A versioned user configuration file.
- Encrypted = 4#
An encrypted file.
- ReadOnly = 8#
A read only file.
- Hidden = 16#
A hidden file.
- Executable = 32#
An executable file.
- Directory = 64#
A directory.
- CustomExecutable = 128#
A custom executable file.
- InstallScript = 256#
An install script file.
- Symlink = 512#
A symlink file.
- class steam.AppType#
App type.
- Game = 1#
A playable game, default type.
- Application = 2#
A software application.
- Tool = 4#
An SDK, editor or dedicated server.
- Demo = 8#
A game demo.
- DLC = 32#
A piece of downloadable content.
- Guide = 64#
A game guide or PDF etc.
- Driver = 128#
A hardware driver updater (ATI, Razor etc.)
- Config = 256#
A hidden app used to config Steam features (backpack, sales, etc.).
- Hardware = 512#
A hardware device (Steam Machine, Steam Controller, Steam Link, etc.).
- Franchise = 1024#
A hub for collections of multiple apps, e.g. films, series, games..
- Video = 2048#
A video component of either a Film or TVSeries (may be the feature, an episode, preview, making-of, etc.)
- Plugin = 4096#
A plug-in type for another App.
- Music = 8192#
A piece of music.
- Series = 16384#
A container app for video series.
- Comic = 32768#
A comic.
- Beta = 65536#
A beta for a game.
- Media = 131072#
Legacy Media
- Shortcut = 1073741824#
A shortcut to another app, client side only.
- DepotOnly = -2147483648#
A placeholder since depots and apps share the same namespace.
- classmethod from_str(name, /)#
- Return type:
Self
- class steam.LicenseFlag#
Flags for a license.
- NONE = 0#
No flags.
- Renew = 1#
License needs renewing.
- RenewalFailed = 2#
License renewal failed.
- Pending = 4#
Owns license, but transaction is still pending. Can’t install or play yet.
- Expired = 8#
License is expired.
- CancelledByUser = 16#
License is cancelled by user.
- CancelledByAdmin = 32#
License is cancelled by an admin.
- LowViolenceContent = 64#
License is only for a low violence version.
- ImportedFromSteam2 = 128#
License was imported from Steam 2.
- ForceRunRestriction = 256#
License has a force run restriction.
- RegionRestrictionExpired = 512#
License has a region restriction that has expired.
- CancelledByFriendlyFraudLock = 1024#
License is cancelled by a friendly fraud lock.
- NotActivated = 2048#
License is not activated.
- class steam.LicenseType#
Types of licenses.
- NoLicense = 0#
No license.
- SinglePurchase = 1#
A single purchase license.
- SinglePurchaseLimitedUse = 2#
A single purchase limited use license.
- RecurringCharge = 3#
A subscription based license.
- RecurringChargeLimitedUse = 4#
A subscription based limited use license.
- RecurringChargeLimitedUseWithOverAges = 5#
A subscription based limited use license with over ages.
- RecurringOption = 6#
A subscription based option license.
- LimitedUseDelayedActivation = 7#
A limited use delayed activation license.
- class steam.BillingType#
Types of billing .
- NoCost = 0#
No cost.
- BillOnceOnly = 1#
Bill once only.
- BillMonthly = 2#
Bill monthly.
- ProofOfPrepurchaseOnly = 3#
Proof of pre-purchase only.
- GuestPass = 4#
Guest pass.
- HardwarePromo = 5#
Hardware promotion.
- Gift = 6#
Gift.
- AutoGrant = 7#
Automatic grant.
- OEMTicket = 8#
Original Equipment Manufacturer ticket.
- RecurringOption = 9#
Recurring option.
- BillOnceOrCDKey = 10#
Bill once or CD key.
- Repurchasable = 11#
Re-purchasable.
- FreeOnDemand = 12#
Free on demand.
- Rental = 13#
Rental.
- CommercialLicense = 14#
Commercial license.
- FreeCommercialLicense = 15#
Free commercial license.
- NumBillingTypes = 16#
Number of billing types.
- class steam.PaymentMethod#
The payment method used for a purchase.
- NONE = 0#
No payment method.
- ActivationCode = 1#
Activation code.
- CreditCard = 2#
Credit card.
- Giropay = 3#
Giropay.
- PayPal = 4#
PayPal.
- Ideal = 5#
iDEAL.
- PaySafeCard = 6#
PaySafeCard.
- Sofort = 7#
Sofort.
- GuestPass = 8#
Guest pass.
- WebMoney = 9#
WebMoney.
- MoneyBookers = 10#
MoneyBookers.
- AliPay = 11#
AliPay.
- Yandex = 12#
Yandex.
- Kiosk = 13#
Kiosk.
- Qiwi = 14#
Qiwi.
- GameStop = 15#
GameStop.
- HardwarePromo = 16#
Hardware promotion.
- MoPay = 17#
MoPay.
- BoletoBancario = 18#
Boleto Bancario.
- BoaCompraGold = 19#
BoaCompra Gold.
- BancoDoBrasilOnline = 20#
Banco do Brasil Online.
- ItauOnline = 21#
Itau Online.
- BradescoOnline = 22#
Bradesco Online.
- Pagseguro = 23#
Pagseguro.
- VisaBrazil = 24#
Visa Brazil.
- AmexBrazil = 25#
American Express Brazil.
- Aura = 26#
Aura.
- Hipercard = 27#
Hipercard.
- MastercardBrazil = 28#
Mastercard Brazil.
- DinersCardBrazil = 29#
Diners Card Brazil.
- AuthorizedDevice = 30#
Authorized device.
- MOLPoints = 31#
MOLPoints.
- ClickAndBuy = 32#
Click and Buy.
- Beeline = 33#
Beeline.
- Konbini = 34#
Konbini.
- EClubPoints = 35#
E-Club Points.
- CreditCardJapan = 36#
Credit card Japan.
- BankTransferJapan = 37#
Bank transfer Japan.
- PayEasy = 38#
PayEasy.
- Zong = 39#
Zong.
- CultureVoucher = 40#
Culture voucher.
- BookVoucher = 41#
Book voucher.
- HappymoneyVoucher = 42#
Happy money voucher.
- ConvenientStoreVoucher = 43#
Convenient store voucher.
- GameVoucher = 44#
Game voucher.
- Multibanco = 45#
Multibanco.
- Payshop = 46#
Payshop.
- MaestroBoaCompra = 47#
Maestro BoaCompra.
- OXXO = 48#
OXXO.
- ToditoCash = 49#
Todito Cash.
- Carnet = 50#
Carnet.
- SPEI = 51#
SPEI.
- ThreePay = 52#
Three Pay.
- IsBank = 53#
Is Bank.
- Garanti = 54#
Garanti.
- Akbank = 55#
Akbank.
- YapiKredi = 56#
Yapi
- Halkbank = 57#
Halkbank.
- BankAsya = 58#
Bank Asya.
- Finansbank = 59#
Finansbank.
- DenizBank = 60#
DenizBank.
- PTT = 61#
PTT.
- CashU = 62#
CashU.
- AutoGrant = 64#
Automatic grant.
- WebMoneyJapan = 65#
WebMoney Japan.
- OneCard = 66#
OneCard.
- PSE = 67#
PSE.
- Exito = 68#
Exito.
- Efecty = 69#
Efecty.
- Paloto = 70#
Paloto.
- PinValidda = 71#
Pin Validda.
- MangirKart = 72#
Mangir Kart.
- BancoCreditoDePeru = 73#
Banco Credito de Peru.
- BBVAContinental = 74#
BBVA Continental.
- SafetyPay = 75#
SafetyPay.
- PagoEfectivo = 76#
Pago Efectivo.
- Trustly = 77#
Trustly.
- UnionPay = 78#
UnionPay.
- BitCoin = 79#
BitCoin.
- Wallet = 128#
Wallet.
- Valve = 129#
Valve.
- MasterComp = 130#
Master Comp.
- Promotional = 131#
Promotional.
- MasterSubscription = 134#
Master Subscription.
- Payco = 135#
Payco.
- MobileWalletJapan = 136#
Mobile Wallet Japan.
- OEMTicket = 256#
Original Equipment Manufacturer Ticket.
- Split = 512#
Split.
- Complimentary = 1024#
Complimentary.
- class steam.PackageStatus#
Package status.
- Available = 0#
Available.
- Preorder = 1#
Pre-order.
Unavailable.
- Invalid = 3#
Invalid.
- class steam.PublishedFileRevision#
Published file revisions.
- Default = 0#
The default revision.
- Latest = 1#
The latest revision.
- ApprovedSnapshot = 2#
The approved snapshot.
- ApprovedSnapshotChina = 3#
The approved snapshot for China.
- RejectedSnapshot = 4#
The rejected snapshot.
- RejectedSnapshotChina = 5#
The rejected snapshot for China.
- class steam.LeaderboardDataRequest#
The way that a leaderboard can be queried.
- Global = 0#
Global leaderboard.
- GlobalAroundUser = 1#
Global leaderboard around user.
- Friends = 2#
Friends leaderboard.
- Users = 3#
Users leaderboard.
- class steam.LeaderboardSortMethod#
The way that a leaderboard can be sorted.
- NONE = 0#
Default sort method.
- Ascending = 1#
Ascending sort method.
- Descending = 2#
Descending sort method.
- class steam.LeaderboardDisplayType#
The way that a leaderboard can be displayed.
- NONE = 0#
Default display type.
- Numeric = 1#
Numeric display type.
- TimeSeconds = 2#
Time in seconds display type.
- TimeMilliseconds = 3#
Time in milliseconds display type.
- class steam.LeaderboardUploadScoreMethod#
The way that a leaderboard can be uploaded to.
- NONE = 0#
Default upload method.
- KeepBest = 1#
Keep best upload method.
- ForceUpdate = 2#
Force update upload method.
- class steam.AuthSessionResponse#
The response from an app ticket authentication.
- NotSent = -1#
Not sent. Not a valid response from Steam.
- OK = 0#
- UserNotConnectedToSteam = 1#
- NoLicenseOrExpired = 2#
- VACBanned = 3#
- LoggedInElseWhere = 4#
- VACCheckTimedOut = 5#
- AuthTicketCanceled = 6#
- AuthTicketInvalidAlreadyUsed = 7#
- AuthTicketInvalid = 8#
- PublisherIssuedBan = 9#
- class steam.ContentDescriptor#
- FrequentNudityOrSexualContent = 1#
- FrequentViolenceOrGore = 2#
- StrongSexualContent = 3#
- AnyMatureContent = 5#
- class steam.UserNewsType#
- FriendAdded = 1#
- AchievementUnlocked = 2#
- ReceivedNewGame = 3#
- JoinedGroup = 4#
- CommentByMe = 5#
- FriendRemoved = 6#
- GroupCreated = 7#
- CommentOnMe = 8#
- AddedGameToWishlist = 9#
- Review = 10#
- FilePublishedScreenshot = 13#
- FilePublishedVideo = 14#
- FilePublishedWorkshopItem = 15#
- Post = 16#
- FilePublishedCollection = 17#
- FilePublishedGreenlightGame = 18#
- FilePublishedWorkshopAnnouncement = 19#
- FilePublishedWebGuide = 20#
- FilePublishedScreenshotTagged = 21#
- FilePublishedArt = 22#
- FileFavourited = 23#
- PlayedGameFirstTime = 30#
- ClanAchievement = 1001#
- PostedAnnouncement = 1002#
- ScheduledEvent = 1003#
- SelectedNewPOTW = 1004#
- PromotedNewAdmin = 1005#
- MessageOnClanPage = 1006#
- CuratorReview = 1007#
- App = -1#
- Friend = -1#
- All = -1#
Intents#
Intents allow you to control what data you wish to request from Steam, they are useful for reducing the overhead of the
library and allow you to chose what features you wish to enable. The should be passed to the Client
constructor.
- class steam.Intents#
Flags that control what features the client will interact with.
- NONE = 0#
Very little interaction happens from our end of the connection.
- Users = 1#
Users and members are cached.
- TradeOffers = 2#
TradeOffers are fetched and processed automatically
- Chat = 8#
Chats/Channels are cached.
- ChatGroups = 16#
Groups/Clans are cached.
- Market = 32#
Market interactions are enabled.
Warning
Using this comes could lead to your account being banned, much more so than with any other library operations.
- All = 63#
- Safe = 31#
Guard#
- steam.guard.get_authentication_code(shared_secret, timestamp=None)#
Get a Steam Guard code for signing in.
- Parameters:
shared_secret (str) – Base 64 encoded shared secret from Steam Guard.
timestamp (int | None) – The Unix timestamp to generate the key for. Defaults to the timestamp returned by
time.time()
.
- Return type:
- steam.guard.get_confirmation_code(identity_secret, tag, timestamp=None)#
Get a trade confirmation code.
- Parameters:
identity_secret (str) – Base 64 encoded identity secret from Steam Guard.
tag (str) – The confirmation tag to encode.
timestamp (int | None) – The time to generate the key for. Defaults to the timestamp returned by
time.time()
.
- Return type:
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:
Member
- x == y
Checks if two users are equal.
- str(x)
Returns the user’s name.
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- flags: PersonaStateFlag#
The persona state flags of the account.
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- property avatar: Avatar#
The user’s avatar.
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
Profile[Self]
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- property trade_url: URL#
The trade url of the user.
- property type: TypeT#
The Steam type of the ID.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
- class steam.abc.Channel#
Channel(_state: ‘ConnectionState’, clan: ‘ClanT’ = None, group: ‘GroupT’ = None)
- clan: ClanT#
The clan this channel belongs to.
- group: GroupT#
The group this channel belongs to.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- abstractmethod async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- await send(content=..., /, *, media=None)#
Send a message to a certain destination.
- Parameters:
content (Any) – The content of the message to send.
media (Media | None) – The media to send to the user.
Note
Anything as passed to
content
is implicitly cast to astr
.- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message, only applicable if
content
is passed.- Return type:
MessageT | None
- class steam.abc.Commentable#
A mixin that implements commenting functionality.
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- class steam.abc.Messageable#
An ABC that details the common operations on a Steam message. The following classes implement this ABC:
- await send(content=..., /, *, media=None)#
Send a message to a certain destination.
- Parameters:
content (Any) – The content of the message to send.
media (Media | None) – The media to send to the user.
Note
Anything as passed to
content
is implicitly cast to astr
.- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message, only applicable if
content
is passed.- Return type:
MessageT | None
- abstractmethod async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
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.
Achievements#
- class steam.AppStat#
Represents a stat for an app.
- app: PartialApp#
The app this stat is for.
- class steam.UserAppStat#
Represents a stat for a user in an app.
- app: PartialApp#
The app this stat is for.
- class steam.AppAchievement#
Represents an achievement for an app.
- icon: CDNAsset#
The icon of the achievement.
- icon_gray: CDNAsset#
The gray icon of the achievement.
Whether the achievement is hidden from the app’s achievement list.
- app: PartialApp#
The app this achievement is for.
- class steam.AppStatAchievement#
Represents an achievement for an app.
- icon: CDNAsset#
The icon of the achievement.
- icon_gray: CDNAsset#
The gray icon of the achievement.
Whether the achievement is hidden from the app’s achievement list.
- app: PartialApp#
The app this achievement is for.
- class steam.UserAppAchievement#
Represents an achievement for a user in an app.
- app: PartialApp#
The app this achievement is for.
- icon: CDNAsset#
The icon of the achievement.
- icon_gray: CDNAsset#
The gray icon of the achievement.
Whether the achievement is hidden from the app’s achievement list.
- class steam.AppStats#
Represents a collection of stats and achievements for an app.
- app#
The app these stats and achievement are for.
- version#
The version of the schema used to generate the stats and achievements.
- achievements#
The achievements for the app.
- stats#
The stats for the app.
- class steam.UserAppStats#
Represents a collection of stats and achievements for a user in an app.
- app#
The app these stats and achievement are for.
- version#
The version of the schema used to generate the stats and achievements.
- stats: list[UserAppStat]#
The stats for the app.
- achievements: list[UserAppAchievement]#
The achievements for the app.
Announcements#
- class steam.Announcement(state, clan, data)#
Represents an announcement in a clan.
- app#
The app that the event is going to be played in.
- author: User | PartialUser#
The event’s author.
- becomes_visible#
The time at which the event becomes publicly visible.
- clan#
The event’s clan.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- ends_at#
The time at which the event ends.
- await fetch_comment(id, /)#
Fetch a comment by its ID.
Whether the event is currently hidden.
- last_edited_at#
The time the event was last edited at.
- last_edited_by: User | PartialUser | None#
The user last edited the event.
- published#
Whether the event is currently published.
- starts_at#
The event’s start time.
- stops_being_visible#
The time at which the event stops being publicly visible.
- type#
The event’s type.
- topic_id#
The ID of the forum post comments are sent to.
- created_at#
The time at which the announcement was created at.
- updated_at#
The time at which the announcement was last updated_at.
- approved_at#
The time at which the announcement was approved by a moderator.
- await edit(name=None, content=None)#
Edit the announcement’s details.
Note
If parameters are omitted they use what they are currently set to.
- await delete()#
Delete this announcement.
- await upvote()#
Upvote this announcement.
- await downvote()#
Downvote this announcement.
Badge#
- class steam.AppBadge#
Represents a badge for an app.
- await icon()#
Fetches the URL of this badge.
- Return type:
CDNAsset
- class steam.UserBadge#
Represents a Steam badge on a user’s profile.
- xp#
The badge’s XP.
- completed_at#
The time the badge was completed at.
- scarcity#
The scarcity of the badge. The lower this value, the rarer the badge.
- class steam.UserBadges#
Represents a Steam
User
’s badges/level.- len(x)
Returns the number of badges.
- iter(x)
Returns an iterator over the badges.
- y in x
Returns whether the badge is in the badges.
- x[y]
Returns the badge at the given index.
- level#
The user’s level.
- xp#
The users’s XP.
- xp_needed_to_level_up#
The amount of XP the user needs to level up.
- xp_needed_for_current_level#
The amount of XP the user’s current level requires to achieve.
Ban#
Bundle#
- class steam.Bundle#
Represents a bundle of apps and packages. Read more on steamworks
- id#
The bundle’s ID.
- name#
The bundle’s name.
- class steam.PartialBundle#
- await fetch(*, language=None)#
Fetch this bundle.
Shorthand for:
bundle = await client.fetch_bundle(bundle_id)
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this bundle.
Shorthand for:
(item,) = await client.fetch_store_item(bundles=[bundle], language=language)
- Return type:
- await apps()#
Fetch the bundle’s apps.
- Return type:
list[PartialApp[None]]
- await packages()#
Fetch the bundle’s packages.
- Return type:
list[PartialPackage[None]]
- await redeem()#
Redeem this bundle if it’s a free-on-demand bundle.
- id#
The bundle’s ID.
- name#
The bundle’s name.
- class steam.FetchedBundle#
Represents a bundle of games and packages.
- creator_clans#
The clans of the creators that created this bundle.
- supported_languages#
The languages that this bundle is supported in.
- id#
The bundle’s ID.
- name#
The bundle’s name.
- await apps()#
Fetch the bundle’s apps.
- Return type:
list[PartialApp[None]]
- await packages()#
Fetch the bundle’s packages.
- Return type:
list[PartialPackage[None]]
Channel#
- class steam.UserChannel#
Represents the channel a DM is sent in.
- participant#
The recipient of any messages sent.
- 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:
AbstractAsyncContextManager[None]
- await trigger_typing()#
Send a typing indicator to the channel once.
Note
This only works in DMs.
- history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- await send(content=..., /, *, media=None)#
Send a message to a certain destination.
- Parameters:
content (Any) – The content of the message to send.
media (Media | None) – The media to send to the user.
Note
Anything as passed to
content
is implicitly cast to astr
.- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message, only applicable if
content
is passed.- Return type:
MessageT | None
- class steam.GroupChannel#
Represents a group channel.
- group: GroupT#
The group this channel belongs to.
- await bulk_delete(messages, /)#
Bulk delete messages.
- Parameters:
messages (Iterable[ChatMessage]) – The messages to delete.
- clan: ClanT#
The clan this channel belongs to.
- await delete()#
Delete the chat.
- await edit(*, name=None, move_below)#
Edit the chat.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
ChatMessageT | None
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- id#
The ID of the channel.
- name: str | None#
The name of the channel, this could be the same as the
name
/name
, if it’s the main channel.
- await send(content=..., /, *, media=None)#
Send a message to a certain destination.
- Parameters:
content (Any) – The content of the message to send.
media (Media | None) – The media to send to the user.
Note
Anything as passed to
content
is implicitly cast to astr
.- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message, only applicable if
content
is passed.- Return type:
MessageT | None
- class steam.ClanChannel#
Represents a clan channel.
- await bulk_delete(messages, /)#
Bulk delete messages.
- Parameters:
messages (Iterable[ChatMessage]) – The messages to delete.
- clan: ClanT#
The clan this channel belongs to.
- await delete()#
Delete the chat.
- await edit(*, name=None, move_below)#
Edit the chat.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
ChatMessageT | None
- group: GroupT#
The group this channel belongs to.
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- id#
The ID of the channel.
- name: str | None#
The name of the channel, this could be the same as the
name
/name
, if it’s the main channel.
- await send(content=..., /, *, media=None)#
Send a message to a certain destination.
- Parameters:
content (Any) – The content of the message to send.
media (Media | None) – The media to send to the user.
Note
Anything as passed to
content
is implicitly cast to astr
.- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message, only applicable if
content
is passed.- Return type:
MessageT | None
Clan#
- class steam.Clan#
Represents a Steam clan.
- x == y
Checks if two clans are equal.
- str(x)
Returns the clan’s name.
- app: PartialApp | None#
The
steam.PartialApp
that the chat group is associated with.
- property avatar: Avatar#
The chat group’s avatar.
- await ban(member)#
Bans a member of the chat group.
- 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:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await create_announcement(name, content, *, hidden=False)#
Create an announcement.
- Parameters:
- Returns:
The created announcement.
- Return type:
Announcement[Self]
- await create_channel(name)#
Creates a channel in the chat group.
- Parameters:
name (str) – The name of the channel to create.
- Return type:
ChatT
- await create_event(name, content, *, type=EventType.Other, app=None, starts_at=None, server_address=None, server_password=None)#
Create an event.
- Parameters:
name (str) – The name of the event
content (str) – The content for the event.
type (CreateableEvents) – The type of the event, defaults to
EventType.Other
.app (App | None) – The app that will be played in the event. Required if type is
EventType.Game
.starts_at (datetime | None) – The time the event will start at.
server_address (IPAdress | str | None) – The address of the server that the event will be played on. This is only allowed if
type
isEventType.App
.server_password (str | None) – The password for the server that the event will be played on. This is only allowed if
type
isEventType.App
.
Note
It is recommended to use a timezone aware datetime for
start
.- Returns:
The created event.
- Return type:
Event[CreateableEvents, Self]
- await create_role(name)#
Creates a role in the chat group.
- property default_channel: ChatT#
The group’s default channel.
- await fetch_announcement(id)#
Fetch an announcement from its ID.
- Parameters:
id (int) – The ID of the announcement.
- Return type:
Announcement[Self]
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_event(id)#
Fetch an event from its ID.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- 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 (int) – The 64 bit ID of the member to get.
- Return type:
MemberT | None
- get_role(id, /)#
Get a role from cache.
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- 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 Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- await kick(member, expires_at)#
Kicks a member of the chat group.
- Parameters:
member (IndividualID) – The member to kick.
expires_at (datetime) – When the kick expires.
- property me: MemberT#
The client user’s account in this chat group.
- property members: Sequence[MemberT]#
A list of the chat group’s members.
- await mute(member, expires_at)#
Mutes a member of the chat group.
- Parameters:
member (IndividualID) – The member to mute.
expires_at (datetime) – When the mute expires.
- property owner: MemberT | PartialMember#
The chat group’s owner.
- await search(name)#
Search for members in the chat group.
- Parameters:
name (str) – The name of the member to search for.
- Return type:
Sequence[MemberT]
- property top_members: Sequence[MemberT | PartialMember]#
A list of the chat group’s top members.
- property type: TypeT#
The Steam type of the ID.
- await unban(user)#
Unbans a member of the chat group.
- await chunk()#
Get a list of all members in the group.
- Return type:
Sequence[ClanMember]
- await edit(*, abbreviation=None, headline=None, summary=None, community_url=None, language=None, country=None, state=None, city=None, apps=None, name=None, tagline=None, avatar=None)#
Edits the clan.
- Parameters:
See also
PartialClan.edit()
- async for ... in fetch_members()#
An async iterator over a clan’s member list.
Note
This can be a very slow operation due to the rate limits on this endpoint.
- Return type:
AsyncGenerator[ClanMember | PartialMember, None]
- await join(*, invite_code=None)#
Joins the chat group.
- Parameters:
invite_code (str | None) – The invite code to use to join the chat group.
- await leave()#
Leaves the chat group.
- async for ... in events(*, limit=100, before=None, after=None)#
An asynchronous iterator over a clan’s
steam.Event
s.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 toNone
will fetch all the clan’s events, but this will be a very slow operation.before (datetime | None) – A time to search for events before.
after (datetime | None) –
A time to search for events after.
Warning
If this is
None
andcreated_at
isNone
, this has to fetch events all the way back until 2007
- Yields:
- async for ... in announcements(*, limit=100, before=None, after=None)#
An asynchronous iterator over a clan’s
steam.Announcement
s.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 toNone
will fetch all of the clan’s announcements, but this will be a very slow operation.before (datetime | None) – A time to search for announcements before.
after (datetime | None) – A time to search for announcements after.
- Yields:
Comment#
- 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: ReadOnly[CommentID]#
The comment’s ID.
- created_at: datetime#
The time the comment was posted at.
- reactions: list[AwardReaction]#
The comment’s reactions.
- author: AuthorT#
The author of the comment.
- owner: OwnerT#
The comment sections owner.
- await report()#
Reports the comment.
- await delete()#
Deletes the comment.
Events#
- class steam.Event#
Represents an event in a clan.
- app#
The app that the event is going to be played in.
- author: User | PartialUser#
The event’s author.
- becomes_visible#
The time at which the event becomes publicly visible.
- clan#
The event’s clan.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- ends_at#
The time at which the event ends.
- await fetch_comment(id, /)#
Fetch a comment by its ID.
Whether the event is currently hidden.
- last_edited_at#
The time the event was last edited at.
- last_edited_by: User | PartialUser | None#
The user last edited the event.
- published#
Whether the event is currently published.
- starts_at#
The event’s start time.
- stops_being_visible#
The time at which the event stops being publicly visible.
- type#
The event’s type.
- await server()#
The server that the event will be ran on.
Note
This is shorthand for
await client.fetch_server(ip=event.server_address)
- Return type:
- await edit(name: str, content: str, *, app: App | None = None, starts_at: datetime | None = None, server_address: str | None = None, server_password: str | None = None) None #
- await edit(name: str, content: str, *, type: BoringEvents | None = None, starts_at: datetime | None = None) None
- await edit(name: str, content: str, *, type: Literal[EventType.Game] = None, starts_at: datetime | None = None, app: App, server_address: IPAdress | 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 description.
type – The event’s type.
app – The event’s app.
starts_at – The event’s start time.
server_address – The event’s server’s address.
server_password – The event’s server’s password.
- await delete()#
Delete this event.
Game Servers#
- class steam.GameServer#
Represents a game server.
- name#
The name of the server.
- app#
The app of the server.
- ip#
The ip of the server.
- port#
The port of the server.
- tags#
The tags of the server.
- map#
The map the server is running.
- bot_count#
The number of bots in the server.
- player_count#
The number of players the server.
- max_player_count#
The maximum player count of the server.
- region#
The region the server is in.
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- property type: TypeT#
The Steam type of the ID.
- version#
The version of the server.
- game_directory#
The server’s game directory e.g.
"cstrike"
- await update()#
Update this game server instance in place.
- class steam.Query#
A class to construct Global Master Server queries.
- classmethod where(**kwargs)#
Construct a query meeting all the given criteria.
- Parameters:
empty – Fetches servers that are empty.
is_proxy – Fetches servers that are spectator proxies.
whitelisted – Fetches servers that are whitelisted.
dedicated – Fetches servers that are running dedicated.
secure – Fetches servers that are using anti-cheat technology (VAC, but potentially others as well).
linux – Fetches servers running on a Linux platform.
has_password – Fetches servers that are password protected.
full – Fetches servers that are full.
only_one_per_ip – Fetches only one server for each unique IP address matched.
version_match – Fetches servers running version “x” (
"*"
is wildcard equivalent to.*
in regex).name_match – Fetches servers with their name matching “x” (
"*"
is wildcard equivalent to.*
in regex).game_directory – Fetches servers running the specified modification (e.g. cstrike).
map – Fetches servers running the specified map (e.g. cs_italy)
ip – Fetches servers on the specified IP address, port is optional.
app – Fetches servers running a
App
.not_app – Fetches servers not running a
App
.tags – Fetches servers with all the given tag(s) in
GameServer.tags
.region – Fetches servers in a given region.
- Returns:
The query that should be passed to
Client.fetch_servers()
. Examples ——– Match servers running TF2, that are not empty and are using VAC .. code-block:: pycon >>> Query.where( … app=TF2, … empty=False, … secure=True, … ) Match servers where the server name is not “A cool Server” and the server supports “alltalk” and increased max players .. code-block:: pycon >>> Query.where(name_match=”A not cool server*”, match_tags=[“alltalk”, “increased_maxplayers”])- Return type:
Group#
- class steam.Group#
Represents a Steam group.
- await chunk()#
Get a list of all members in the group.
- Return type:
Sequence[GroupMember]
- app: PartialApp | None#
The
steam.PartialApp
that the chat group is associated with.
- property avatar: Avatar#
The chat group’s avatar.
- await ban(member)#
Bans a member of the chat group.
- property channels: Sequence[ChatT]#
A list of the chat group’s channels.
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await create_channel(name)#
Creates a channel in the chat group.
- Parameters:
name (str) – The name of the channel to create.
- Return type:
ChatT
- await create_role(name)#
Creates a role in the chat group.
- property default_channel: ChatT#
The group’s default channel.
- await edit(*, name=None, tagline=None, avatar=None)#
Edits the chat group.
- Parameters:
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- 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 (int) – The 64 bit ID of the member to get.
- Return type:
MemberT | None
- get_role(id, /)#
Get a role from cache.
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- 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 Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- await join(*, invite_code=None)#
Joins the chat group.
- Parameters:
invite_code (str | None) – The invite code to use to join the chat group.
- await kick(member, expires_at)#
Kicks a member of the chat group.
- Parameters:
member (IndividualID) – The member to kick.
expires_at (datetime) – When the kick expires.
- 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.
- await mute(member, expires_at)#
Mutes a member of the chat group.
- Parameters:
member (IndividualID) – The member to mute.
expires_at (datetime) – When the mute expires.
- property owner: MemberT | PartialMember#
The chat group’s owner.
- await search(name)#
Search for members in the chat group.
- Parameters:
name (str) – The name of the member to search for.
- Return type:
Sequence[MemberT]
- property top_members: Sequence[MemberT | PartialMember]#
A list of the chat group’s top members.
- property type: TypeT#
The Steam type of the ID.
- await unban(user)#
Unbans a member of the chat group.
Invite#
- class steam.UserInvite#
Represents a invite from a user to become their friend.
- await accept()#
Accept the invite request.
- await decline()#
Decline the invite request.
- author: User | ClientUser | PartialUser#
The user who sent the invite.
- relationship: FriendRelationship | None#
The relationship you have with the invitee.
- user: User | ClientUser | PartialUser#
The user that was invited.
- class steam.ClanInvite#
Represents an invitation to join a
Clan
from a user.- await accept()#
Accept the invite request.
- await decline()#
Decline the invite request.
- author: User | ClientUser | PartialUser#
The user who sent the invite.
- relationship: FriendRelationship | None#
The relationship you have with the invitee.
- await revoke()#
Revoke the invite request.
- user: User | ClientUser | PartialUser#
The user that was invited.
Leaderboard#
- class steam.Leaderboard#
Represents a leaderboard for an app.
- id: LeaderboardID#
The leaderboard’s id.
- app: AppT#
The app this leaderboard is for.
- sort_method: LeaderboardSortMethod#
The sort method of the leaderboard.
- display_type: LeaderboardDisplayType#
The display type of the leaderboard.
- display_name: DisplayNameT#
The display name of the leaderboard. This is only set if the leaderboard is fetched using
PartialApp.leaderboards()
.
- async for ... in entries(*, limit: int | None = None, type: Literal[LeaderboardDataRequest.Users], users: Sequence[IndividualID]) AsyncGenerator[LeaderboardUser, None] #
- async for ... in entries(*, limit: int | None = None, type: LeaderboardDataRequest = LeaderboardDataRequest.Global) AsyncGenerator[LeaderboardUser, None]
Fetch the entries of the leaderboard.
- Parameters:
limit – The maximum number of entries to fetch. If None is passed, all entries will be fetched.
type – The type of entries to fetch.
users – The users to fetch. Only used if type is
LeaderboardDataRequest.Users
.
- Return type:
AsyncGenerator[LeaderboardUser, None]
- await set_score(score, *, details, method=LeaderboardUploadScoreMethod.NONE)#
Set the score of the current user on the leaderboard.
- Parameters:
score (int) – The score to set.
details (bytes) – The details to set.
method (LeaderboardUploadScoreMethod) – The method to use to upload the score.
- Return type:
- await set_ugc_id(ugc_id)#
Set the UGC ID of the current user on the leaderboard.
- class steam.LeaderboardUser#
Represents a user on an app’s leaderboard.
- global_rank#
The global rank of the user.
- score#
The score of the user.
- details#
The details of the user.
- ugc_id#
The UGC ID of the user.
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await add()#
Sends a friend invite to the user to your friends list.
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- property avatar: Avatar#
The user’s avatar.
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await block()#
Blocks the user.
- await cancel_invite()#
Cancels an invitation sent to the user. This effectively does the same thing as
remove()
.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- 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 (str | None) – The user’s trade offer token, not required if you are friends with the user.
- Return type:
timedelta | None
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- flags: PersonaStateFlag#
The persona state flags of the account.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
Profile[Self]
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- await remove()#
Remove the user from your friends list.
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await send(content=..., /, *, trade=None, media=None)#
Send a message, trade or image to an
User
.- Parameters:
content (Any) – The message to send to the user.
trade (TradeOffer[Asset[User], Asset[ClientUser], Any] | None) –
The trade offer to send to the user.
Note
This will have its
id
attribute updated after being sent.media (Media | None) – The media to send to the user.
- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message only applicable if
content
is passed.- Return type:
UserMessage[ClientUser] | None
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- property trade_url: URL#
The trade url of the user.
- await trigger_typing()#
Send a typing indicator to the channel once.
Note
This only works in DMs.
- property type: TypeT#
The Steam type of the ID.
- 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:
AsyncGenerator[None, None]
- await unblock()#
Unblocks the user.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
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.
- bytes(x)
Returns the manifest’s binary data.
Note#
This will be the uncompressed data.
- app#
The app that this manifest was fetched from.
- server#
The content server that this manifest was fetched from.
- property paths: Sequence[ManifestPath]#
The depot’s files.
- property root: ManifestPath#
The depot’s root directory.
- property id: ManifestID#
The ID of this manifest. This is randomly generated by Steam.
- property depot_id: DepotID#
The ID of this manifest’s depot.
- created_at#
The time at which the depot was created at.
- class steam.ManifestPath#
A
pathlib.PurePath
subclass representing a binary file in a Manifest. This class is broadly compatible withpathlib.Path
.- x == y
Checks if two paths are equal.
- hash(x)
Hashes this path.
- x < y
Checks if one path’s parts is less than the other.
- property chunks: Sequence[PayloadFileMappingChunkData]#
A read-only version of this path’s chunks instances.
- flags#
This path’s flags.
Whether this file is hidden.
- Return type:
- readlink()#
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
- resolve(*, strict: bool = False) Self #
Return the canonical path of the symbolic link, eliminating any symbolic links encountered in the path. Similar to
pathlib.Path.resolve()
- Parameters:
strict – Whether to raise an error if a path doesn’t exist.
- Raises:
FileNotFoundError – If
strict
isTrue
and the path doesn’t exist.RuntimeError – If a recursive path is detected.
- Return type:
Self
- exists(*, follow_symlinks=True)#
Return whether this path exists. Similar to
pathlib.Path.exists()
.- Return type:
- for ... in iterdir()#
Iterate over this path. Similar to
pathlib.Path.iterdir()
.- Return type:
Generator[Self, None, None]
- for ... in walk(*, top_down=True, follow_symlinks=False)#
Walk this path. Similar to
pathlib.Path.walk()
.- Parameters:
Note
Unlike
pathlib.Path.walk()
, this method does not have aon_error
parameter as it should never error.- Yields:
The path currently being traversed, directories and files (
(dirpath, dirnames, filenames)
).
- for ... in glob(pattern, /)#
Perform a glob operation on this path. Similar to
pathlib.Path.glob()
.- Return type:
Generator[Self, None, None]
- for ... in rglob(pattern, /)#
Perform a recursive glob operation on this path. Similar to
pathlib.Path.rglob()
.- Return type:
Generator[Self, None, None]
- async with open()#
Reads the contents of the file.
- 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:
AsyncGenerator[ManifestPathIO, None]
- await read_bytes(**kwargs)#
Read the contents of the file. Similar to
pathlib.Path.read_bytes()
- Return type:
- 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:
- await read_text(encoding=..., errors=...)#
Read the contents of the file. Similar to
pathlib.Path.read_text()
- Return type:
- await read_vdf(encoding=..., errors=...)#
Read the contents of the file into a VDFDict.
- Return type:
VDFDict
- 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.
- 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.
- 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.
- build_id: int#
The branch’s build ID. This is a globally incrementing number. Build IDs are updated when a new build of an application is pushed.
- property manifests: list[ManifestInfo]#
This branch’s manifests.
- class steam.ManifestInfo#
Represents information about a manifest.
- id: ManifestID#
The manifest’s ID.
- class steam.HeadlessDepot#
Represents a depot without a branch.
- id: DepotID#
The depot’s ID.
Whether this depot supports shared installs
- class steam.Depot#
Represents a depot which is a grouping of files.
Read more on steamworks.
- manifest: ManifestInfo#
The depot’s associated manifest.
- id: DepotID#
The depot’s ID.
Whether this depot supports shared installs
- class steam.AppInfo#
Represents a collection of information on an app.
- type#
The app’s type.
- has_adult_content#
Whether this app has adult content according to Steam.
- has_adult_content_violence#
Whether this app has adult sexual content according to Steam.
- has_adult_content_sex#
Whether this app has adult violence according to Steam.
- market_presence#
Whether this app has a market presence.
- workshop_visible#
Whether this app has a workshop visible.
- community_hub_visible#
Whether this app has a content hub visible.
- controller_support#
This app’s level of controller support.
- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- supported_languages#
This app’s supported languages.
- language_support#
This app’s language support.
- categories#
This app’s supported categories.
- tags#
This app’s supported tags.
- genres#
This app’s supported genres.
- created_at#
The time this app was created.
- review_score#
This app’s review score.
- review_percentage#
This app’s review percentage.
- metacritic_name#
This app’s metacritic name.
- metacritic_score#
This app’s metacritic score.
- metacritic_url#
This app’s metacritic URL.
- partial_dlc#
This app’s downloadable content.
- icon#
This app’s icon.
- logo#
This app’s logo.
- website_url#
This app’s website URL.
- parent#
This app’s parent.
- headless_depots: Sequence[HeadlessDepot]#
This app’s headless depots.
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- class steam.PackageInfo#
Represents a collection of information on a package.
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
- name#
The package’s name.
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
- 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.
- app_items#
The app items in the package.
- await apps(*, language: Language) list[PartialApp[str]] #
- await apps(*, language: None = None) list[PartialApp[None]]
Fetches this package’s apps.
- Return type:
list[PartialApp[None]] | list[PartialApp[str]]
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: UserT#
The message’s author.
- created_at: datetime#
The time this message was sent at.
- channel#
The channel the message was sent in.
- content#
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.
- reactions: list[MessageReaction]#
The message’s reactions.
- partial_reactions: list[PartialMessageReaction]#
The message’s partial reactions.
- property id: int#
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 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.
- await add_sticker(sticker, /)#
Adds a sticker to this message.
- Parameters:
sticker (Sticker) – The sticker to add to this message.
- await remove_sticker(sticker, /)#
Adds a sticker to this message.
- Parameters:
sticker (Sticker) – The sticker to remove from this message.
- abstractmethod await ack()#
Acknowledge this message.
Note
This will acknowledge any messages sent before this message
- class steam.UserMessage#
Represents a message from a user.
- created_at: datetime#
The time this message was sent at.
- author: UserT#
The message’s author.
- await ack()#
Acknowledge this message.
Note
This will acknowledge any messages sent before this message
- 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.
- channel#
The channel the message was sent in.
- content#
The message’s content.
Note
This is not what you will see in the steam client see
clean_content
for that.
- property id: int#
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.
- ordinal: int#
A per-channel incremented integer up to
1000
for every message sent in a second window.
- partial_reactions: list[PartialMessageReaction]#
The message’s partial reactions.
- reactions: list[MessageReaction]#
The message’s reactions.
- class steam.GroupMessage#
Represents a message in a group.
- await ack()#
Acknowledge this message.
Note
This will acknowledge any messages sent before this message
- 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.
- author: AuthorT#
The message’s author.
- channel: ChatT#
The channel the message was sent in.
- content#
The message’s content.
Note
This is not what you will see in the steam client see
clean_content
for that.
- created_at: datetime#
The time this message was sent at.
- await delete()#
Deletes the message.
- await fetch_reaction(emoticon, /)#
Fetches the reactions to this message with a given emoticon.
- Return type:
- 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:
- property id: int#
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.
- ordinal: int#
A per-channel incremented integer up to
1000
for every message sent in a second window.
- partial_reactions: list[PartialMessageReaction]#
The message’s partial reactions.
- reactions: list[MessageReaction]#
The message’s reactions.
- class steam.ClanMessage#
Represents a message in a clan.
- await ack()#
Acknowledge this message.
Note
This will acknowledge any messages sent before this message
- 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.
- author: AuthorT#
The message’s author.
- channel: ChatT#
The channel the message was sent in.
- content#
The message’s content.
Note
This is not what you will see in the steam client see
clean_content
for that.
- created_at: datetime#
The time this message was sent at.
- await delete()#
Deletes the message.
- await fetch_reaction(emoticon, /)#
Fetches the reactions to this message with a given emoticon.
- Return type:
- 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:
- property id: int#
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.
- ordinal: int#
A per-channel incremented integer up to
1000
for every message sent in a second window.
- partial_reactions: list[PartialMessageReaction]#
The message’s partial reactions.
- reactions: list[MessageReaction]#
The message’s reactions.
Package#
- class steam.Package#
Represents a package, a collection of one or more apps and depots.
Read more on steamworks.
- id#
The package’s ID.
- name#
The package’s name.
- class steam.package.PartialPackage#
A package with state.
- await apps(*, language=None)#
Fetches this package’s apps.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
Manifest
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- name#
The package’s name.
- class steam.FetchedPackage#
Represents a package that was fetched from steam.
- await apps(*, language=None)#
Fetches this package’s apps.
- Return type:
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
- name#
The package’s name.
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
- class steam.License#
Represents a License to a package the client user has access to.
- owner#
The license’s owner.
- type#
The license’s type.
- flags#
The license’s flags.
- created_at#
The license’s creation date.
- master_package#
The license’s master package.
- next_process_at#
The date when the license will be processed.
- time_limit#
The time limit for the license.
- time_used#
The time the license has been used.
- payment_method#
The payment method used for the license.
- await apps(*, language=None)#
Fetches this package’s apps.
- Return type:
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
- name#
The package’s name.
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
- purchase_country_code#
The country code of the license’s purchase.
- territory_code#
The license’s territory code.
- change_number#
The license’s current change number.
- initial_period#
The license’s initial period.
- initial_time_unit#
The license’s initial time unit.
- renewal_period#
The license’s renewal period.
- renewal_time_unit#
The license’s renewal time unit.
- access_token#
The license’s access token.
- await remove()#
Remove the license from the client user’s account.
- class steam.FetchedAppPackage#
- await apps(*, language=None)#
Fetches this package’s apps.
- Return type:
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
- name#
The package’s name.
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
Post#
- class steam.Post#
Represents a post on Steam Community.
- id: ReadOnly[PostID]#
The ID of this post.
- author: UserT#
The author of this post.
- app: PartialApp | None#
The app this post is for, if any.
- await delete()#
Delete this post.
- await upvote()#
Upvote this post.
- 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:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- await downvote()#
Un-upvote this post (this is different from other downvoting systems).
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- property created_at: datetime#
The time this post was created.
PriceOverview#
Profile#
- class steam.ProfileInfo#
Represents the user’s profile info.
- created_at: datetime#
The time at which the user was created at.
- summary: utils.BBCodeStr#
The user’s summary.
- class steam.ProfileItem#
Represents an item on/in a user’s profile.
- id#
The item’s id.
- url#
The item’s url.
- name#
The item’s name.
- title#
The item’s title.
- description#
The item’s description.
- app#
The app the item is from.
- type#
The item’s type.
- class_#
The item’s class.
- movie#
The movie associated with the item.
- equipped_flags#
The item’s equipped flags.
- await equip()#
Equip the profile item.
- class steam.OwnedProfileItems#
Represents the
ClientUser
's owned items.- backgrounds: list[ProfileItem[UserT]]#
The backgrounds the client user owns.
- mini_profile_backgrounds: list[ProfileItem[UserT]]#
The mini profile backgrounds the client user owns.
- avatar_frames: list[ProfileItem[UserT]]#
The avatar frames the client user owns.
- animated_avatars: list[ProfileItem[UserT]]#
The animated avatars the client user owns.
- modifiers: list[ProfileItem[UserT]]#
The modifiers the client user owns.
- class steam.EquippedProfileItems#
Represents the items the user has equipped.
- background: ProfileItem[UserT] | None#
The equipped background.
- mini_profile_background: ProfileItem[UserT] | None#
The equipped mini profile background for the user.
- avatar_frame: ProfileItem[UserT] | None#
The equipped avatar frame for the user.
- animated_avatar: ProfileItem[UserT] | None#
The equipped animated avatar for the user.
- modifier: ProfileItem[UserT] | None#
The equipped modifier for the user.
- class steam.ProfileShowcase#
Represents a user’s profile showcase.
- owner: UserT#
The showcase’s owner.
- type: ProfileItemType#
The showcase type.
- style: ProfileCustomisationStyle#
The style of the showcase.
- await published_files(*, revision=PublishedFileRevision.Default, language=None)#
Fetches the associated
PublishedFile
for the entire showcase.- 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:
list[PublishedFile[UserT]]
- class steam.Profile#
Represents a user’s complete profile.
- background: ProfileItem[UserT] | None#
The equipped background.
- mini_profile_background: ProfileItem[UserT] | None#
The equipped mini profile background for the user.
- avatar_frame: ProfileItem[UserT] | None#
The equipped avatar frame for the user.
- animated_avatar: ProfileItem[UserT] | None#
The equipped animated avatar for the user.
- modifier: ProfileItem[UserT] | None#
The equipped modifier for the user.
PublishedFile#
- class steam.PublishedFile#
Represents a published file on SteamPipe.
- id: ReadOnly[IDT]#
The file’s id.
- name#
The file’s name.
- author#
The file’s author.
- app#
The file’s app.
- created_with#
The file’s created_with.
- created_at#
The time the file was created at.
- updated_at#
The time the file was last updated at.
- manifest_id#
The file’s manifest id.
- revision#
The file’s revision.
- available_revisions#
The file’s available_revisions.
- change_number#
This revision’s change number.
- type#
The file’s type.
- views#
The file’s views.
- youtube_id#
The file’s youtube_id.
- description#
The file’s description.
- visibility#
The file’s visibility.
- flags#
The file’s flags.
- accepted#
Whether the file has been accepted.
- show_subscribe_all#
The file’s show_subscribe_all.
- number_of_developer_comments#
The file’s number of comments from the developer.
- number_of_public_comments#
The file’s number of public comments.
- spoiler#
Whether the file is marked as a spoiler.
- children#
The file’s children.
- file#
The file’s main file.
- preview#
The file’s preview.
- previews#
All the file’s previews.
- image#
The file’s image.
- banned#
Whether the file is banned.
- ban_reason#
The file’s ban_reason.
- banner#
The file’s banner.
- ban_text_check_result#
The file’s ban_text_check_result.
- can_be_deleted#
The file’s can_be_deleted.
- incompatible#
The file’s incompatible.
- can_subscribe#
The file’s can_subscribe.
- subscriptions#
The file’s subscriptions.
- time_subscribed#
The file’s time_subscribed.
- 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:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- favourited#
The current number of people that have favourited the file.
- followers#
The current number of followers the file has.
- lifetime_subscriptions#
The file’s lifetime subscriptions.
- lifetime_favourited#
The total number of people that have favourited the file.
- lifetime_followers#
The total number of followers the file has.
- lifetime_playtime#
The file’s lifetime playtime.
- lifetime_playtime_sessions#
The file’s lifetime playtime sessions.
- shortcut_id#
The file’s shortcut ID.
- shortcut_name#
The file’s shortcut name.
- consumer_shortcut_id#
The file’s consumer’s shortcut ID.
- tags#
The file’s tags.
- kv_tags#
The file’s key-value tags
- reports#
The number of reports the file has.
- upvotes#
The number of upvotes the file has.
- downvotes#
The number of downvotes the file has.
- score#
The file’s score.
- playtime_stats#
The file’s playtime stats.
- for_sale_data#
The file’s sale data.
- metadata#
Any metadata attached to the file.
- language#
The language the file is in.
- maybe_inappropriate_sex#
Whether the file may contain sexually inappropriate content.
- maybe_inappropriate_violence#
Whether the file may contain violent content which may be inappropriate for some.
- reactions#
The file’s reactions.
- await fetch_children(*, revision=PublishedFileRevision.Default, language=None)#
Fetches this published file’s children.
- Parameters:
revision (PublishedFileRevision) – The revision to fetch.
language (Language | None) – The language to fetch children in. If
None
, the current language is used.
- Return type:
- async for ... in parents(*, revision=PublishedFileRevision.Default, language=None)#
Fetches this published file’s parents.
- Parameters:
revision (PublishedFileRevision) – The revision to fetch.
language (Language | None) – The language to fetch parents in. If
None
, the current language is used.
- Return type:
AsyncGenerator[PublishedFile[Author], None]
- 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:
- 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.
- 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 (Language | None) – The language to fetch history entries in. If
None
, the current language is used.
- Return type:
PublishedFileChange
- await friends_who_favourited()#
Fetches a list of the
ClientUser
’s friends who favourited this published file.Note
Due to a Steam limitation, this will only return your friends with non-default avatars.
- await edit(*, name=None, description=None, visibility=None, tags=None, filename=None, preview_filename=None)#
Edits this published file.
- Parameters:
name (str | None) – The new name of the file.
description (str | None) – The new description of the file.
visibility (PublishedFileVisibility | None) – The new visibility of the file.
tags (Sequence[str] | None) – The new tags of the file.
filename (str | None) – The new filename of the file.
preview_filename (str | None) – The new preview filename of the file.
Store#
- class steam.StoreItem#
- class steam.AppStoreItem#
Represents an app fetched from the store.
- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- name#
The app’s name.
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- class steam.PackageStoreItem#
Represents a package fetched from the store.
- await apps(*, language=None)#
Fetches this package’s apps.
- Return type:
- await apps_info()#
Fetch the product info for all apps in this package.
Shorthand for:
infos = await client.fetch_product_info(apps=await package.apps())
- await depots()#
Fetches this package’s depots.
- Return type:
- await fetch(*, language=None)#
Fetches this package’s information.
Shorthand for:
package = await client.fetch_package(package, language=language)
- Return type:
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a manifest from one of the
apps()
manifests.
- id#
The package’s ID.
- await info()#
Fetches this package’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(packages=[package])
- Return type:
- async for ... in manifests(limit=100, before=None, after=None, branch='public', passwords={}, password_hashes={})#
An asynchronous iterator for accessing this package’s
steam.Manifest
s.Examples
Usage:
async for manifest in package.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
passwords (Mapping[AppT, str | None]) – A mapping of the password for a branch by its app, if any.
password_hashes (Mapping[AppT, str]) – A mapping of the hashed password for a branch by its app, if any.
- Yields:
- name#
The package’s name.
- await store_item(*, language=None)#
Fetches this package’s store item.
Shorthand for:
(item,) = await client.fetch_store_item(packages=[package], language=language)
- Return type:
- class steam.BundleStoreItem#
Represents a bundle fetched from the store.
- await apps()#
Fetch the bundle’s apps.
- Return type:
list[PartialApp[None]]
- await fetch(*, language=None)#
Fetch this bundle.
Shorthand for:
bundle = await client.fetch_bundle(bundle_id)
- Return type:
- id#
The bundle’s ID.
- name#
The bundle’s name.
- await packages()#
Fetch the bundle’s packages.
- Return type:
list[PartialPackage[None]]
- await redeem()#
Redeem this bundle if it’s a free-on-demand bundle.
- await store_item(*, language=None)#
Fetch the store item for this bundle.
Shorthand for:
(item,) = await client.fetch_store_item(bundles=[bundle], language=language)
- Return type:
- class steam.TransactionReceipt#
Represents a transaction receipt.
- id#
The ID of the transaction.
- items#
The items in the transaction.
- package#
The package in the transaction.
- purchase_status#
The status of the transaction.
- created_at#
The time the transaction was created.
- payment_method#
The payment method used for the transaction.
- base_price#
The base price of the transaction.
- total_discount#
The total discount of the transaction.
- tax#
The tax of the transaction.
- shipping#
The shipping cost of the transaction.
- currency#
The currency code of the transaction.
- language#
The country code of the transaction.
App Tickets#
- class steam.EncryptedTicket#
Represents an encrypted ticket.
- user_data#
The user’s given data for the ticket.
- version#
The version of the ticket.
- user#
The user who owns the ticket.
- app#
The app the ticket is for.
- external_ip#
The external IP address of the user.
- internal_ip#
The internal IP address of the user.
- flags#
The flags of the ticket.
- created_at#
The time the ticket was created.
- licenses#
The licenses the user owns.
- dlc#
The DLC the user owns.
- signature#
The signature of the ticket.
- class steam.OwnershipTicket#
Represents an ownership ticket. This is used to verify ownership of an app.
- app#
The app the ticket is for.
- created_at#
The time the ticket was created.
- dlc#
The DLC the user owns.
- external_ip#
The external IP address of the user.
- flags#
The flags of the ticket.
- internal_ip#
The internal IP address of the user.
- licenses#
The licenses the user owns.
- signature#
The signature of the ticket.
- user#
The user who owns the ticket.
- version#
The version of the ticket.
- class steam.AuthenticationTicket#
Represents an authentication ticket. This is used to verify ownership of an app and to connect to the game server.
- auth_ticket#
The authentication ticket for the app. The first 52 bytes of the ticket.
- gc_token#
The Game Connect token for the app.
- gc_token_created_at#
When the Game Connect token was created.
- client_ip#
The IP address of the client.
- client_connected_at#
The time the client has been connected to Steam
- client_connection_count#
How many servers the client has connected to
- await verify(*, publisher_api_key=None)#
Verify the ticket with the web API.
- Parameters:
publisher_api_key (str | None) – The publisher API key to use for verification. If not provided, will use the standard (rate limited) API.
- Return type:
- await activate()#
Activate the ticket.
- await deactivate()#
Deactivate the ticket. Ends our sessions with other users meaning we can’t get events from them anymore.
- app#
The app the ticket is for.
- created_at#
The time the ticket was created.
- dlc#
The DLC the user owns.
- external_ip#
The external IP address of the user.
- flags#
The flags of the ticket.
- internal_ip#
The internal IP address of the user.
- licenses#
The licenses the user owns.
- signature#
The signature of the ticket.
- user#
The user who owns the ticket.
- version#
The version of the ticket.
- class steam.AuthenticationTicketVerificationResult#
Represents the result of an authentication ticket verification.
- bool(x)
Checks if the result is
Result.OK
.
- user: PartialUser#
The user who sent the ticket.
- owner: PartialUser#
The user who owns the ticket.
Trading#
- class steam.Inventory#
Represents a User’s inventory.
- len(x)
Returns how many items are in the inventory.
- iter(x)
Iterates over the inventory’s items.
- x[i]
Returns the item at the given index.
- y in x
Determines if an item is in the inventory based off of its
Asset.id
.
- owner#
The owner of the inventory.
- app#
The app the inventory belongs to.
- await update()#
Re-fetches the inventory and updates it inplace.
- count(value) integer -- return number of occurrences of value #
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- class steam.Item#
Represents an item in a User’s inventory.
- name#
The market_name of the item.
- type#
The type of the item.
- tags#
The tags of the item.
- colour#
The colour of the item.
- icon#
The icon url of the item. Uses the large image url where possible.
- display_name#
The displayed name of the item. This could be different to
Item.name
if the item is user re-nameable.
- market_hash_name#
The market_hash_name of the item.
- descriptions#
The descriptions of the item.
- owner_descriptions#
The descriptions of the item which are visible only to the owner of the item.
- fraud_warnings#
The fraud warnings for the item.
- actions#
The actions for the item.
- owner_actions#
The owner actions for the item.
- market_actions#
The market actions for the item.
- market_fee#
The market fee percentage for the item.
- amount#
The amount of the same asset there are in the inventory.
- property app: PartialApp[None]#
The app the item is from.
- class_id: ClassID#
The classid of the item.
- context_id#
The contextid of the item.
- await gift_to(recipient, /, *, name=None, message, closing_note, signature)#
Gifts the asset to the recipient.
- Parameters:
recipient (Friend) – The recipient to gift the asset to.
name (str | None) – The name to give the asset. If not provided, the recipient’s
name
will be used.message (str) – The message to send with the gift.
closing_note (str) – The closing note to send with the gift.
signature (str) – The signature to send with the gift.
- id#
The assetid of the item.
- instance_id: InstanceID#
The instanceid of the item.
- listings()#
Fetch the listings of this item on the Steam Community Market place.
- Return type:
AsyncGenerator[Listing, None]
- property market_fee_app: PartialApp[None]#
The app for which the Steam Community Market fee percentage is applied.
- await name_id()#
Fetch the item_nameid of this item on the Steam Community Market place.
- Return type:
- owner#
The owner of the asset.
- await price(*, currency=None)#
Fetch the price of this item on the Steam Community Market place.
Shorthand for:
await client.fetch_price(item.market_hash_name, item.app, currency)
- Return type:
- await price_history(*, currency=None)#
Fetch the price history of this item on the Steam Community Market place.
Shorthand for:
await client.fetch_price_history(item.market_hash_name, item.app, currency)
- Return type:
list[PriceHistory]
- await sell()#
List this item for sale on the Steam Community Market.
- Return type:
MyListing
- 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.
- amount#
The amount of the same asset there are in the inventory.
- context_id#
The contextid of the item.
- owner#
The owner of the asset.
- property url: str#
The URL for the asset in the owner’s inventory.
e.g. https://steamcommunity.com/profiles/76561198248053954/inventory/#440_2_8526584188
- await gift_to(recipient, /, *, name=None, message, closing_note, signature)#
Gifts the asset to the recipient.
- Parameters:
recipient (Friend) – The recipient to gift the asset to.
name (str | None) – The name to give the asset. If not provided, the recipient’s
name
will be used.message (str) – The message to send with the gift.
closing_note (str) – The closing note to send with the gift.
signature (str) – The signature to send with the gift.
Reactions#
- class steam.Award#
Represents an award.
- id#
The ID of the award.
- name#
The english localised name of the award.
- class steam.AwardReaction#
Represents an award on user generated content.
- award#
The award given to the user generated content.
- count#
The reactions count on the post.
- class steam.PartialMessageReaction#
Represents a partial reaction to a message.
- class steam.MessageReaction#
Represents a reaction to a message.
- user: Author#
The user that reacted to the message.
- class steam.Emoticon#
Represents an emoticon in chat.
- x == y
Checks if two emoticons are equal.
- str(x)
The string to send this emoticon in chat.
- hash(x)
Returns the emoticon’s hash.
- await app()#
Fetches this emoticon’s associated app.
- Return type:
- name#
The name of this emoticon.
- class steam.Sticker#
Represents a sticker in chat.
- x == y
Checks if two stickers are equal.
- str(x)
The way to send this sticker in chat.
- hash(x)
Returns the stickers’s hash.
Note
Unlike
Emoticon
this can only be sent in a message by itself.- await app()#
Fetches this sticker’s associated app.
- Return type:
PartialApp[None]
- name#
The name of this emoticon.
- class steam.ClientEmoticon#
Represents an
Emoticon
theClientUser
owns.- await app()#
Fetches this emoticon’s associated app.
- Return type:
- count#
The number of times this emoticon can be used.
- last_used#
The last time this emoticon was used.
- name#
The name of this emoticon.
- received_at#
The time this emoticon was received.
- 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:
- use_count#
The number of times this emoticon has been used.
- class steam.ClientSticker#
Represents a
Sticker
theClientUser
owns.- count#
The number of times this emoticon can be used.
- last_used#
The last time this emoticon was used.
- name#
The name of this emoticon.
- received_at#
The time this emoticon was received.
- 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:
- use_count#
The number of times this emoticon has been used.
- await app()#
Fetches this sticker’s associated app.
- Return type:
PartialApp[None]
- class steam.ClientEffect#
- name#
The name of this emoticon.
- 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:
- count#
The number of times this emoticon can be used.
- received_at#
The time this emoticon was received.
- await app()#
Fetches this effect’s associated app.
- Return type:
PartialApp[None]
- class steam.ClientEffect#
- name#
The name of this emoticon.
- 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:
- count#
The number of times this emoticon can be used.
- received_at#
The time this emoticon was received.
- await app()#
Fetches this effect’s associated app.
- Return type:
PartialApp[None]
Reviews#
- class steam.Review#
Represents a review for an app.
- author: ReviewUser#
The author of the review.
- app: ReviewApp#
The app being reviewed.
- created_at: datetime#
The time the review was created at.
- updated_at: datetime#
The time the review was last updated at.
- 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:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- reactions: list[AwardReaction] | None#
The review’s reactions.
- 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 (bool | None) – Whether the review should be commentable.
language (Language | None) – The language of the review. Defaults to the current value.
written_during_early_access (bool | None) – Whether the review was written during early access. Defaults to the current value.
received_compensation (bool | None) – Whether the user received compensation for this review. Defaults to the current value.
- await delete()#
Delete this review.
- class steam.ReviewUser#
- playtime_forever: timedelta#
- playtime_last_two_weeks: timedelta#
- playtime_at_review: timedelta#
- last_played: datetime#
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await add()#
Sends a friend invite to the user to your friends list.
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- property avatar: Avatar#
The user’s avatar.
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await block()#
Blocks the user.
- await cancel_invite()#
Cancels an invitation sent to the user. This effectively does the same thing as
remove()
.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- 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 (str | None) – The user’s trade offer token, not required if you are friends with the user.
- Return type:
timedelta | None
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- flags: PersonaStateFlag#
The persona state flags of the account.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
Profile[Self]
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- await remove()#
Remove the user from your friends list.
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await send(content=..., /, *, trade=None, media=None)#
Send a message, trade or image to an
User
.- Parameters:
content (Any) – The message to send to the user.
trade (TradeOffer[Asset[User], Asset[ClientUser], Any] | None) –
The trade offer to send to the user.
Note
This will have its
id
attribute updated after being sent.media (Media | None) – The media to send to the user.
- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message only applicable if
content
is passed.- Return type:
UserMessage[ClientUser] | None
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- property trade_url: URL#
The trade url of the user.
- await trigger_typing()#
Send a typing indicator to the channel once.
Note
This only works in DMs.
- property type: TypeT#
The Steam type of the ID.
- 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:
AsyncGenerator[None, None]
- await unblock()#
Unblocks the user.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
Roles#
- class steam.Role#
Represents a role in a chat group.
- id#
The ID of the role.
- name#
The name of the role.
- ordinal#
The ordinal of the role.
- permissions#
The permissions of the role.
- await edit(*, name=None, permissions=None, ordinal=None)#
Edit this role.
- Parameters:
name (str | None) – The new name of the role.
permissions (RolePermissions | None) – The new permissions of the role.
ordinal (int | None) – The new ordinal (position) of the role.
- await delete()#
Delete this role.
- class steam.RolePermissions#
Represents the permissions of a role in a chat group.
- kick#
Whether the role can kick members.
- ban_members#
Whether the role can ban members.
- invite#
Whether the role can invite members.
- manage_group#
Whether the role can manage the group.
- send_messages#
Whether the role can send messages.
- read_message_history#
Whether the role can read message history.
- change_group_roles#
Whether the role can change group roles.
- change_user_roles#
Whether the role can change user roles.
- mention_all#
Whether the role can mention all.
- set_watching_broadcast#
Whether the role can set watching broadcast.
- replace(*, kick: bool = ..., ban_members: bool = ..., invite: bool = ..., manage_group: bool = ..., send_messages: bool = ..., read_message_history: bool = ..., change_group_roles: bool = ..., change_user_roles: bool = ..., mention_all: bool = ..., set_watching_broadcast: bool = ...) Self #
Return a new RolePermissions with the specified changes.
- Return type:
Self
User News#
- class steam.UserNews(state, news, achievements)#
Represents a news entry on the activity feed.
- created_at#
When the news entry was created.
- actor#
The actor of the news entry.
- app#
The app this news entry is for.
- package#
The package this news entry is for.
- apps#
If
type
isUserNewsType.ReceivedNewGame
, the apps unlocked bypackage
. Iftype
isUserNewsType.AddedGameToWishlist
, the apps wishlisted byactor
.
- achievements#
The achievements unlocked. Only used for
UserNewsType.AchievementUnlocked
.
- shortcut_id#
The shortcut ID this news entry is for.
- event_id#
The event ID this news entry is for. Only used for
UserNewsType.ScheduledEvent
.
- announcement_id#
The announcement ID this news entry is for. Only used for
UserNewsType.PostedAnnouncement
.
- published_file_id#
The published file ID this news entry is for.
- post_id#
The post ID this news entry is for. Only used for
UserNewsType.Post
.
- target#
The target of the news entry.
- await announcement()#
Fetch the announcement this news entry is for.
- Return type:
Announcement[PartialClan]
- await published_file()#
Fetch the published file this news entry is for.
- Return type:
Users#
- class steam.PartialUser#
- property trade_url: URL#
The trade url of the user.
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- async for ... in inventories()#
Fetches all the inventories a user has.
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
- 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:
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
Profile[Self]
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await fetch_post(id, /)#
Fetch a post by its id.
- await invite_to(app)#
- Return type:
AppInvite
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- id64: Final#
The Steam ID’s 64-bit ID.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- property type: TypeT#
The Steam type of the ID.
- class steam.ClientUser#
Represents your account.
- x == y
Checks if two users are equal.
- str(x)
Returns the user’s name.
- get_friend(id, /)#
Get a friend from the client user’s friends list.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- 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 (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
OwnedProfileItems[Self]
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
ClientUserProfile
- await profile_info()#
The friend’s profile info.
- Return type:
- 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 (Media | None) –
The avatar you wish to use.
Note
This needs to be at least 184px x 184px.
- Raises:
HTTPException – Editing your profile failed.
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- property avatar: Avatar#
The user’s avatar.
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- flags: PersonaStateFlag#
The persona state flags of the account.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- property trade_url: URL#
The trade url of the user.
- property type: TypeT#
The Steam type of the ID.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
- class steam.User#
Represents a Steam user’s account.
- x == y
Checks if two users are equal.
- str(x)
Returns the user’s name.
- 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 (str | None) – The user’s trade offer token, not required if you are friends with the user.
- Return type:
timedelta | None
- await send(content=..., /, *, trade=None, media=None)#
Send a message, trade or image to an
User
.- Parameters:
content (Any) – The message to send to the user.
trade (TradeOffer[Asset[User], Asset[ClientUser], Any] | None) –
The trade offer to send to the user.
Note
This will have its
id
attribute updated after being sent.media (Media | None) – The media to send to the user.
- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message only applicable if
content
is passed.- Return type:
UserMessage[ClientUser] | None
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- 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:
AsyncGenerator[None, None]
- await trigger_typing()#
Send a typing indicator to the channel once.
Note
This only works in DMs.
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- property avatar: Avatar#
The user’s avatar.
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- flags: PersonaStateFlag#
The persona state flags of the account.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
Profile[Self]
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- property trade_url: URL#
The trade url of the user.
- property type: TypeT#
The Steam type of the ID.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
- class steam.Friend#
Represents a friend of the
ClientUser
.- await profile_info()#
The friend’s profile info.
- Return type:
- await profile(*, language=None)#
Fetch a user’s entire profile information.
- Parameters:
language (Language | None) – 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:
FriendProfile
- await owns(app)#
Whether the app is owned by this friend.
- await invite_to_group(group, /)#
Invites the user to a
Group
.- Parameters:
group (ID[Literal[Type.Chat]]) – The group to invite the user to.
- await invite_to_clan(clan, /)#
Invites the user to a
Clan
.- Parameters:
clan (ID[Literal[Type.Clan]]) – The clan to invite the user to.
- async for ... in posts(*, limit=None, before=None, after=None, app=None)#
Fetches this friend’s posts.
- Parameters:
- Return type:
AsyncGenerator[Post[Self], None]
- is_friend()#
Whether the user is in the
ClientUser
’s friends.- Return type:
- await achievements(app, /, *, language=None)#
Fetch the achievements for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- await add()#
Sends a friend invite to the user to your friends list.
- app: PartialApp[str] | None#
The app the user is currently in. Is
None
if the user isn’t in an app.
- await app_stats(app, /, *, language=None)#
Fetch the stats for the user in the app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
will default to the current language.- Return type:
- property avatar: Avatar#
The user’s avatar.
- await badges()#
Fetches the user’s
UserBadges
s.- Return type:
UserBadges[Self]
- await block()#
Blocks the user.
- await cancel_invite()#
Cancels an invitation sent to the user. This effectively does the same thing as
remove()
.
- await comment(content, /, *, subscribe=True)#
Post a comment to a comments section.
- Parameters:
- Returns:
The created comment.
- Return type:
Comment[Self, ClientUser]
- async for ... in comments(*, oldest_first=False, limit=None, before=None, after=None)#
An asynchronous iterator 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)
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:
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- await equipped_profile_items(*, language=None)#
The user’s equipped profile items.
- Parameters:
language (Language | None) – The language to fetch the profile items in. If
None
the current language is used- Return type:
EquippedProfileItems[Self]
- 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 (str | None) – The user’s trade offer token, not required if you are friends with the user.
- Return type:
timedelta | None
- await favourite_badge()#
The user’s favourite badge.
- Return type:
FavouriteBadge[PartialApp | Literal[STEAM]] | None
- await fetch_comment(id, /)#
Fetch a comment by its ID.
- await fetch_message(id, /)#
Fetch a message by its
Message.id
.- Return type:
MessageT | None
- await fetch_post(id, /)#
Fetch a post by its id.
- await fetch_published_file(id, /, *, revision=PublishedFileRevision.Default, language=None)#
Fetch a published file by its id.
- Parameters:
id (int) – The id of the published file to fetch.
revision (PublishedFileRevision) – The desired revision of the published file to fetch.
language (Language | None) – The language to fetch the published file in. If
None
, the current language is used.
- Return type:
PublishedFile[Self] | None
- await fetch_review(app)#
Fetch this user’s review for an app.
- await fetch_reviews(*apps)#
Fetch this user’s review for apps.
- flags: PersonaStateFlag#
The persona state flags of the account.
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
- game_server_ip: IPv4Address | None#
The IP address of the game server the user is currently playing on.
- async for ... in history(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a channel’s
steam.Message
s.Examples
Usage:
async for message in channel.history(limit=10): print("Author:", message.author, "Said:", message.content)
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 (datetime | None) – A time to search for messages before.
after (datetime | None) – A time to search for messages after.
- Yields:
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- id64: Final#
The Steam ID’s 64-bit ID.
- async for ... in inventories()#
Fetches all the inventories a user has.
- await inventory(app, /, *, context_id=None, language=None)#
Fetch a user’s
Inventory
for trading.- Parameters:
- Raises:
Forbidden – The user’s inventory is private.
- Return type:
- await inventory_info()#
Fetch the inventory info of the user.
Source for UserInventoryInfo:@dataclass(slots=True) class UserInventoryInfo(Generic[UserT]): user: UserT app: UserInventoryInfoApp total_count: int trade_permissions: str load_failed: bool store_vetted: bool owner_only: bool contexts: list[UserInventoryInfoContext] async def inventories(self) -> AsyncGenerator[Inventory[Item[UserT], UserT], None]: """An :term:`asynchronous iterator` for accessing a user's full inventory in an app.""" for context in self.contexts: yield await self.user.inventory(App(id=self.app.id), context_id=context.id)
- Return type:
list[UserInventoryInfo[Self]]
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- await invite_to(app)#
- Return type:
AppInvite
- 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:
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- last_logoff: datetime | None#
The last time the user logged off steam. Could be None (e.g. if they are currently online).
- await profile_customisation_info()#
Fetch a user’s profile customisation information.
- Return type:
ProfileCustomisation[Self]
- async for ... in published_files(*, app=None, revision=PublishedFileRevision.Default, type=PublishedFileType.Community, language=None, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
PublishedFile
s.Examples
Usage:
async for file in user.published_files(limit=10): print("Author:", file.author, "Published:", file.name)
All parameters are optional.
- Parameters:
app (App | None) – The app 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 (Language | None) – The language to fetch the published file in. If
None
, the current language is used.limit (int | None) – The maximum number of published files to search through. Setting this to
None
will fetch all of the user’s published files.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await recently_played()#
Fetches the apps the user has recently played.
- Return type:
list[UserRecentlyPlayedApp]
- await remove()#
Remove the user from your friends list.
- async for ... in reviews(*, limit=None, before=None, after=None)#
An asynchronous iterator for accessing a user’s
Review
s.Examples
Usage:
async for review in user.reviews(limit=10): recommended = "recommended" if review.recommend else "doesn't recommend" print(f"Author: {review.author} {recommended} {review.app}")
All parameters are optional.
- await send(content=..., /, *, trade=None, media=None)#
Send a message, trade or image to an
User
.- Parameters:
content (Any) – The message to send to the user.
trade (TradeOffer[Asset[User], Asset[ClientUser], Any] | None) –
The trade offer to send to the user.
Note
This will have its
id
attribute updated after being sent.media (Media | None) – The media to send to the user.
- Raises:
HTTPException – Sending the message failed.
Forbidden – You do not have permission to send the message.
- Returns:
The sent message only applicable if
content
is passed.- Return type:
UserMessage[ClientUser] | None
- await server()#
Fetch the game server this user is currently playing on.
- Return type:
- state: PersonaState#
The current persona state of the account (e.g. LookingToTrade).
- property trade_url: URL#
The trade url of the user.
- await trigger_typing()#
Send a typing indicator to the channel once.
Note
This only works in DMs.
- property type: TypeT#
The Steam type of the ID.
- 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:
AsyncGenerator[None, None]
- await unblock()#
Unblocks the user.
- await wishlist()#
Get the
WishlistApp
s the user has on their wishlist.- Return type:
Wallet#
- class steam.Wallet#
Wallet(_state: ‘ConnectionState’, balance: ‘int’, currency: ‘Currency’, balance_delayed: ‘int’, realm: ‘Realm’)
Data-Classes#
There are a few classes that can be constructed by the user, these include.
App#
- class steam.App(*, id, name=None)#
Represents a Steam app.
- id: AppID#
The app’s app ID.
- name#
The app’s name.
There are some predefined apps which are:
- steam.TF2 = TF2#
This is “enum” to trick type checkers into allowing Literal[TF2] to be valid for overloads in extensions.
- steam.DOTA2 = DOTA2#
This is “enum” to trick type checkers into allowing Literal[TF2] to be valid for overloads in extensions.
- steam.CSGO = CSGO#
This is “enum” to trick type checkers into allowing Literal[TF2] to be valid for overloads in extensions.
- steam.LFD2 = LFD2#
This is “enum” to trick type checkers into allowing Literal[TF2] to be valid for overloads in extensions.
- steam.STEAM = STEAM#
This is “enum” to trick type checkers into allowing Literal[TF2] to be valid for overloads in extensions.
These are shorthand for Client.get_game(440)
etc. (you need a client to have been constructed and be use to use the
methods that they inherit from PartialApp
), they are also valid as type parameters to typing.Literal
Apps can be manually constructed using their app ID eg:
my_rust_instance = steam.App(id=252490, name="Rust")
# this can then be used for trading an app name is not required for this
- steam.CUSTOM_APP(name)#
Create a custom app instance for
change_presence()
. TheApp.id
will be set to15190414816125648896
.Example:
await client.change_presence(app=steam.CUSTOM_APP("my cool game"))
- class steam.OwnershipTicket#
Represents an ownership ticket. This is used to verify ownership of an app.
- app#
The app the ticket is for.
- created_at#
The time the ticket was created.
- dlc#
The DLC the user owns.
- external_ip#
The external IP address of the user.
- flags#
The flags of the ticket.
- internal_ip#
The internal IP address of the user.
- licenses#
The licenses the user owns.
- signature#
The signature of the ticket.
- user#
The user who owns the ticket.
- version#
The version of the ticket.
- class steam.AuthenticationTicket#
Represents an authentication ticket. This is used to verify ownership of an app and to connect to the game server.
- auth_ticket#
The authentication ticket for the app. The first 52 bytes of the ticket.
- gc_token#
The Game Connect token for the app.
- gc_token_created_at#
When the Game Connect token was created.
- client_ip#
The IP address of the client.
- client_connected_at#
The time the client has been connected to Steam
- client_connection_count#
How many servers the client has connected to
- await verify(*, publisher_api_key=None)#
Verify the ticket with the web API.
- Parameters:
publisher_api_key (str | None) – The publisher API key to use for verification. If not provided, will use the standard (rate limited) API.
- Return type:
- await activate()#
Activate the ticket.
- await deactivate()#
Deactivate the ticket. Ends our sessions with other users meaning we can’t get events from them anymore.
- app#
The app the ticket is for.
- created_at#
The time the ticket was created.
- dlc#
The DLC the user owns.
- external_ip#
The external IP address of the user.
- flags#
The flags of the ticket.
- internal_ip#
The internal IP address of the user.
- licenses#
The licenses the user owns.
- signature#
The signature of the ticket.
- user#
The user who owns the ticket.
- version#
The version of the ticket.
- class steam.EncryptedTicket#
Represents an encrypted ticket.
- user_data#
The user’s given data for the ticket.
- version#
The version of the ticket.
- user#
The user who owns the ticket.
- app#
The app the ticket is for.
- external_ip#
The external IP address of the user.
- internal_ip#
The internal IP address of the user.
- flags#
The flags of the ticket.
- created_at#
The time the ticket was created.
- licenses#
The licenses the user owns.
- dlc#
The DLC the user owns.
- signature#
The signature of the ticket.
- class steam.AppShopItem(state, data, description, tags)#
Represents an item that can be purchased from the shop.
- class_id: ClassID#
The classid of the item.
- def_index#
The def index of the item in the app’s schema
- class_#
Extra info about the item.
- prices#
The prices of the asset in the store.
- original_prices#
The original prices of any items if the price in
prices
is reduced.
- updated_at#
The time the price was last updated
- store_tags#
The tags associated with the item.
- name#
The market_name of the item.
- type#
The type of the item.
- tags#
The tags of the item.
- colour#
The colour of the item.
- icon#
The icon url of the item. Uses the large image url where possible.
- display_name#
The displayed name of the item. This could be different to
Item.name
if the item is user re-nameable.
- market_hash_name#
The market_hash_name of the item.
- descriptions#
The descriptions of the item.
- owner_descriptions#
The descriptions of the item which are visible only to the owner of the item.
- fraud_warnings#
The fraud warnings for the item.
- actions#
The actions for the item.
- owner_actions#
The owner actions for the item.
- market_actions#
The market actions for the item.
- market_fee#
The market fee percentage for the item.
- property app: PartialApp[None]#
The app the item is from.
- instance_id: InstanceID#
The instanceid of the item.
- listings()#
Fetch the listings of this item on the Steam Community Market place.
- Return type:
AsyncGenerator[Listing, None]
- property market_fee_app: PartialApp[None]#
The app for which the Steam Community Market fee percentage is applied.
- await name_id()#
Fetch the item_nameid of this item on the Steam Community Market place.
- Return type:
- await price(*, currency=None)#
Fetch the price of this item on the Steam Community Market place.
Shorthand for:
await client.fetch_price(item.market_hash_name, item.app, currency)
- Return type:
- class steam.AppShopItemTag(name: 'str', display_name: 'str', id: 'int')#
- class steam.AppShopItems(items, tags)#
Represents the items that can be purchased from the shop.
- x == y
Checks if two app shop items are equal.
- len(x)
Returns the number of items in the shop.
- x[i]
Returns the item at index
i
.
- items: Sequence[AppShopItem]#
The items that can be purchased from the shop
- tags: Sequence[AppShopItemTag]#
All the possible tags for
items
to have.
- count(value) integer -- return number of occurrences of value #
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- class steam.CommunityItem(_state, type, app, name, title, description, image, movie, data, series, class_, editor, active, image_composed, image_composed_foil, deleted, edited_at)#
Represents a community item.
- x == y
Checks if two community items are equal.
- hash(x)
Returns the community item’s hash.
- app: AppT#
The app the community item is from.
- image: CDNAsset | None#
The image of the community item. Attempts to use the larger image if possible.
- class_: CommunityItemClass#
The class of the community item.
- class steam.RewardItem(type, app, name, title, description, display_description, image, movie, animated, badges, def_index, quantity, class_, item_type, point_cost, created_at, updated_at, available_at, availability_ends, active, profile_theme_id, usable_duration, bundle_discount)#
Represents a reward item in the Steam Points Shop.
- app: AppT#
The app the reward item is from.
- class_: CommunityItemClass#
The class of the reward item.
- class steam.app.PartialApp#
Apps that have state.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
Manifest
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- await badges(*, language=None)#
Fetch this app’s badges.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- id: AppID#
The app’s app ID.
- name#
The app’s name.
- class steam.UserApp#
Represents a Steam app fetched by
steam.User.apps()
.- playtime_two_weeks: timedelta#
The amount of time the user has played the app in the last two weeks.
- icon#
The icon of the app.
- last_played_at#
The time the user last played this app at.
- content_descriptors#
The content descriptors of the app.
- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- name#
The app’s name.
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- class steam.WishlistApp#
Represents a Steam app fetched by
steam.User.wishlist()
.- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- name#
The app’s name.
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- priority#
The priority of the app in the wishlist.
- type#
The type of the app.
- logo#
The logo of the app.
- score#
The score of the app out of ten.
- total_reviews#
The total number reviews for the app.
- review_status#
The review status of the app.
- created_at#
The time the app was uploaded at.
- screenshots#
The screenshots of the app.
- added_at#
The time that the app was added to their wishlist.
- background#
The background of the app.
- tags#
The tags of the app.
- rank#
The global rank of the app by popularity.
- partial_packages: list[PartialPackage]#
The packages this app is included in.
- partial_bundles: list[PartialBundle]#
The bundles this app is included in.
- class steam.FetchedApp#
Represents a Steam app fetched by
steam.Client.fetch_app()
.- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- name#
The app’s name.
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
- logo#
The logo of the app.
- background#
The background of the app.
- created_at#
The time the app was uploaded at.
- type#
The type of the app.
- price_overview#
The price overview of the app.
- partial_dlc#
The app’s downloadable content.
- website_url#
The website URL of the app.
- developers#
The developers of the app.
- publishers#
The publishers of the app.
- description#
The short description of the app.
- full_description#
The full description of the app.
- movies#
A list of the app’s movies, each of which has
name
,id
,url
and optionalcreated_at
attributes.
- content_descriptors#
The app’s content descriptors for explicit content
- class steam.DLC#
Represents DLC (downloadable content) for an app.
- created_at#
The time the DLC was released at.
- logo#
The logo url of the DLC.
- price_overview#
A price overview for the DLC.
- await achievements(*, language=None)#
The achievements for this app.
- Parameters:
language (Language | None) – The language to fetch the achievements in. If
None
, the current language will be used.- Return type:
- await add_free_licenses()#
Request the free licenses for this app.
- Raises:
ValueError – No licenses were granted.
- Return type:
- await badges(*, language=None)#
Fetch this app’s badges.
- await clan()#
Fetch this app’s clan.
This can be useful to get an App’s updates.
clan = await app.clan() async for update in clan.announcements(): if update.type in (steam.EventType.MajorUpdate, steam.EventType.SmallUpdate): ... # do something with the update
- Raises:
ValueError – This app has no associated clan.
- Return type:
- await community_items(*, type=CommunityDefinitionItemType.NONE, language=None)#
Fetch the app’s community item definitions.
- Parameters:
type (CommunityDefinitionItemType) – The type of community item definitions to fetch.
language (Language | None) – The language to fetch the community item definitions in. If
None
, the current language will be used.
- Return type:
list[CommunityItem[Self]]
- async with create_authentication_ticket()#
Create an authentication ticket for this app.
Examples
async with app.create_authentication_ticket() as ticket: ... # send the ticket to a user or server # ticket will only be valid inside this block
- Return type:
AsyncGenerator[AuthenticationTicket, None]
- await create_leaderboard(name)#
Create a leaderboard with a given name.
- Parameters:
name (str) – The name of the leaderboard to create.
- Return type:
Leaderboard[Self, None]
- await depots()#
Fetch the depots for this app.
- Return type:
Sequence[Depot | HeadlessDepot]
- await dlc(*, language=None)#
Fetch the app’s DLC.
- await encrypted_ticket(key, *, user_data=b'')#
Fetch an encrypted ticket for this app.
- Parameters:
- Return type:
- await fetch(*, language=None)#
Fetch this app.
Shorthand for:
app = await client.fetch_app(app_id, language=language)
- Return type:
- await fetch_leaderboard(name)#
Fetch a leaderboard by name.
- Parameters:
name (str) –
The name of the leaderboard to fetch.
Note
This is not the name of the leaderboard shown in the app’s stat page, you can find the name of the leaderboard from
leaderboards()
.- Return type:
Leaderboard[Self, None]
- await fetch_manifest(*, id, depot_id, branch='public', password_hash='')#
Fetch a CDN manifest for an app.
- await friend_thoughts()#
Fetch the client user’s friends who recommended and didn’t recommend this app in a review.
Source for FriendThoughts:class FriendThoughts(NamedTuple): recommended: list[Friend] not_recommended: list[Friend]
- Return type:
FriendThoughts
- await friends_who_own()#
Fetch the users in your friend list who own this app.
- id: AppID#
The app’s app ID.
- await info()#
Fetches this app’s product info.
Shorthand for:
(info,) = await client.fetch_product_info(apps=[app])
- Return type:
- await leaderboards(*, language=None)#
The leaderboards for this app.
- Parameters:
language (Language | None) – The language to fetch the leaderboards in. If
None
, the current language will be used.- Return type:
list[Leaderboard[Self, str]]
- async for ... in manifests(*, limit=100, before=None, after=None, branch='public', password=None, password_hash='')#
An asynchronous iterator for accessing a this app’s
steam.Manifest
s.Examples
Usage:
async for manifest in app.manifests(limit=10): print("Manifest:", manifest.name) print(f"Contains {len(manifest.paths)} manifests")
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of
Manifests
to return.before (datetime | None) – The time to get manifests before.
after (datetime | None) – The time to get manifests after.
branch (str) – The name of the branch to fetch manifests from.
password (str | None) – The password for the branch, if any.
password_hash (str) – The hashed password for a manifest.
- Yields:
- name#
The app’s name.
- await ownership_ticket()#
Fetch an ownership ticket for this app.
- Return type:
- await packages(*, language=None)#
Fetch the app’s packages.
- Parameters:
language (Language | None) – The language to fetch the packages in. If
None
, the current language will be used.- Return type:
- async for ... in published_files(*, type=PublishedFileQueryFileType.Items, revision=PublishedFileRevision.Default, language=None, limit=100, before=None, after=None)#
An asynchronous iterator for accessing an app’s
steam.PublishedFile
s.Examples
Usage:
async for published_file in app.published_files(limit=10): print("Published file:", published_file.name) print("Published at:", published_file.created_at) print("Published by:", published_file.author)
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 (Language | None) – 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 toNone
will fetch all the app’s published files, but this will be a very slow operation.before (datetime | None) – A time to search for published files before.
after (datetime | None) – A time to search for published files after.
- Yields:
- await review(content, *, recommend, public=True, commentable=True, received_compensation=False, language=None)#
Review an app.
- Parameters:
content (str) – The content of the review.
recommend (bool) – Whether you recommended the app.
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:
- async for ... in reviews(*, limit=100, before=None, after=None)#
An asynchronous iterator for accessing a
steam.App
’ssteam.Review
s.Examples
Usage:
async for review in app.reviews(limit=10): print("Reviewer:", review.author) print("Said:", review.content)
All parameters are optional.
- Parameters:
limit (int | None) – The maximum number of reviews to search through. Default is
100
. Setting this toNone
will fetch all the app’s reviews, but this will be a very slow operation.before (datetime | None) – A time to search for reviews before.
after (datetime | None) – A time to search for reviews after.
- Yields:
- await reward_items(*, language=None)#
Fetch the app’s reward item definitions.
- Parameters:
language (Language | None) – The language to fetch the reward item definitions in. If
None
, the current language will be used.- Return type:
list[RewardItem[Self]]
- async for ... in search_market(query='', *, limit=100, search_description=True, sort_by='popular', reverse=True, filters=())#
Fetch the Steam Community Market listings for this app.
- Parameters:
query (str) – The query to search for.
limit (int | None) – The maximum number of listings to search through. Default is
100
. Setting this toNone
will fetch all the app’s listings, but this will be a very slow operation.search_description (bool) – Whether to search in the description of the listing.
sort_by (market.SortBy) – The column to sort the listings by.
reverse (bool) – Whether to sort the listings in descending order. Default is
True
. IfFalse
the listings will be sorted in ascending order.filters (Sequence[AppMarketFilter]) – The filters to apply to the search.
- Return type:
AsyncGenerator[MarketSearchListing, None]
- await shop_items(*, currency=None, language=None)#
Fetch the items that are purchasable inside of the app’s shop.
- Parameters:
- Return type:
- await stats(*, language=None)#
The stats for this app.
- Parameters:
language (Language | None) – The language to fetch the stats in. If
None
, the current language will be used.
See also
- Return type:
- await store_item(*, language=None)#
Fetch the store item for this app.
Shorthand for:
(item,) = await client.fetch_store_item(apps=[app], language=language)
- Return type:
Steam IDs#
- class steam.ID(id, *, type=None, universe=None, instance=None)#
Convert a Steam ID between its various representations.
- x == y
Checks if two IDs are equal.
- hash(x)
Returns the hash of the ID.
- str(x)
Returns the string representation of
id64
.
- int(x)
Returns the
id64
of the ID.
- format(x, format_spec)
Formats the ID using the given format spec.
Prefixes of
32
,64
can be used to specify which ofid
orid64
to use. Anything after the prefix is passed toformat()
.E.g.
>>> format(steam_id, "64x") # formats the `id64` as a hex string "11000010264339c" >>> format(steam_id, "32b") # formats the `id` as binary "10011001000011001110011100" >>> f"{steam_id:32b}" # same as above
- Parameters:
- property type: TypeT#
The Steam type of the ID.
- property id: ID32#
The Steam ID’s 32-bit ID.
- property id2_zero: str#
The Steam ID’s ID 2 accounted for bugged GoldSrc and Orange Box games.
Note
In these games the accounts
universe
,1
forType.Public
, should be theX
component ofSTEAM_X:0:1234
however, this was bugged and the value ofX
was0
.e.g
STEAM_0:0:1234
.
- property invite_code: str | None#
The Steam ID’s invite code in the s.team invite code format.
e.g.
cv-dgb
.
- property community_url: str | None#
The Steam ID’s community url if it is a
Type.Individual
orType.Clan
.e.g
https://steamcommunity.com/profiles/123456789
orhttps://steamcommunity.com/gid/123456789
.
- is_valid()#
Whether this Steam ID is valid.
A Steam ID is currently considered valid if:
- Return type:
- staticmethod from_id2(value, /)#
Create an ID from a user’s
id2
.- Parameters:
value (str) – The ID2 e.g.
STEAM_1:0:1234
.
Note
The universe will be set to
Universe.Public
if it’s0
. SeeID.id2_zero
.- Return type:
IndividualID | None
- staticmethod from_invite_code(value, /)#
Create an ID from a user’s
invite_code
.
- staticmethod await from_url(url, /, session=None)#
Fetches the ID associated with a Steam Community URL or
None
.Note
Each call makes an HTTP request to https://steamcommunity.com.
Examples
The following are valid calls:
>>> await ID.from_url("https://steamcommunity.com/groups/Valve") >>> await ID.from_url("https://steamcommunity.com/gid/103582791429521412") >>> await ID.from_url("https://steamcommunity.com/gid/[g:1:4]") ID(id=4, type=Type.Clan, universe=Universe.Public, instance=Instance.All) >>> await ID.from_url("https://steamcommunity.com/id/johnc") >>> await ID.from_url("https://steamcommunity.com/profiles/76561197960265740") >>> await ID.from_url("https://steamcommunity.com/profiles/[U:1:12]") >>> await ID.from_url("https://steamcommunity.com/user/r") ID(id=12, type=Type.Individual, universe=Universe.Public, instance=Instance.Desktop) >>> await ID.from_url("https://steamcommunity.com/app/570") ID(id=3703047, type=Type.Clan, universe=Universe.Public, instance=Instance.All)
- Parameters:
url (StrOrURL) – The Steam Community URL.
session (ClientSession | None) – The session to make the request with. If
None
, one is generated.
- Return type:
ID[Literal[Type.Individual, Type.Clan]] | None
TradeOffers#
- class steam.TradeOffer(*, message=None, token=None, sending=None, receiving=None)#
Represents a trade offer from/to send to a User. This can also be used in
steam.User.send()
.- Parameters:
sending (Sequence[SendingAssetT] | SendingAssetT | None) – The items you are sending to the other user.
receiving (Sequence[ReceivingAssetT] | ReceivingAssetT | None) – The items you are receiving from the other user.
token (str | None) – The trade token used to send trades to users who aren’t on the ClientUser’s friend’s list.
message (str | None) – The offer message to send with the trade.
- id: TradeOfferID#
The trade offer’s ID.
- user: UserT#
The trade offer partner.
- sending: Sequence[SendingAssetT]#
The items you are sending to the partner.
- receiving: Sequence[ReceivingAssetT]#
The items you are receiving from the partner.
- token: str | None#
The trade token used to send trades to users who aren’t on the ClientUser’s friend’s list.
- escrow: timedelta | None#
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.
- state#
The offer state of the trade for the possible types see
TradeOfferState
.
- await confirm()#
Confirms the trade offer. This rarely needs to be called as the client handles most of these.
- Raises:
ValueError – The trade is not active.
steam.ConfirmationError – No matching confirmation could not be found.
- await accept()#
Accepts the trade offer.
Note
This also calls
confirm()
(if necessary) so you don’t have to.- Raises:
ValueError – The trade is either not active, already accepted or not from the ClientUser.
ConfirmationError – No matching confirmation could not be found.
- await decline()#
Declines the trade offer.
- Raises:
ValueError – The trade is either not active, already declined or not from the ClientUser.
- await cancel()#
Cancels the trade offer.
- Raises:
ValueError – 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.
Source for TradeOfferReceipt:class TradeOfferReceipt(NamedTuple, Generic[ItemOwnerT]): sent: list[MovedItem[ClientUser]] received: list[MovedItem[ItemOwnerT]]
- Returns:
A trade receipt.
- Return type:
TradeOfferReceipt[UserT]
- await counter(trade, /)#
Counter a trade offer from an
User
.- Parameters:
trade (TradeOffer[Asset[UserT], Asset[ClientUser], Any]) – The trade offer to counter with.
- Raises:
ValueError – The trade from the ClientUser or it isn’t active.
- is_gift()#
Helper method that checks if an offer is a gift to the
ClientUser
- Return type:
- is_our_offer()#
Whether the offer was created by the
ClientUser
.- Return type:
Media#
- class steam.Media(fp, *, spoiler=False)#
A wrapper around common media files. Used for
steam.User.send()
.- Parameters:
Note
- Currently supported media types include:
PNG
JPG/JPEG
GIF
WEBM
MPG/MPEG
MP4
OGV
Exceptions#
The following exceptions are thrown by the library.
- exception steam.SteamException#
Base exception class for steam.py.
- 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
.
- 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
.
- 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 toForbidden
.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 toNotFound
.Subclass of
WSException
.
- exception steam.InvalidID(id, type, universe, instance, msg=None)#
Exception that’s thrown when a Steam ID cannot be valid.
Subclass of
SteamException
.