Kraken REST API
api.kraken.com · Finance
Kraken cryptocurrency exchange API — real-time market data (ticker, order book, trades, OHLC), account management, and trading. Public market data requires no API key.
Authentication
Sample Requests
Get current BTC/USD ticker data.
Hover any highlighted part to learn what it does
curl -X GET "https://api.kraken.com/0/public/Ticker?pair=XBTUSD"
import requests
params = {
"pair": "XBTUSD"
}
response = requests.get(
"https://api.kraken.com/0/public/Ticker",
params=params,
)
print(response.json())const url = new URL('https://api.kraken.com/0/public/Ticker');
url.searchParams.set('pair', 'XBTUSD');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.kraken.com/0/public/Ticker")
q := baseURL.Query()
q.Set("pair", "XBTUSD")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.kraken.com/0/public/Ticker")
uri.query = URI.encode_www_form({
"pair" => "XBTUSD"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.kraken.com/0/public/Ticker?" . http_build_query([
"pair" => "XBTUSD"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get hourly OHLC candles for ETH/USD.
Hover any highlighted part to learn what it does
curl -X GET "https://api.kraken.com/0/public/OHLC?pair=ETHUSD&interval=60"
import requests
params = {
"pair": "ETHUSD",
"interval": "60"
}
response = requests.get(
"https://api.kraken.com/0/public/OHLC",
params=params,
)
print(response.json())const url = new URL('https://api.kraken.com/0/public/OHLC');
url.searchParams.set('pair', 'ETHUSD');
url.searchParams.set('interval', '60');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.kraken.com/0/public/OHLC")
q := baseURL.Query()
q.Set("pair", "ETHUSD")
q.Set("interval", "60")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.kraken.com/0/public/OHLC")
uri.query = URI.encode_www_form({
"pair" => "ETHUSD",
"interval" => "60"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.kraken.com/0/public/OHLC?" . http_build_query([
"pair" => "ETHUSD",
"interval" => "60"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No key for public endpoints
- Try GET https://api.kraken.com/0/public/Ticker?pair=XBTUSD
- Get all pairs: GET /0/public/AssetPairs
- For trading/account endpoints create API keys at kraken.com/u/security/api
What can you build with Kraken REST API?
Kraken REST API is a Finance API. Developers commonly use finance APIs for:
- processing payments and handling transactions
- building subscription and billing systems
- automating invoicing and financial reporting
- fraud detection and risk scoring
- connecting to banking and accounting software
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Kraken REST API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide