or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

account-management.mdearn-products.mdindex.mdlending.mdmargin-trading.mdmarket-data.mdspot-trading.mdwebsocket.md

market-data.mddocs/

0

# Market Data

1

2

Access to comprehensive KuCoin market information including trading symbols, price tickers, order books, trade history, candlestick data, and currency details. All market data endpoints are public and do not require authentication.

3

4

## Capabilities

5

6

### Symbol Information

7

8

Retrieve information about available trading pairs and markets.

9

10

```python { .api }

11

def get_symbol_list(**kwargs):

12

"""

13

Get list of trading symbols.

14

15

Args:

16

market (str, optional): Filter by market (e.g., 'BTC', 'USDT')

17

18

Returns:

19

list: List of symbol objects with trading information

20

"""

21

22

def get_symbol_list_v2(**kwargs):

23

"""

24

Get enhanced list of trading symbols (v2).

25

26

Args:

27

market (str, optional): Filter by market

28

29

Returns:

30

list: Enhanced symbol information with additional metadata

31

"""

32

33

def get_symbol_detail(symbol: str):

34

"""

35

Get detailed information for a specific trading symbol.

36

37

Args:

38

symbol (str): Trading symbol (e.g., 'BTC-USDT')

39

40

Returns:

41

dict: Detailed symbol configuration and limits

42

"""

43

44

def get_market_list():

45

"""

46

Get list of available markets.

47

48

Returns:

49

list: Available market names

50

"""

51

```

52

53

### Price Tickers

54

55

Current and 24-hour price information for trading pairs.

56

57

```python { .api }

58

def get_ticker(symbol: str):

59

"""

60

Get ticker information for a specific symbol.

61

62

Args:

63

symbol (str): Trading symbol (e.g., 'BTC-USDT')

64

65

Returns:

66

dict: Current price, best bid/ask, and timestamp

67

"""

68

69

def get_all_tickers():

70

"""

71

Get ticker information for all symbols.

72

73

Returns:

74

dict: Timestamp and list of all tickers

75

"""

76

77

def get_24h_stats(symbol: str):

78

"""

79

Get 24-hour trading statistics for a symbol.

80

81

Args:

82

symbol (str): Trading symbol

83

84

Returns:

85

dict: 24h high/low, volume, change, and average price

86

"""

87

```

88

89

### Order Book Data

90

91

Market depth and order book information.

92

93

```python { .api }

94

def get_part_order(pieces: int, symbol: str):

95

"""

96

Get partial order book with specified depth.

97

98

Args:

99

pieces (int): Number of order book levels (20, 100)

100

symbol (str): Trading symbol

101

102

Returns:

103

dict: Partial order book with bids and asks

104

"""

105

106

def get_aggregated_orderv3(symbol: str):

107

"""

108

Get full aggregated order book (v3).

109

110

Args:

111

symbol (str): Trading symbol

112

113

Returns:

114

dict: Complete aggregated order book

115

"""

116

117

def get_atomic_orderv3(symbol: str):

118

"""

119

Get full atomic order book with order IDs (v3).

120

121

Args:

122

symbol (str): Trading symbol

123

124

Returns:

125

dict: Complete atomic order book with individual orders

126

"""

127

128

def get_atomic_order(symbol: str):

129

"""

130

Get full atomic order book with order IDs (v1).

131

132

Args:

133

symbol (str): Trading symbol

134

135

Returns:

136

dict: Complete atomic order book with individual orders

137

"""

138

```

139

140

### Trade History

141

142

Historical trade data for symbols.

143

144

```python { .api }

145

def get_trade_histories(symbol: str):

146

"""

147

Get recent trade history for a symbol.

148

149

Args:

150

symbol (str): Trading symbol

151

152

Returns:

153

list: Recent trades with price, size, side, and timestamp

154

"""

155

```

156

157

### Candlestick Data

158

159

OHLCV candlestick data for technical analysis.

160

161

```python { .api }

162

def get_kline(symbol: str, kline_type: str, **kwargs):

163

"""

164

Get candlestick data for a symbol.

165

166

Args:

167

symbol (str): Trading symbol

168

kline_type (str): Candle interval ('1min', '3min', '5min', '15min', '30min', '1hour', '2hour', '4hour', '6hour', '8hour', '12hour', '1day', '1week')

169

startAt (int, optional): Start time timestamp

170

endAt (int, optional): End time timestamp

171

currentPage (int, optional): Page number

172

pageSize (int, optional): Page size

173

174

Returns:

175

list: OHLCV candlestick data

176

"""

177

```

178

179

### Currency Information

180

181

Information about supported cryptocurrencies.

182

183

```python { .api }

184

def get_currencies():

185

"""

186

Get list of supported currencies.

187

188

Returns:

189

list: Currency information with precision and limits

190

"""

191

192

def get_currency_detail_v2(currency: str, chain: str = None):

193

"""

194

Get detailed currency information (v2).

195

196

Args:

197

currency (str): Currency code (e.g., 'BTC')

198

chain (str, optional): Blockchain network

199

200

Returns:

201

dict: Currency details with chain information

202

"""

203

204

def get_currency_detail_v3(currency: str, chain: str = None):

205

"""

206

Get detailed currency information (v3).

207

208

Args:

209

currency (str): Currency code

210

chain (str, optional): Blockchain network

211

212

Returns:

213

dict: Enhanced currency details

214

"""

215

```

