Giter Club home page Giter Club logo

Comments (16)

STRML avatar STRML commented on June 30, 2024 1

By default, this connects to the Testnet exchange. Are you sure you created a Testnet key?

from sample-market-maker.

bendelo avatar bendelo commented on June 30, 2024

@STRML : yes I did. but does theAPI_KEYsetting is the api key given nameβ€―?

No, you need to put in the ID.

from sample-market-maker.

primary0 avatar primary0 commented on June 30, 2024

@bendelo @STRML I'm getting the same error even with a valid ID (and key) from Testnet.

from sample-market-maker.

jtfarks avatar jtfarks commented on June 30, 2024

did anyone work this one out?

from sample-market-maker.

jtfarks avatar jtfarks commented on June 30, 2024

For anyone else running into this problem, I was able to run it properly outside a virtualenv.

from sample-market-maker.

tomasfrtala avatar tomasfrtala commented on June 30, 2024

I had the same problem. Be sure you copy the ID and Secret right (the input bar gets all auto-selected itself when you click inside it. No need to use CTRL+A! After that you need to use only CTRL+C and CTRL+V). Hope it helps. Works also in virtual environment and Python 3.

from sample-market-maker.

ryanfox avatar ryanfox commented on June 30, 2024

That is the error message returned when an invalid API key is entered in settings.py.

It should work in both Python3 and in a virtual environment. Absent any other information, this looks like an incorrect API key. Closing.

from sample-market-maker.

salsburg avatar salsburg commented on June 30, 2024

I have the same issue, running Python 3.6 on Windows 10.

2018-04-11 11:40:29,709 - INFO - ws_thread - Connecting to wss://testnet.bitmex.com/realtime?subscribe=quote:XBTUSD,trade:XBTUSD,instrument,order:XBTUSD,execution:XBTUSD,margin,position
2018-04-11 11:40:29,709 - INFO - ws_thread - Authenticating with API Key.
2018-04-11 11:40:29,710 - INFO - ws_thread - Started thread
2018-04-11 11:40:30,436 - ERROR - ws_thread - Handshake status 400 Bad Request
2018-04-11 11:40:30,711 - ERROR - ws_thread - Couldn't connect to WS! Exiting.

I know for a fact that my test bitmex API/Secret in the settings.py file are correct. This pair works in other API targeting the test environment in Bitmex. Also, when I replace the API key with something else, I get a different error, so I am certain the API Key/Secret is not the issue here:
2018-04-11 11:46:34,167 - ERROR - ws_thread - API Key incorrect, please check and restart.

Please help.

from sample-market-maker.

ryanfox avatar ryanfox commented on June 30, 2024

That error message corresponds to a 401 Not Authorized response - meaning the credentials were recognized, but not valid. If you create a new API key and use that, do you see the same error?

from sample-market-maker.

salsburg avatar salsburg commented on June 30, 2024

wow - creating a new api key worked perfectly. I guess the nonce was too small compared to a prior larger nonce that was sent. Thanks for your help.

(ccxt/ccxt#147) "Basically, Bitmex is telling you, that your keys have already been used with a bigger nonce previously. So you need an even bigger one. By default the nonce is 32 bit (1503497932) and the last nonce you used with bitmex was 1502567277932. To fix it, use a fresh new keypair, or if you want to continue with this keypair, override the nonce for milliseconds or microseconds, as in the Manual."

from sample-market-maker.

salsburg avatar salsburg commented on June 30, 2024

Everything worked just fine in testnet.bitmex.com, but I went to fetch a brand new fresh api key/secret pair for the live environment, using the same setting.py, but changing the target to BASE_URL = "https://www.bitmex.com/api/v1/" and using the correct new api key/secret, and I'm back to the "ERROR - ws_thread - Handshake status 401 Unauthorized" issue again for test. I switch back to testnet, and it works just fine. Any thoughts as to why production would not work? Since I have a fresh api key, I don't think it's a nonce issue again, like last time above where the fresh api key solved the 400 and 401 errors.

from sample-market-maker.

salsburg avatar salsburg commented on June 30, 2024

I made an error in my live environment settings file (commenting/uncommenting); and now after fixing, everything works. So this solution of a new api key worked for both test and live environments. Problems solved.

from sample-market-maker.

groupline avatar groupline commented on June 30, 2024

I am receiving a 401 error on every key i try. I have created over 10 api keys and they all return 401 error on the test net. Any one comming across the same issue? Any help would be appreciated. thanks

from sample-market-maker.

ryanfox avatar ryanfox commented on June 30, 2024

Make sure the API key was created with sufficient permissions: https://testnet.bitmex.com/app/apiKeysUsage#API-Key-Permissions

from sample-market-maker.

erny0024 avatar erny0024 commented on June 30, 2024

Getting unautorized as well, what's the key pair for ID and Secret in the POST request? (I'm using matlab)
apiKey? ID? api-key? Can't find it anywhere

from sample-market-maker.

bendelo avatar bendelo commented on June 30, 2024

@erny0024 read the documentation:
https://testnet.bitmex.com/app/apiKeysUsage#Authenticating-with-an-API-Key

from sample-market-maker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.