Poolnex API

API reference

How to sign a call, what each kind of key may do, the limits and errors, and every endpoint with its parameters.

Base addresshttps://poolnex.com/api/v2

Overview

A REST API over HTTPS. Send parameters as a query string on GET and as JSON on POST; every answer is JSON. Amounts are strings, to keep every digit.

/api/v2/public
Market data. No key.
/api/v2/account
Your account. Any key.
/api/v2/market
Your orders and trades. Reading: any key. Placing and cancelling: a Trade key.

Lists take page (from 1) and limit (how many per page).

Signing a call

Every call to /account and /market carries three headers. The signature proves you hold the secret without sending it.

X-Auth-Apikey
Your key ID, as shown in Profile, API keys.
X-Auth-Nonce
The time in milliseconds since 1 January 1970 (UTC). It must be within 5 seconds of our clock; GET /public/timestamp tells you ours.
X-Auth-Signature
HMAC-SHA256 of the nonce followed by the key ID, keyed with your secret, as lowercase hex.
signature = hex(HMAC_SHA256(secret, nonce + key))
Read your balances (any key)
const crypto = require('crypto');

const KEY = 'your key ID';
const SECRET = 'your secret';

const nonce = Date.now().toString();
const signature = crypto.createHmac('sha256', SECRET).update(nonce + KEY).digest('hex');

// Node.js 18 or later (built-in fetch)
fetch('https://poolnex.com/api/v2/account/balances', {
    headers: {
        'X-Auth-Apikey': KEY,
        'X-Auth-Nonce': nonce,
        'X-Auth-Signature': signature,
    },
})
    .then(response => response.json())
    .then(console.log);
Place a limit order (a Trade key)
const crypto = require('crypto');

const KEY = 'your key ID';
const SECRET = 'your secret';

const nonce = Date.now().toString();
const signature = crypto.createHmac('sha256', SECRET).update(nonce + KEY).digest('hex');

fetch('https://poolnex.com/api/v2/market/orders', {
    method: 'POST',
    headers: {
        'X-Auth-Apikey': KEY,
        'X-Auth-Nonce': nonce,
        'X-Auth-Signature': signature,
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        'market': 'btcusdt',
        'side': 'buy',
        'ord_type': 'limit',
        'volume': '0.001',
        'price': '50000',
    }),
})
    .then(response => response.json())
    .then(console.log);

Each market has its own lowest and highest price, smallest amount and number of decimals: GET /public/markets lists them. A buy below the market price waits in the order book until it fills or you cancel it.

Keep the secret out of your code and out of shared files: read it from an environment variable or a secrets store.

Keys and permissions

A key can call only the endpoints listed below. Anything else is refused, including every endpoint added in the future until it is listed here.

KindMay callIP list
ReadEvery GET under /account and /market in the endpoint listOptional
TradeAs Read, plus placing and cancelling orders and instant trade quotesRequired

Up to 30 keys an account and 30 IP addresses or ranges a key (for example 203.0.113.7 or 203.0.113.0/24; IPv6 too). A range covering the whole internet is refused.

Never by key: withdrawals, withdrawal addresses, the PIN, security and profile settings, API keys, taking out or repaying loans, and business payments.

Limits

Calls are measured against an allowance of 300 points a key, which comes back at 5 points a second. A call costs 1 point unless it is listed here. Limits may apply above the allowance.

CostCalls
2
  • POST /market/orders
  • POST /market/orders/cancel
  • POST /market/orders/{id}/cancel
  • POST /market/otc/execute
  • GET /market/orders
  • GET /market/trades
  • GET /account/deposits
  • GET /account/withdraws
4
  • POST /market/otc/quote
  • GET /account/transactions
  • GET /public/markets/{market}/k-line

Where a limit applies, the call is refused with status 429 and a Retry-After header with the seconds to wait, also in the body. A refused call costs nothing: wait that long and carry on.

HTTP/1.1 429 Too Many Requests
Retry-After: 3

{"errors": ["authz.too_many_requests"], "retry_after": 3}

Longer limits may apply to a key that keeps going well over the allowance.

Calls without a key share an allowance per IP address.

Errors

A refused call answers with an HTTP status and the reason as a code in its body:

{"errors": ["authz.api_key_read_only"]}
StatusCodeWhat it means
422authz.invalid_api_key_headersOne of the three headers is missing or empty.
401authz.nonce_not_valid_timestampThe nonce is not a positive whole number.
401authz.nonce_expiredThe nonce is more than 5 seconds from our clock. Check yours against GET /public/timestamp.
401authz.invalid_signatureThe signature does not match. Sign the nonce followed by the key ID with the secret.
401authz.unexistent_apikeyThere is no key with this ID.
401authz.apikey_not_activeThe key is turned off.
401authz.user_not_activeThe account is not active.
401authz.disabled_2fa2FA is off on the account, so its keys do not work.
403authz.api_key_forbiddenKeys cannot call this endpoint.
403authz.api_key_read_onlyThis call needs a Trade key.
401authz.api_key_ip_not_allowedThe call came from an address that is not on the key's IP list.
401authz.invalid_permissionThe account is not allowed to make this call.
429authz.too_many_requestsOver the allowance. Wait the seconds in Retry-After.

Endpoints39

Every call a key can make, and market data. Open one for its full address and parameters. Paths are under the base address.

Market data15

Balances and history5

Deposits4

Withdrawals2

Orders and trades6

Buy, sell and convert4

Loans3