Type/to search
0
Follow
1
Followers
vấn đề requests.get(url, params=params)
Help
Created 2023-04-28 09:06:19  
 3
 1176

#url = "https://fapi.binance.com/fapi/v1/klines"
#get có được dữ liệu hợp đồng k line
url = "https://fapi.binance.com/fapi/v3/klines"
#get dữ liệu k-line
params = {
"symbol": Symbol,
"interval": str(timeperiod) + "m",
"limit": 1000
} #ema_timeperiod_2 * 2
response = requests.get(url, params=params)
data = response.json()

Thực hiện v1 để lấy dữ liệu hợp đồng là không có vấn đề, thực hiện v3 để lấy dữ liệu mặt hàng là sai, cùng mã, thực hiện trong vscode là không có vấn đề, có thể lấy dữ liệu v3.
Traceback (most recent call last): File<string>", line 1249, in init_ctx File "<string>", line 367, in <module> File "<string>", line 345, in listen_agg_trade requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Tôi không thể làm được, cảm ơn.

Related Recommendations
Comment
All comments (3)

    明白了 多个f。。。。。。。。。。

    3 years ago

    是的梦总,我的意思是 用/api/v3/klines 就是url = "https://fapi.binance.com/fapi/v3/klines" 这个url 取现货数据的时候出错。我是两个get 一个取现货一个取期货

    3 years ago

    币安期货fapi里面都没有/fapi/v3/klines这个接口。
    现货里面才有v3/klines这个接口。

    3 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)