From a3f8a951841b4f51cdd09999e5aa14839179093e Mon Sep 17 00:00:00 2001 From: tzquant_zq Date: Wed, 11 Sep 2024 17:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'GetSortSymbols.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GetSortSymbols.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 GetSortSymbols.py diff --git a/GetSortSymbols.py b/GetSortSymbols.py new file mode 100644 index 0000000..9d27d10 --- /dev/null +++ b/GetSortSymbols.py @@ -0,0 +1,22 @@ +import requests + +def GetCoinInfo(coin, settle): + url = "http://43.133.213.20:8001/api/v1/get_sort_symbols/" + payload = {"coin": coin, "settle": settle} + + response = requests.post(url, json=payload, timeout=5) + + if response.status_code == 200: + return response.json() + else: + print(f"Error: {response.status_code}, {response.json()}") + return None + + +# 示例参数 +coin = "BTC" +settle = "USDT" + +# 发送请求 +CoinInfo = GetCoinInfo(coin, settle) +print(CoinInfo) \ No newline at end of file