From d95931d699cac504d4ea1d791359dd3f7e739b3d Mon Sep 17 00:00:00 2001 From: tzquant_zq Date: Sun, 29 Sep 2024 17:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'get=5Ftrades.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_trades.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 get_trades.py diff --git a/get_trades.py b/get_trades.py new file mode 100644 index 0000000..f972f21 --- /dev/null +++ b/get_trades.py @@ -0,0 +1,19 @@ +import json +import requests +symbol = 'btcusdt' +symbol_other = symbol.replace("_", "").replace("-", "").lower() +host_list = ["http://43.133.213.20:8001", "http://43.163.230.7:9008"] +host = "http://43.163.230.7:9008" +headers = {"Accept": "application/json", "Content-Type": "application/json"} +url = "/platform/symbol/from_id/start_time/end_time" +count = 0 +from_id = 5423056100 +start_time = None +end_time = None +platform = 'binance_swap_u' +query_param = f"platform={platform}&symbol={symbol_other}&from_id={from_id}&start_time={start_time}&end_time={end_time}" + +response = requests.request( + "GET", host_list[count % 2] + url + "?" + query_param, headers=headers, timeout=10 + ) +response.json() \ No newline at end of file