python-bittrex: API 2.0 trade_buy or trade_sell gives an error from bittrex

Hi guy!

Maybe problem not in this lib (or even I am sure it works properly) but maybe you face the same issue.

When I am sending request to tradesell or tradebuy endpoints using this lib:

buy_limit(market=USDT-ZEC, quantity=0.01, rate=216)

I get error message from bittrex:

{u'message': u'There was a problem processing your request. If this problem persists, please email support@bittrex.com with this error id - d70a2af0-1281-4320-b3d9-f2070f5e79de', u'result': None, u'success': False}

Maybe somebody could confirm that this API does not work from their side or it works? Thanks Sergii

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 2
  • Comments: 52

Most upvoted comments

@toddis , which language are you using? I’m using PHP bro… To me is just:

$apikey = ‘YOUR_API_KEY’; $apisecret = ‘YOUR_API_SECRET’; $uri = ‘https://bittrex.com/api/v2.0/key/market/TradeBuy?marketName=BTC-‘.$mkt_name.’&orderType=LIMIT&quantity=‘.$quantity_value.’&rate=‘.$rate_value.’&timeInEffect=IMMEDIATE_OR_CANCEL&conditionType=NONE&target=0&apikey=’.$apikey; $nonce=time(); $newuri= $uri.‘&nonce=’.$nonce;
$sign=hash_hmac(‘sha512’,$newuri,$apisecret);
$ch = curl_init($newuri); curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘apisign:’.$sign)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $execResult = curl_exec($ch);
$obj = json_decode($execResult);

Good luck, all the response stuff will be inside the object and the buy action will be already done. Anything else just ask, If I could answer, I’ll.

Note: as you asked, the API Secret wont go inside the url - who goes its the API Key -, but in the hash_hmac.

Edit: Hahahah just now I saw that is a python-bittrex issue, sorry. But this is how I use.

“The mind that opens to a new idea never returns to its original size.” — Albert Einstein

If you inspect the request when you do a conditional sell on bittrex. it hits this endpoint https://www.bittrex.com/api/v2.0/auth/market/TradeSell

however this is a post request and takes form data. The form arguments are below

MarketName:BTC-ADA
OrderType:LIMIT
Quantity:83.32568866
Rate:0.00005000
TimeInEffect:GOOD_TIL_CANCELLED
ConditionType:GREATER_THAN
Target:0.00005
__RequestVerificationToken:6WTA2RhHrDnWwGi8h51qc5pnkB3cmS-m8zqglsbmMzqx6U0IsEtOUTL4Jp_6u8OHXenEG7kmkmkmk

the request verification token is generated from clicking the confirm button.

They must have changed the endpoints.

it’s a huge shame they don’t have documentation on their v2.0 API at all anywhere because the trade sell endpoint is extremely important

Guys you do not need to have MARKET order available I think - in UI if I create order with higher value, it will buy it from the nearest offer from order book. So this is kind of market order.

No problem, glad its working!

@koppentc As we know, the 2.0 API’s are in BETA version, some functions appears to doesnt work properly… Seems that the function “FILL_OR_KILL” is unavailable yet. You should try the “IMMEDIATE_OR_CANCEL” instead, its 100% functional.

We are stuck with an undocumented and constantly changing API right now for 2.0.