#kraken #exchange #api #cryptocurrency #rust


🐙 Minimal, elegant, fast, async Kraken exchange REST API client | Written in Rust

16 releases

0.2.5 Feb 24, 2021
0.2.4 Feb 23, 2021
0.1.9 Feb 21, 2021

#25 in HTTP client

Download history 31/week @ 2021-02-13 203/week @ 2021-02-20 41/week @ 2021-02-27

68 downloads per month
Used in 2 crates (via squalo)

MIT license

202 lines


🐙 Minimal, elegant, fast, async Kraken exchange REST API client | Written in Rust


polipo library aims to interface your software with the Kraken exchange REST API in no time.


The Kraken exchange allows REST API interaction with both public and private data.

Only for the private one, you need to issue an API-Key and an API-Secret to the polipo library, in order to generate authentication strings for signed requests.

If you are not familiar with, please have a look at API basics documentation for a general overview, or at Generate API keys document.


Add this to your Cargo.toml:

polipo = {version = 0.2.5}

and then add this to your code:

use polipo;



Description: prints crate information (name, description, version, author and repository).

polipo::set_kraken_api_credentials(api_key: String, api_secret: String);

Description: sets Kraken API credentials for private data access.


  • api_key: String
  • api_secret: String
polipo::get_kraken_api_response(method: String, url_encoded_body: String).await;

Description: performs public or private requests, according to issued method and url_encoded_body data.


  • method: String (eg: "public" or "private")
  • url_encoded_body: String (eg: "pair=ethusd&since=1574067140000000000")

Output: any response is in stringified JSON format (parse accordingly with the outcome shape).


The example below shows how easy is to implement polipo from zero knowledge.

use polipo;

async fn query(method: &str, url_encoded_body: &str) -> String {
    polipo::get_kraken_api_response(method.to_string(), url_encoded_body.to_string()).await

async fn main() {
    // printing crate information

    // performing some queries on public data
    println!("public/Assets: {}", query("Assets", "").await);
    println!("public/Ticker: {}", query("Ticker", "pair=xdgeur").await);

    // issuing credentials enables private data requests

    // performing some queries on private data
    println!("private/Balance: {}", query("Balance", "").await);
    println!("private/TradeBalance: {}", query("TradeBalance","asset=ada").await);
    println!("private/Trades: {}", query("Trades", "pair=ethusd&since=1574067140000000000").await);


This software comes without any kind of warranties.

I will not be liable for any damages related to the use or the misuse of this software.

You are the sole responsible.


~185K SLoC