216

217

### Fiat Pricing

218

219

Fiat currency conversion rates.

220

221

```python { .api }

222

def get_fiat_price(**kwargs):

223

"""

224

Get fiat conversion prices for cryptocurrencies.

225

226

Args:

227

base (str, optional): Base fiat currency

228

currencies (str, optional): Comma-separated cryptocurrency codes

229

230

Returns:

231

dict: Fiat prices for specified cryptocurrencies

232

"""

233

```

234

235

### Server Information

236

237

KuCoin server status and timing information.

238

239

```python { .api }

240

def get_server_timestamp():

241

"""

242

Get current server timestamp.

243

244

Returns:

245

int: Current server timestamp in milliseconds

246

"""

247

248

def get_server_status():

249

"""

250

Get server operational status.

251

252

Returns:

253

dict: Server status ('open', 'close', 'cancelonly') with message

254

"""

255

```

256

257

## Usage Examples

258

259

### Basic Market Data Query

260

261

```python

262

from kucoin.client import Market

263

264

# Initialize market client (no auth required)

265

market = Market()

266

267

# Get all available symbols

268

symbols = market.get_symbol_list()

269

print(f"Found {len(symbols)} trading pairs")

270

271

# Get current ticker for BTC-USDT

272

ticker = market.get_ticker('BTC-USDT')

273

print(f"BTC-USDT Price: {ticker['price']}")

274

275

# Get 24h statistics

276

stats = market.get_24h_stats('BTC-USDT')

277

print(f"24h Volume: {stats['vol']}")

278

print(f"24h Change: {stats['changeRate']}")

279

```

280

281

### Order Book Analysis

282

283

```python

284

# Get partial order book

285

orderbook = market.get_part_order(20, 'BTC-USDT')

286

print(f"Best Bid: {orderbook['bids'][0]}")

287

print(f"Best Ask: {orderbook['asks'][0]}")

288

289

# Get recent trades

290

trades = market.get_trade_histories('BTC-USDT')

291

for trade in trades[:5]:

292

print(f"Trade: {trade['price']} @ {trade['size']} ({trade['side']})")

293

```

294

295

### Historical Data

296

297

```python

298

# Get 1-hour candlestick data for the last 24 hours

299

import time

300

end_time = int(time.time())

301

start_time = end_time - (24 * 60 * 60) # 24 hours ago

302

303

candles = market.get_kline('BTC-USDT', '1hour', startAt=start_time, endAt=end_time)

304

for candle in candles:

305

timestamp, open_price, close_price, high, low, volume, turnover = candle

306

print(f"Time: {timestamp}, Open: {open_price}, Close: {close_price}, Volume: {volume}")

307

```

308

309

## Types

310

311

```python { .api }

312

SymbolInfo = dict

313

# {

314

# "symbol": str, # Trading pair symbol

315

# "name": str, # Display name

316

# "baseCurrency": str, # Base currency

317

# "quoteCurrency": str, # Quote currency

318

# "baseMinSize": str, # Minimum base amount

319

# "quoteMinSize": str, # Minimum quote amount

320

# "baseMaxSize": str, # Maximum base amount

321

# "quoteMaxSize": str, # Maximum quote amount

322

# "baseIncrement": str, # Base precision

323

# "quoteIncrement": str, # Quote precision

324

# "priceIncrement": str, # Price precision

325

# "enableTrading": bool, # Trading enabled

326

# "isMarginEnabled": bool, # Margin trading enabled

327

# "priceLimitRate": str # Price limit rate

328

# }

329

330

TickerInfo = dict

331

# {

332

# "sequence": str, # Sequence number

333

# "bestAsk": str, # Best ask price

334

# "size": str, # Size

335

# "price": str, # Last price

336

# "bestBidSize": str, # Best bid size

337

# "bestBid": str, # Best bid price

338

# "bestAskSize": str, # Best ask size

339

# "time": int # Timestamp

340

# }

341

342

OrderBookLevel = list # [price: str, size: str]

343

344

OrderBook = dict

345

# {

346

# "sequence": str, # Sequence number

347

# "time": int, # Timestamp

348

# "bids": list[OrderBookLevel], # Bid orders

349

# "asks": list[OrderBookLevel] # Ask orders

350

# }

351

352

TradeInfo = dict

353

# {

354

# "sequence": str, # Sequence number

355

# "price": str, # Trade price

356

# "size": str, # Trade size

357

# "side": str, # Trade side ('buy' or 'sell')

358

# "time": int # Trade timestamp

359

# }

360

361

CandleData = list # [timestamp: str, open: str, close: str, high: str, low: str, volume: str, turnover: str]

362

```