BackpackTF#

Usage#

from tf2_utils import BackpackTF

bptf = BackpackTF(
    "token",
    "steam_id",
    "api key not needed as of now",
    "superbot5000's user agent message",
)

# will add the lightning icon and indicate that the user is a bot
bptf.register_user_agent()

listing = bptf.create_listing(
    "5021;6", "buy", {"metal": 62.11}, "buying keys for listed price :)"
)

print(listing)

asset_id = 11543535227
listing = bptf.create_listing(
    "30745;6",
    "sell",
    {"keys": 1, "metal": 2.11},
    "selling my Siberian Sweater as i dont want it anymore",
    11543535227,
)

print(listing)

bptf.delete_listing_by_asset_id(11543535227)  # sell
bptf.delete_listing_by_sku("5021;6")  # buy
# or
bptf.delete_all_listings()
class src.tf2_utils.backpack_tf.Currencies(keys: int = 0, metal: float = 0.0)#
keys: int = 0#
metal: float = 0.0#
class src.tf2_utils.backpack_tf.Enity(name: str = '', id: int = 0, color: str = '')#
name: str = ''#
id: int = 0#
color: str = ''#
class src.tf2_utils.backpack_tf.ItemDocument(appid: int, baseName: str, defindex: int, id: str, imageUrl: str, marketName: str, name: str, originalId: str, price: dict, quality: src.tf2_utils.backpack_tf.Enity, summary: str, slot: str, tradable: bool, craftable: bool)#
appid: int#
baseName: str#
defindex: int#
id: str#
imageUrl: str#
marketName: str#
name: str#
originalId: str#
price: dict#
quality: Enity#
summary: str#
slot: str#
tradable: bool#
craftable: bool#
class src.tf2_utils.backpack_tf.Listing(id: str, steamid: str, appid: int, currencies: src.tf2_utils.backpack_tf.Currencies, value: dict, details: str, listedAt: int, bumpedAt: int, intent: str, count: int, status: str, source: str, item: src.tf2_utils.backpack_tf.ItemDocument, user: dict, userAgent: dict = <factory>, tradeOffersPreferred: bool = None, buyoutOnly: bool = None)#
id: str#
steamid: str#
appid: int#
currencies: Currencies#
value: dict#
details: str#
listedAt: int#
bumpedAt: int#
intent: str#
count: int#
status: str#
source: str#
item: ItemDocument#
user: dict#
userAgent: dict#
tradeOffersPreferred: bool = None#
buyoutOnly: bool = None#
class src.tf2_utils.backpack_tf.BackpackTF(token: str, steam_id: str, api_key: str = '', user_agent='listed with <3')#
URL = 'https://api.backpack.tf/api'#
request(*args, **kwargs)#
get_listings(skip: int = 0, limit: int = 100) dict#
create_listing(sku: str, intent: str, currencies: dict, details: str, asset_id: int = 0) Listing#
create_listings(listings: list[dict]) list[Listing]#
delete_all_listings() dict#
delete_listing(listing_id: str) dict#
delete_listing_by_asset_id(asset_id: int) dict#
delete_listing_by_sku(sku: str) dict#
register_user_agent() dict#
get_user_agent_status() dict#
stop_user_agent() dict#