I want take all symbols for future in kucoin and then I want to get klines for all symbol I write some code but I cant get all symbol and also I cant get klines
get symbols:
import requests
import pandas as pd
url = " https://api-futures.kucoin.com/api/v1/contracts/active"
payload={}
files={}
headers = {}
margin = requests.request("GET", url, headers=headers, data=payload, files=files)
margin=margin.json()
margin=margin['data']
margin=pd.DataFrame(margin)
pd.set_option('display.max_row', margin.shape[0]+1)
it cant give some symbol in future for exmple btcusdt.
get klines:
import pandas as pd
import requests
url = "https://api-futures.kucoin.com/api/v1/kline/query?symbol=.KXBT&granularity=480&from=1535302400000"
payload={}
files={}
headers ={}
df = requests.request("GET", url, headers=headers, data=payload, files=files)
df=df.json()
df=df['data']
df=pd.DataFrame(df)
df[0] = pd.to_datetime(df[0], unit='ms')
df['date'] = df[0].dt.strftime("%d/%m/%Y")
df['time-utc'] = df[0].dt.strftime("%H:%M:%S")
df
I never see such symbol (KXBT) also when I want place another symbols like BTCUSDT and another symbols I cant take any data I read doc but I cant take any thing