kucoin-api-docs icon indicating copy to clipboard operation
kucoin-api-docs copied to clipboard

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

Open mmt-wonsik opened this issue 4 years ago • 1 comments

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

mmt-wonsik avatar Nov 24 '21 13:11 mmt-wonsik

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

codewc avatar Nov 26 '21 10:11 codewc