Open omniscientcorp opened 6 years ago
from bitex import Gemini
g = Gemini()
print(g.ticker('btcusd').json())
That seems to work after small modification in gemini.py :
# Import Built-Ins
import logging, json
# Import Third-Party
# Import Homebrew
from bitex.formatters.base import Formatter
# Init Logging Facilities
log = logging.getLogger(__name__)
class GmniFormatter(Formatter):
@staticmethod
def ticker(data, *args, **kwargs):
data = json.dumps(data)
return data
Originally was:
(data['bid'], data['ask'], None, None, None, None, data['last'],
data['volume'][args[0][:3].upper()], data['volume']['timestamp'])
Hi, I'm trying to get data from the public API, using bitex.interfaces
Gives me the following error:
return_api_response: HTTPError for url https://api.gemini.com/v1/pubticker/BTC-USD Traceback (most recent call last): File "/home/aismail/anaconda3/lib/python3.6/site-packages/bitex/utils.py", line 40, in wrapper r.raise_for_status() File "/home/aismail/anaconda3/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.gemini.com/v1/pubticker/BTC-USD Error while applying formatter! Traceback (most recent call last): File "/home/aismail/anaconda3/lib/python3.6/site-packages/bitex/utils.py", line 61, in wrapper r.formatted = formatter(data, *args, **kwargs) File "/home/aismail/anaconda3/lib/python3.6/site-packages/bitex/formatters/gemini.py", line 17, in ticker return (data['bid'], data['ask'], None, None, None, None, data['last'], KeyError: 'bid'