API Connector Documentation
Import KuCoin Data to Google Sheets
In this guide, we’ll walk through how to pull data from the KuCoin API directly into Google Sheets, using the API Connector add-on for Sheets.
For this guide, we'll be using their open market endpoints so we don't need any API keys or other authorization. Let's jump right in!
Contents
- Before You Begin
- Part 1: Pull Data from KuCoin to Sheets
- Part 2: Create a Custom Request
- Part 3: Get Private KuCoin Account Data
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Pull Data from KuCoin to Sheets
The easiest way to get started with the Kucoin API is through API Connector’s built-in integration.
- In Sheets, open API Connector and create a new request (Extensions > API Connector > Open > Create request)
- Select Kucoin from the drop-down list of applications
- Select an endpoint. These endpoints are all open so you don’t need an API key. For this example we’ll choose the
/market/allTickers
endpoint. - Choose a destination sheet, name your request, and hit Run.
Part 2: Create a Custom Request
Alternatively, you can run a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the API documentation. Here is an example setup:
- Application:
Custom
- Request method:
GET
- Request URL:
https://api.kucoin.com/api/v1/market/allTickers
To easily convert your preset request to a custom request, click Output Options > More Options > Add Request URL before you run your request. This will print your request URL into your sheet so you can copy and paste it.
Part 3: Get Private KuCoin Account Data
The above endpoints deal with public market data from the KuCoin API.
If you are instead a KuCoin customer looking to get API data from your own account, they require a more complex authentication process that includes generating a “signature”.
To access your private account data, please copy this sheet and follow the instructions within.
Part 4: Handle Pagination
Note that the Kucoin API limits the number of records returned in each request. By default, only 100 records will be returned unless you use the currentPage
parameter as shown in their documentation.
With API Connector, you can set up pagination handling to cycle through pages automatically, like this:
- Pagination: page parameter
- Page parameter: currentPage
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://docs.kucoin.com/#market-data
Is it possible to retrieve private data from Kucoin using this?
Such as the balances like with Binance? (https://mixedanalytics.com/knowledge-base/import-binance-data-to-google-sheets/#num4)
Kucoin requires that you apply a "signature" as shown here. It looks pretty similar to what Binance requires, so the Binance sheet probably just requires some minor modification to work with KuCoin, but I haven't tried it myself so can't say for sure.
I am trying, but can't get it to work..
Would you be able to help me out?
I can share what I have currently.
I already fixed it and it seems to work. Let me know if you would like to have it as well, so you could add it to your website.
Hey Sander, thanks, I'd love to see your sheet or learn more about how you modified the Binance sheet. (I don't have my own Kucoin account, so I couldn't modify and test it myself). If it works, I'll update the article to include instructions.
What did you do to fix it? I'd like to see how you set it up if you don't mind.
Hey Synt, Sander kindly shared his modified sheet with us, I've added it to the article here. Please check if that works for you.
Thanks! I'll check it out!
how to import all historical trades from Kucoin to Google Sheets?
I was able to get only last trades using your template from Part 3
Hey Ollo, check here for info on getting historical data: https://docs.kucoin.com/#histories