天择量化公共接口文档
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
701 B

  1. import json
  2. import requests
  3. symbol = 'btcusdt'
  4. symbol_other = symbol.replace("_", "").replace("-", "").lower()
  5. host_list = ["http://43.133.213.20:8001", "http://43.163.230.7:9008"]
  6. host = "http://43.163.230.7:9008"
  7. headers = {"Accept": "application/json", "Content-Type": "application/json"}
  8. url = "/platform/symbol/from_id/start_time/end_time"
  9. count = 0
  10. from_id = 5423056100
  11. start_time = None
  12. end_time = None
  13. platform = 'binance_swap_u'
  14. query_param = f"platform={platform}&symbol={symbol_other}&from_id={from_id}&start_time={start_time}&end_time={end_time}"
  15. response = requests.request(
  16. "GET", host_list[count % 2] + url + "?" + query_param, headers=headers, timeout=10
  17. )
  18. response.json()