Steam market api python

steam_community_market

Get prices and volumes of any item on the Steam Community Market _ using Python 3.

.. contents:: Table of Contents :depth: 1

Installing

Install and update using pip _:

pip install steam_community_market 

Usage

from steam_community_market import Market, AppID market = Market("USD") item = "AK-47 | Redline (Field Tested)" market.get_lowest_price(item, AppID.CSGO) 14.98 market.get_volume(item, 730) 1097 

«USD» can either be ESteamCurrency , str , int or empty. Find the currencies supported here _.

Documentation

Documentation for this package can be found on readthedocs _.

  • Documentation _
  • Releases _
  • Issue tracker _
  • Discord _
  • Donate _

License

Copyright (c) 2020 offish _

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Источник

market.py¶

An overview of the item on success, None otherwise. Overview includes both volume and prices.

Gets the overview of each item in the list.

  • 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.

Gets the volume of an item.

  • 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.

The volume if success, None otherwise.

Gets the lowest and/or median price of an item, if they exist.

  • 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.

The lowest and/or median price of the item, if suceess. :class: None otherwise.

Gets the lowest price of an item.

  • 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.

The lowest price of the item, if suceess. :class: None otherwise.

Gets the median price of an item.

  • 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.

The median price of the item, if suceess. :class: None otherwise.

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

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) 

Источник

Читайте также:  Select menus discord python
Оцените статью