Easily get item prices and volumes from the Steam Community Market using Python 3
Project description
steam_community_market
Easily get item prices and volumes from the Steam Community Market using Python 3
Table of Content
Installation
pip install steam_community_market
Usage
from steam_community_market.market import Market
market = Market('USD')
'USD'
can either be str
, int
or empty. Find the currencies supported here.
Methods
Get one item:
get_price(name: str, app_id: int)
>>> market.get_price('Prisma Case', 730)
{'success': True, 'lowest_price': '$0.41', 'volume': '59,613', 'median_price': '$0.41'}
name
: The name of an item how it appears on the Steam Community Market.
app_id
: The AppID of the item.
Get multiple items with different AppIDs:
get_prices(names: list, app_id: (int, list))
>>> items = ['Prisma Case', 'Danger Zone Case', 'Spectrum 10 Case']
>>> appids = [730, 730, 440]
>>> market.get_prices(items, appids)
{
'Prisma Case': {
'success': True,
'lowest_price': '$0.39',
'volume': '59,613',
'median_price': '$0.41'
},
'Danger Zone Case': {
'success': True,
'lowest_price': '$0.20',
'volume': '56,664',
'median_price': '$0.22'
},
'Spectrum 10 Case': {
'success': False
}
}
names
: A list of items how each item name (market_hash_name) appears on the Steam Community Market.
app_id
: A list of AppIDs.
Get multiple items with the same AppID:
get_prices(names: list, app_id: (int, list))
>>> items = ['Prisma Case', 'Danger Zone Case', 'Spectrum 10 Case']
>>> market.get_prices(items, 730)
{
'Prisma Case': {
'success': True,
'lowest_price': '$0.39',
'volume': '59,613',
'median_price': '$0.41'
},
'Danger Zone Case': {
'success': True,
'lowest_price': '$0.20',
'volume': '56,664',
'median_price': '$0.22'
},
'Spectrum 10 Case': {
'success': False
}
}
names
: A list of items how each item name (market_hash_name) appears on the Steam Community Market.
app_id
: The AppID of the items.
All of the items listed in names
must have the same app_id
.
Get multiple items with different AppIDs from dict
get_prices_from_dict(items: dict)
>>> items = {
"Mann Co. Supply Crate Key": {
"appid": 440
},
"AK-47 | Redline (Field-Tested)": {
"appid": 730
}
}
>>> market.get_prices_from_dict(items)
{
'Mann Co. Supply Crate Key': {
'success': True,
'lowest_price': '$2.50',
'volume': '6,489',
'median_price': '$2.45'
},
'AK-47 | Redline (Field-Tested)': {
'success': True,
'lowest_price': '$15.00',
'volume': '749',
'median_price': '$14.78'
}
}
License
MIT 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for steam_community_market-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81585b0912fec5f93c1ee947034263df9e2c9e727b0a94d728f08067065f30a7 |
|
MD5 | b6eb5747841db51d0be8a22a220c90c5 |
|
BLAKE2b-256 | b82843f9eb341143cf0b3e117de93fa0ef732c0efda978493bee9704ea6597e0 |