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,
Noneotherwise. 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: dictChanged 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,
Noneotherwise.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) – Adictcontaing item names and AppIDs. There is an example on how thisdictshould be constructed inexample.py.Returns: An overview of each item. Return type: dictNew in version 1.1.0.
-
price_to_float(value: str)¶ Converts a price from
strtofloatParameters: value ( str) – A priceReturns: floatif currency is not inUNSUPPORTED_CURRENCYReturn 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: Trueif the item name is invalid,Falseotherwise.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.