Market Cap: $2.3709T -0.45%
Volume(24h): $143.7989B -37.32%
Fear & Greed Index:

8 - Extreme Fear

  • Market Cap: $2.3709T -0.45%
  • Volume(24h): $143.7989B -37.32%
  • Fear & Greed Index:
  • Market Cap: $2.3709T -0.45%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

How to use the API on Kraken?

Set up your Kraken API key with proper permissions, securely store your secret, and use signed requests for private endpoints like balance checks.

Oct 29, 2025 at 05:55 am

Getting Started with Kraken API

1. Navigate to the official Kraken website and log into your account. If you don’t have an account, registration is required before accessing API features.

2. Once logged in, go to the “Security” section under your account settings. Here, you will find the option to generate API keys.

3. Click on “Add API Key” and choose the permissions your key will have. For basic trading operations, ensure both “Query Funds” and “Trade” permissions are enabled.

4. After selecting permissions, complete the two-factor authentication process to confirm the creation of the API key.

5. Save the generated key and corresponding private secret in a secure location. The private secret is only shown once and cannot be retrieved if lost.

Making Your First API Request

1. Install a tool or library that supports HTTPS requests, such as Python’s requests library or Postman for testing purposes.

2. Construct the endpoint URL based on the desired action. For example, to retrieve your account balance, use the /0/private/Balance endpoint.

3. Each private request requires specific headers: API-Key containing your public key and API-Sign which is a cryptographic signature generated using your private secret.

4. The API-Sign value is created by hashing a message composed of the URI path, a nonce, and post data using HMAC-SHA512 with your private key.

5. Send the request with proper headers and parameters. A successful response returns JSON-formatted data containing your balance or trade confirmation.

Understanding Public vs Private Endpoints

1. Public endpoints like /0/public/Ticker or /0/public/AssetPairs do not require authentication. These can be used to fetch market data, price information, and available trading pairs.

2. No API key is needed for public calls. Simply send a GET request to the appropriate URL with query parameters if necessary.

3. Private endpoints require authenticated requests and are used for actions involving user data, such as placing orders, checking ledgers, or withdrawing funds.

4. Authentication involves generating a signed message using your private key, ensuring that only authorized users can access sensitive operations.

5. Misuse of private endpoints without correct signatures results in authentication errors or rejected transactions.

Best Practices for Secure API Usage

1. Always restrict API key permissions to the minimum required for your application. Avoid enabling withdrawal rights unless absolutely necessary.

2. Use strong firewalls and encrypt storage locations where API keys are kept. Never expose keys in client-side code or public repositories.

3. Implement a unique nonce for each private request. The nonce ensures requests cannot be replayed and must be incrementing with each call.

4. Monitor your API usage through Kraken’s dashboard. Unusual activity could indicate unauthorized access.

5. Rotate API keys periodically and deactivate old keys to reduce exposure in case of compromise.

Frequently Asked Questions

What should I do if I lose my API private secret?Generate a new API key immediately since the private secret cannot be recovered. Disable the lost key to prevent potential misuse.

Can I use Kraken API to automate trading strategies?Yes, developers commonly use the Kraken API to build bots that execute trades based on market conditions, provided they manage rate limits and order accuracy.

Why am I getting a 'EAPI:Invalid key' error?This typically means the API-Key header is missing, malformed, or does not match any active key on your account. Double-check the key and header formatting.

Are there rate limits on Kraken API calls?Yes, Kraken enforces rate limits to maintain system stability. Public endpoints allow more frequent access, while private endpoints have stricter limits per minute.

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Related knowledge

See all articles

User not found or password invalid

Your input is correct