Skip to content

Instantly share code, notes, and snippets.

@MtkN1
Last active June 28, 2022 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MtkN1/46011c0389cdb74bcca30cfc26568529 to your computer and use it in GitHub Desktop.
Save MtkN1/46011c0389cdb74bcca30cfc26568529 to your computer and use it in GitHub Desktop.
Bybit Futures Symbol Names
import http.client
import json
import urllib.request
resp: http.client.HTTPResponse
with urllib.request.urlopen('https://api.bybit.com/v2/public/symbols') as resp:
data = json.loads(resp.read().decode())
print(*filter(lambda x: all([x['name'] != x['alias'], x['status'] == 'Trading']), data['result']), sep='\n\n')
@MtkN1
Copy link
Author

MtkN1 commented May 3, 2021

表示結果の name を他のAPIパラメーター symbol に指定する

@MtkN1
Copy link
Author

MtkN1 commented May 3, 2021

ワンライナー

curl -sL https://gist.github.com/MtkN1/46011c0389cdb74bcca30cfc26568529/raw/5990f75ad631613056b8ed008c6f62c07884039a/bybit_futures_symbol_names.py | python3

@MtkN1
Copy link
Author

MtkN1 commented May 3, 2021

今現在の結果

{'name': 'BTCUSDU21', 'alias': 'BTCUSD0924', 'status': 'Trading', 'base_currency': 'BTC', 'quote_currency': 'USD', 'price_scale': 2, 'taker_fee': '0.00075', 'maker_fee': '-0.00025', 'leverage_filter': {'min_leverage': 1, 'max_leverage': 100, 'leverage_step': '0.01'}, 'price_filter': {'min_price': '0.5', 'max_price': '999999.5', 'tick_size': '0.5'}, 'lot_size_filter': {'max_trading_qty': 1000000, 'min_trading_qty': 1, 'qty_step': 1}}
{'name': 'BTCUSDM21', 'alias': 'BTCUSD0625', 'status': 'Trading', 'base_currency': 'BTC', 'quote_currency': 'USD', 'price_scale': 2, 'taker_fee': '0.00075', 'maker_fee': '-0.00025', 'leverage_filter': {'min_leverage': 1, 'max_leverage': 100, 'leverage_step': '0.01'}, 'price_filter': {'min_price': '0.5', 'max_price': '999999.5', 'tick_size': '0.5'}, 'lot_size_filter': {'max_trading_qty': 1000000, 'min_trading_qty': 1, 'qty_step': 1}}

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