market.py¶
Market¶
-
class
steam_community_market.
Market
(currency=<ESteamCurrency.USD: 1>)¶ -
get_overview
(name: str, app_id) → dict¶ Gets the prices and volume of an item.
Parameters: - name (
str
) – The name of the item how it appears on the Steam Community Market. - app_id (
int
,AppID
) – The AppID of the game the item is from.
Returns: An overview of the item on success,
None
otherwise. Overview includes both volume and prices.Return type: Optional[
dict
]Changed in version 1.2.3.
New in version 1.0.0.
- name (
-
get_overviews
(names: list, app_id) → dict¶ Gets the overview of each item in the list.
Parameters: Returns: An overview of each item.
Return type: dict
Changed in version 1.2.0.
New in version 1.0.0.
-
get_volume
(name: str, app_id)¶ Gets the volume of an item.
Parameters: - name (
str
) – The name of the item how it appears on the Steam Community Market. - app_id (
int
,ESteamCurrency
) – The AppID of the game the item is from.
Returns: The volume if success,
None
otherwise.Return type: Optional[
int
]New in version 1.2.0.
- name (
-
get_prices
(name: str, app_id)¶ Gets the lowest and/or median price of an item, if they exist.
Parameters: - name (
str
) – The name of the item how it appears on the Steam Community Market. - app_id (
int
,ESteamCurrency
) – The AppID of the game the item is from.
Returns: The lowest and/or median price of the item, if suceess. :class: None otherwise.
Return type: Optional[
dict
]New in version 1.2.0.
- name (
-
get_lowest_price
(name: str, app_id)¶ Gets the lowest price of an item.
Parameters: - name (
str
) – The name of the item how it appears on the Steam Community Market. - app_id (
int
,ESteamCurrency
) – The AppID of the game the item is from.
Returns: The lowest price of the item, if suceess. :class: None otherwise.
Return type: Optional[Union[
float
,str
]]New in version 1.2.0.
- name (
-
get_median_price
(name: str, app_id)¶ Gets the median price of an item.
Parameters: - name (
str
) – The name of the item how it appears on the Steam Community Market. - app_id (
int
,ESteamCurrency
) – The AppID of the game the item is from.
Returns: The median price of the item, if suceess. :class: None otherwise.
Return type: Optional[Union[
float
,str
]]New in version 1.2.0.
- name (
-
get_overviews_from_dict
(items: dict) → dict¶ Gets the overview of each item in the
dict
.Parameters: items ( dict
) – Adict
containg item names and AppIDs. There is an example on how thisdict
should be constructed inexample.py
.Returns: An overview of each item. Return type: dict
New in version 1.1.0.
-
price_to_float
(value: str)¶ Converts a price from
str
tofloat
Parameters: value ( str
) – A priceReturns: float
if currency is not inUNSUPPORTED_CURRENCY
Return type: Optional[Union[ float
,str
]]
-
has_invalid_name
(name: str) → bool¶ Checks if given item name is invalid.
Parameters: name ( str
) – The name of the item how it appears on the Steam Community Market.Returns: True
if the item name is invalid,False
otherwise.Return type: bool
-
fix_name
(name: str) → str¶ Replaces “/” with “-” and returns the item name.
Parameters: name ( str
) – The name of the item how it appears on the Steam Community Market.Returns: The correct item name. Return type: str
-
UNSUPPORTED_CURRENCY¶
"RUB",
"VND",
"KRW",
"CLP",
"PEN",
"COP",
"CRC"
These currencies are supported, but won’t
be converted to float
due to “weird” formatting.
from steam_community_market import Market
market = Market("RUB")
market.get_lowest_price("Mann Co. Supply Crate Key", 440)
163,80 pуб.
New in version 1.2.0.