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.

get_overviews(names: list, app_id) → dict

Gets the overview of each item in the list.

Parameters:
  • names (list) – A list of item names how they appear on the Steam Community Market.
  • app_id (list, int, AppID) – If given a list, it needs to have the same length as the names. If given int or AppID, every item in names must have this AppID.
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.

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.

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.

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.

get_overviews_from_dict(items: dict) → dict

Gets the overview of each item in the dict.

Parameters:items (dict) – A dict containg item names and AppIDs. There is an example on how this dict should be constructed in example.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 to float

Parameters:value (str) – A price
Returns:float if currency is not in UNSUPPORTED_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.