天择量化公共接口文档
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.

21 lines
492 B

  1. import requests
  2. def GetCoinInfo(coin, settle):
  3. url = "http://43.133.213.20:8001/api/v1/GetCoinInfo/"
  4. payload = {"coin": coin, "settle": settle}
  5. response = requests.post(url, json=payload, timeout=5)
  6. if response.status_code == 200:
  7. return response.json()
  8. else:
  9. print(f"Error: {response.status_code}, {response.json()}")
  10. return None
  11. # 示例参数
  12. coin = "btc"
  13. settle = "usdt"
  14. # 发送请求
  15. CoinInfo = GetCoinInfo(coin, settle)
  16. print(CoinInfo)