BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

I ca'nt execute sample on github. #407

Open JoshColeen opened 4 years ago

JoshColeen commented 4 years ago
import bitmex
client=bitmex.bitmex()
def hello():
    xbtusd = client.Quote.Quote_get(symbol='XBTUSD', count=1, reverse=True).result()
if __name__ == '__main__':
    hello()

I've tried to execute above code. But got following error.

C:\Python37-32\lib\site-packages\swagger_spec_validator\validator20.py:53: SwaggerValidationWarning: Found "$ref: #/definitions/UserPreferences" with siblings that will be overwritten. See https://stackoverflow.com/a/48114924 for more information. (path #/definitions/User/properties/preferences)
  ref_dict['$ref'], '/'.join(path),
Traceback (most recent call last):
  File "E:\python_work\BitmexBot\bot1.py", line 7, in <module>
    hello()
  File "E:\python_work\BitmexBot\bot1.py", line 5, in hello
    xbtusd = client.Quote.Quote_get(symbol='XBTUSD', count=1, reverse=True).result()
  File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 271, in result
    swagger_result = self._get_swagger_result(incoming_response)
  File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 124, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 303, in _get_swagger_result
    self.request_config.response_callbacks,
  File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 353, in unmarshal_response
    raise_on_expected(incoming_response)
  File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 422, in raise_on_expected
    swagger_result=http_response.swagger_result)
bravado.exception.HTTPForbidden: 403 Forbidden: <html>

<head><title>403 Forbidden</title></head>

<body bgcolor="white">

<center><h1>403 Forbidden</h1></center>

</body>

</html>
Str-Gen commented 4 years ago

Same issue, both on bitmex test environment and the real environment. Regardless of whether I create the api client with a valid apikey.

Kinzowa commented 4 years ago

import bitmex client=bitmex.bitmex() def hello(): xbtusd = client.Quote.Quote_get(symbol='XBTUSD', count=1, reverse=True).result() if name == 'main': hello()

I've tried to execute above code. But got following error.

C:\Python37-32\lib\site-packages\swagger_spec_validator\validator20.py:53: SwaggerValidationWarning: Found "$ref: #/definitions/UserPreferences" with siblings that will be overwritten. See https://stackoverflow.com/a/48114924 for more information. (path #/definitions/User/properties/preferences) ref_dict['$ref'], '/'.join(path), Traceback (most recent call last): File "E:\python_work\BitmexBot\bot1.py", line 7, in hello() File "E:\python_work\BitmexBot\bot1.py", line 5, in hello xbtusd = client.Quote.Quote_get(symbol='XBTUSD', count=1, reverse=True).result() File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 271, in result swagger_result = self._get_swagger_result(incoming_response) File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 124, in wrapper return func(self, *args, **kwargs) File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 303, in _get_swagger_result self.request_config.response_callbacks, File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 353, in unmarshal_response raise_on_expected(incoming_response) File "C:\Python37-32\lib\site-packages\bravado\http_future.py", line 422, in raise_on_expected swagger_result=http_response.swagger_result) bravado.exception.HTTPForbidden: 403 Forbidden:

403 Forbidden

403 Forbidden

Use code markdown, thank you.

STRML commented 4 years ago

Hi. The Quote endpoint is currently disabled at this time. We expect it to be back up within a month.

konradbachusz-zz commented 4 years ago

@STRML should Quote work now? I still get the same error as above