Kucoin / kucoin-api-docs

KuCoin API Docs
Other
273 stars 146 forks source link

I can't get more than 50 items with Trade API #330

Open mmt-wonsik opened 2 years ago

mmt-wonsik commented 2 years ago

Hello,

Actually, my order list is more than 50. (total 104) But I can't get my data more than 50 by using API. I think Trade REST API doesn't work with pagination params.

client = Trade(key=KEY, secret=SECRET, passphrase=PW, is_sandbox=False, url='')
orders = client.get_order_list(currentPage=1, totalNum=100)
len(orders['items'])

What I got after the codes is just 50

codewc commented 2 years ago

Hello,

Actually, my order list is more than 50. (total 104) But I can't get my data more than 50 by using API. I think Trade REST API doesn't work with pagination params.

client = Trade(key=KEY, secret=SECRET, passphrase=PW, is_sandbox=False, url='')
orders = client.get_order_list(currentPage=1, totalNum=100)
len(orders['items'])

What I got after the codes is just 50

You need to use page turning parameters

Pagination Pagination allows for fetching results with the current page and is well suited for real time data. Endpoints like /api/v1/deposits, /api/v1/orders, /api/v1/fills, will return the latest items by default (50 pages in total). To retrieve more results, users should specify the currentPage number in the subsequent requests to turn the page based on the data previously returned.

PARAMETERS Parameter Default Description currentPage 1 Current request page. pageSize 50 Number of results per request. Minimum is 10, maximum is 500.

refer to: https://docs.kucoin.com/#pagination