Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
Last active October 31, 2020 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igotit-anything/528f6e844e79160d8d1a5ebff85488e3 to your computer and use it in GitHub Desktop.
Save igotit-anything/528f6e844e79160d8d1a5ebff85488e3 to your computer and use it in GitHub Desktop.
bybit 에서 발급받은 본인 api key 기록
bybit 에서 발급받은 본인 secrete key 기록.
https://api.bybit.com
wss://stream.bybit.com/realtime
wss://stream.bybit.com/realtime_public
wss://stream.bybit.com/realtime_private
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
기록방법. - 총 6줄. 파일명 : apikey_url_bybit.txt
줄1 : api key . bybit에서 발급받은 본인 api key
줄2 : secret key . bybit 에 발급받은 본인 secret key
줄3 : bybit REST 주소. USD, USDT 용. 실거래소 https://api.bybit.com , 데모주소 https://api-testnet.bybit.com
줄4 : bybit 웹소켓 주소.USD용. 실거래소 wss://stream.bybit.com/realtime , 데모주소 wss://stream-testnet.bybit.com/realtime
줄5 : bybit 웹소켓 주소 USDT용 public. 실거래소 wss://stream.bybit.com/realtime_public , 데모주소 wss://stream-testnet.bybit.com/realtime_public
줄6 : bybit 웹소켓 주소 USDT용 private. 실거래소 wss://stream.bybit.com/realtime_private , 데모주소 wss://stream-testnet.bybit.com/realtime_private
위의 내용을 기록한 apikey_url_bybit.txt 로 저장. 경로 파이썬 파일이 있는 동일 폴더.
##### 상기 파일 읽는 파이썬 코드.
with open('apikey_url_bybit.txt', encoding='utf8') as f:
count_line=0
for line in f:
count_line+=1
if count_line == 1: # bybit API key
api_key = line.rstrip('\n')
elif count_line == 2: # bybit secret key
api_secret = line.rstrip('\n')
elif count_line == 3: # bybit REST url for both Inverse Perpetual and USDT Perpetual,
url_rest_bybit = line.rstrip('\n')
elif count_line == 4: # bybit websocket url for Inverse Perpetual, BTCUSD , etc
url_ws_inverse_bybit = line.rstrip('\n')
elif count_line == 5: # bybit websocket public url for USDT Perpetual, BTCUSDT, etc
url_ws_usdt_public_bybit = line.rstrip('\n')
elif count_line == 6: # bybit websocket private url for USDT Perpetual, BTCUSDT, etc
url_ws_usdt_private_bybit = line.rstrip('\n')
break;
print('OK : read file apikey_url_bybit.txt')
@igotit-anything
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment