Answer the question
In order to leave comments, you need to log in
Why don't all items have a Steam warrant?
I place orders for items on Steam using this API: https://github.com/bukson/steampy#market-methods
I specify the api key of the account, login, password and the path to maFile on the computer.
When I specify an item from the Counter-Strike: Global Ofensive game (for example, a glove case item), then an order for this one is placed. But if I create an order for a Steam card, then an error occurs.
The code:
from steampy.client import SteamClient
from steampy.models import Currency
from steampy.utils import GameOptions
steam_client = SteamClient('4301...A') # API_KEY
# USERNAME, PASSWORD, PATH_TO_STEAMGUARD_FILE
steam_client.login('xi...2', 'z...R2',
r'C:\Users\me\Desktop\steam desktop\SDA-1.0.10\maFiles\76561198877671188.maFile')
dict_orders_items = {}
item_name_1 = "Glove Case"
item_name_2 = "Urki"
# название предмета, цена в копейках, кол-во ордеров, тип игры (CS), валюта (рубли)
response = steam_client.market.create_buy_order(item_name_1, "100", 1, GameOptions.CS, Currency.RUB)
dict_orders_items[item_name_1] = response['buy_orderid']
print(dict_orders_items)
response = steam_client.market.create_buy_order(item_name_2, "100", 1, GameOptions.STEAM, Currency.RUB)
dict_orders_items[item_name_2] = response['buy_orderid']
print(dict_orders_items)
Traceback (most recent call last):
File "C:\Users\me\PycharmProjects\steam api\question.py", line 20, in <module>
response = steam_client.market.create_buy_order(item_name_2, "100", 1, GameOptions.STEAM, Currency.RUB)
File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\steampy\market.py", line 18, in func_wrapper
return func(self, *args, **kwargs)
File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\steampy\market.py", line 126, in create_buy_order
raise ApiException("There was a problem creating the order. Are you using the right currency? success: %s"
steampy.exceptions.ApiException: There was a problem creating the order. Are you using the right currency? success: 42
@login_required
def create_buy_order(self, market_name: str, price_single_item: str, quantity: int, game: GameOptions,
currency: Currency = Currency.USD) -> dict:
data = {
"sessionid": self._session_id,
"currency": currency.value,
"appid": game.app_id,
"market_hash_name": market_name,
"price_total": str(Decimal(price_single_item) * Decimal(quantity)),
"quantity": quantity
}
headers = {'Referer': "%s/market/listings/%s/%s" % (SteamUrl.COMMUNITY_URL, game.app_id, market_name)}
response = self._session.post(SteamUrl.COMMUNITY_URL + "/market/createbuyorder/", data,
headers=headers).json()
if response.get("success") != 1:
raise ApiException("There was a problem creating the order. Are you using the right currency? success: %s"
% response.get("success"))
return response
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question