How to install Kraken's REST API command line client

The Kraken API command line client allows full access to the Kraken API via the command line, hence no programming knowledge or API experience is required.

All API features are accessible including:

  • public market data methods,
  • private account management methods,
  • trading methods, and
  • private funding methods.

The command line client can be used as a standalone API client, or can be called from other programs (such as other interpreted languages like Bash scripts, or compiled languages like C). 

Installation

1. Install Python 2 (if necessary).

  • MacOS and Linux probably already have Python 2.
  • Windows probably does not, but can be installed from https://www.python.org/.


2. Save the krakenapi.py file to your computer in the folder (directory) of your choosing.

  • For example: Macintosh HD > Users > satoshi > KrakenAPI


3. Open a command prompt (such as Mac OS's Terminal), and navigate to the folder (directory) chosen in the previous step.

You can use the "cd" command (change directory) to navigate. For example:

cd /Users/satoshi/KrakenAPI


4. Make krakenapi.py executable.

You can use the "chmod 755" command (change mode).

chmod 755 krakenapi.py


5. Optional: add your API keys to the same folder where you are keeping the krakenapi.py file.

Paste and save your API Key to a file called "API_Public_Key".

Paste and save your API Private Key to a file called "API_Private_Key".

See: How to generate an API key pair?

This is only needed if you plan to use any private API methods to access your Kraken account (such as balance inquiries, placing/cancelling orders, account history exports, etc).