API

Introduction

About Open API

We are excited to introduce Korbit's new Open API service! With this service, you can freely access a variety of cryptocurrency exchange functions, including price inquiries, orders, deposits, and withdrawals, all through our Open API.

Any Korbit member can utilize the Korbit Open API to develop their own programs or send API requests, integrating their cryptocurrency trading strategies with the exchange.

For the latest news and detailed information about the Open API, please visit our Developer Center. Start using the Korbit Open API today to implement your own programs and strategies!

REST API Base URL

https://api.korbit.co.kr

WebSocket API Base URL

wss://ws-api.korbit.co.kr

Generate API Keys

To use the Korbit Open API, you need to generate an API key. Any Korbit member can create an API key through the Korbit Developers.

When creating an API key, you can choose between two authentication signature methods: HMAC-SHA256 and ED25519.

HMAC-SHA256: Korbit generates the secret key required for signing and provides it to the user.
ED25519: The user generates an ED25519 key pair (public key and private key) and provides the public key to Korbit during the API key creation process.

For subsequent Open API usage, the user must send API requests signed with the method corresponding to their API key.

HMAC-SHA256: Convenient because Korbit generates the secret key for you. (Korbit securely encrypts and stores your secret key.)
ED25519: Requires the user to generate their own ED25519 key pair, which can be cumbersome but offers the advantage of enhanced security since the private key is not exposed.

For more detailed information, please refer to the Korbit Developers.

Generate ED25519 Key Pair (Node.js)

import { generateKeyPairSync } from "crypto";

const { publicKey, privateKey } = generateKeyPairSync("ed25519", {
  publicKeyEncoding: {
    type: "spki",
    format: "pem",
  },
  privateKeyEncoding: {
    type: "pkcs8",
    format: "pem",
  },
});

// Public Key (PKIX Format), Private Key (PKCS #8 Format)
console.log(publicKey, privateKey);

Generate ED25519 Key Pair (OpenSSL)

# Private Key
openssl genpkey -algorithm ED25519 -out private_key.pem
# Public Key
openssl pkey -in private_key.pem -pubout -out public_key.pem

Manage API Keys

You can modify the permissions and other settings of your API key or delete it through the Korbit Developers. An API key is valid for one year from the date of creation, and the available functions vary depending on the permissions set. For instance, to place or cancel orders, you need an API key with the Order Placement permission.

Additionally, each API key can be restricted to specific IP addresses (up to a maximum of 20), which can also be configured in the Developer Center.

When you add, modify, or delete API keys, it may take up to 1 minute for the changes to be applied.

REST API

Send Requests

General API Requests

To use the REST API, you need to send HTTP requests to the Open API server (https://api.korbit.co.kr).

For GET and DELETE method requests, include the values in the URL query string. For POST method requests, include the values in the request body using the application/x-www-form-urlencoded format. The order of the input variables does not matter.

API Responses

API responses are provided in JSON format, and the time is given in UNIX timestamp (in milliseconds).

Public API

Public APIs, such as quotation APIs, are open for anyone to use without an API key or authentication.

Private API

Private APIs, such as orders, assets, and deposits/withdrawals APIs, are available to Korbit members through their accounts. To use these, you need to obtain an API key and send authenticated API requests signed accordingly.

The accessibility of the private APIs depends on the seven permissions you can set for each API key: Asset Inquiry, Order Inquiry, Order Placement, Deposit Inquiry, Deposit Request, Withdrawal Inquiry, Withdrawal Request

For example, if you want to place or cancel orders via the Open API, you need to grant Order Placement permission to the API key. If you want to limit the key to only allow trading without deposit/withdrawal capabilities, do not grant Deposit Request and Withdrawal Request permissions.

For details on signing requests, refer to the section on Sending Signed Requests.

Request Example

curl 'https://api.korbit.co.kr/v2/tickers?symbol=btc_krw'

Rate Limit

When using the REST API, there are rate limits on the number of requests you can make within a certain timeframe, depending on the type of API. If you exceed these limits, you may encounter a 429 Too Many Requests error. The only consequence of exceeding the rate limit is that you will not receive valid API responses until the limit is reset.

Rate Limit Policy

Rate limits are measured based on the IP address for public APIs such as Get Orderbook, while private APIs, like Place Order, are measured based on the member account (not the API key, but the member account). The policies vary by API type as follows:

  • Public API: 50 requests per second
  • Order Placement: 30 requests per second
  • Order Cancellation: 30 requests per second
  • Deposit/Withdrawal Requests: 5 requests per second
  • Other Private APIs: 50 requests per second

You can check the remaining number of requests allowed by looking at the Ratelimit header in the HTTP response. The header contains: `limit`: The maximum number of requests allowed for that API endpoint. `remaining`: The number of requests remaining in the current limit window. `reset`: The time (in seconds) until the rate limit is reset. The `Ratelimit-Policy` header indicates the rate limit policy applied to the API endpoint, showing the maximum number of requests and the time window in seconds (maximum requests;time window(seconds)).

Response Header

200 OK
Ratelimit: limit=50, remaining=48, reset=1
Ratelimit-Policy: 50;w=1

Response Header

429 Too Many Requests
Retry-After: 1
Ratelimit-Policy: 30;w=1

FAQ

Korbit Developers provides a FAQ section.

Additionally, Developers offers code examples for sending HMAC-SHA256 or ED25519 signed requests for using the Private API in Go, Node.js, and Python.

Korbit Open API operates on an asynchronous system. Therefore, there may be slight delays in the response data, which is expected and indicates normal operation.

If there is any discrepancy between the Korean API documentation and the English API documentation, the Korean API documentation shall prevail.

With the Open API update, additional fields may be included in the API response. Therefore, when developing a program using the Open API, please consider that new fields might be added to the API response.

Sign API Requests

The following explains how to sign API requests based on the authentication method (HMAC-SHA256, ED25519) selected during API key creation.

HMAC-SHA256: Korbit generates and provides a secret key, which users must use to sign their API requests using the HMAC-SHA256 method.

ED25519: Users generate their own ED25519 key pair and provide the public key to Korbit during API key creation. Users then sign their API requests using the private key from the key pair.

General Signing

When making an authenticated API request, you must send a signed request, which includes the signature and timestamp parameters.

The signature parameter is the result of signing a concatenated string of the input variables and the timestamp using either the HMAC-SHA256 or ED25519 method. The timestamp parameter is the current UNIX timestamp in milliseconds. The signature must be included in either the URL query string or the request body.


Timestamp

To ensure time accuracy during signing, the current UNIX timestamp in milliseconds MUST be provided as the timestamp parameter. Therefore, you should first ensure that your computer's current time is synchronized with the standard time. (Note: You can check the time on the Korbit Open API server using the GET /v2/time API.)

Due to potential delays in the network or computer environment, there might be a time difference between when the client signs the request and when the Open API server receives it. In the fast-paced world of cryptocurrency trading, timing is crucial. To prevent unintended request results due to significant time differences, the Korbit Open API can be configured to ignore requests if the time difference exceeds a certain value.

recvWindow: This optional parameter allows users to specify the maximum allowable time difference (in milliseconds) between the signing time and the time the API server receives the request. If not provided, the default value is 5000 milliseconds (5 seconds). The maximum allowable value for this parameter is 60000 milliseconds (60 seconds). For example, if recvWindow=3000 is provided, the API request will be rejected if the server receives it more than 3 seconds after the timestamp.

Lastly, the timestamp cannot be set to a future time. Any request with a timestamp more than 1 second ahead of the API server's time will be rejected.

If a request fails due to an clock error, the server will respond with the EXCEED_TIME_WINDOW error code. In this case, please check the server's time using the /v2/time API.
For stable API operations, please configure the NTP time synchronization feature in your OS.

Timestamp Check Logic

 if (serverTime - timestamp <= recvWindow && timestamp < serverTime + 1000) {
    // PROCESS
  } else {
    // REJECT
  }

HMAC-SHA256

Quick Guide

Refer to the attached Node.js example code. Simply replace the API key and secret key with your own to place an order using the code.

Verify Required Information

If you have generated an API key (system-generated key) for authentication using HMAC-SHA256, first check the secret key provided by Korbit when the API key was created. Also, ensure that the API key has the permissions required to perform the desired functions.

Enter Request Parameters

For example, if you want to use the Place Order function, you need to send a POST request to the /v2/orders endpoint of the Korbit Open API. Enter the request parameters according to the order details.

If you want to place a buy order for 1 BTC at a price of 100 million KRW, i.e., a BTC/KRW limit buy order (buy price 100,000,000 and buy quantity 1), you can enter the request parameters as follows:

symbol: btc_krw
side: buy
price: 100000000
qty: 1

Optionally, you can add the timeInForce value to set GTC, IOC, FOK, or Post Only. For a simple limit order, GTC is the default, so you can omit timeInForce or set it to gtc.

For GET and DELETE method requests, enter the request parameters in the URL query string. For POST method requests, enter them in the request body in application/x-www-form-urlencoded format.

Enter Timestamp

Next, as mentioned earlier, you need to enter the current UNIX timestamp (in milliseconds) as the timestamp value. In the example code, recvWindow is set to 5000, but you can omit recvWindow if you want (it defaults to 5000). Note that the order of the request parameters, including the timestamp, does not matter.

Create HMAC Signature

To sign the message, concatenate all request parameters into a single string, and then generate the HMAC-SHA256 signature using the secret key.

For example, create a string like symbol=btc_krw&side=buy&price=100000000&qty=1&orderType=buy&timestamp=1719232467910, and sign it using the secret key. Refer to the API documentation, Developers examples, or resources like internet searches or ChatGPT for HMAC-SHA256 signature generation methods in different programming languages.

If request parameters exist in both the URL query string and the HTTP request body, concatenate them as-is. For example, if timestamp=1719232467910 is in the query string and symbol=btc_krw is in the request body, the string to sign becomes timestamp=1719232467910symbol=btc_krw (note: no & between query string and request body).

Once the signature is generated, add it to the request parameters as signature.

Send the Request

It's time to send the API request. For private API requests like placing an order, send the API key in the HTTP request header as X-KAPI-KEY along with the signed message. If you are not using a library that automatically handles HTTP requests, also include Content-Type: application/x-www-form-urlencoded.

If the request is successful, you will receive a response indicating that the order has been placed in JSON format. Note that even if the request is successful, the order will not be placed if you do not have sufficient KRW balance for the cryptocurrency purchase.

HMAC-SHA256 Signature Example (Node.js)

// Node.js Example
import crypto from "crypto";

const apiKey = "XyAZ_apaUv9pg4ZyGzNHTxabfIDrWIRpPBgk5-olIuM"; // API Key
const apiSecret = "ZwKS2evdxj9j3Neir2s0UHAmpNFfo4a0iHawEElGCBs"; // HMAC-SHA256 Secret Key

const baseUrl = "https://api.korbit.co.kr"; // Base URL

// Create HMAC-SHA256 Signature
const createHmacSignature = (query) => {
  return crypto.createHmac("sha256", apiSecret).update(query, "utf-8").digest("hex");
};

// Place Order (POST Method Example)
const placeOrder = async (symbol, side, price, qty, orderType, timeInForce) => {
  const timestamp = Date.now(); // Timestamp (ms)

  // Request Parameters
  const params = new URLSearchParams({
    symbol: symbol,
    side: side,
    price: price,
    qty: qty,
    orderType: orderType,
    timeInForce: timeInForce,
    timestamp: timestamp,
  });

  // Create Signature
  const signature = createHmacSignature(params.toString());

  // Add Signature to params
  params.append("signature", signature);

  // API Endpoint
  const url = `${baseUrl}/v2/orders`;

  const headers = {
    "X-KAPI-KEY": apiKey, // API Key
    "Content-Type": "application/x-www-form-urlencoded", // POST Method
  };

  try {
    const response = await fetch(url, {
      method: "POST",
      headers: headers,
      // POST Request: params in body
      body: params.toString(),
    });
    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error Place Order:", error);
  }
};

// Cancel Order (DELETE Method Example)
// You can use this code for GET Method; modify method to "GET".
const cancelOrder = async (symbol, orderId) => {
  const timestamp = Date.now(); // Timestamp (ms)

  // Request Parameters
  const params = new URLSearchParams({
    symbol: symbol,
    orderId: orderId,
    timestamp: timestamp,
  });

  // Create Signature
  const signature = createEd25519Signature(params.toString());

  // API Endpoint
  const url = `${baseUrl}/v2/orders`;

  const headers = {
    "X-KAPI-KEY": apiKey, // API Key
  };

  // Add Signature to params
  params.append("signature", signature);

  try {
    // GET, DELETE Method: params in URL Querystring
    const response = await fetch(url + "?" + params.toString(), {
      method: "DELETE",
      headers: headers,
    });
    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error Cancel Order:", error);
  }
};

// Place Order: Buy BTC
placeOrder("btc_krw", "buy", "90000000", "0.5", "limit", "gtc")
  .then((data) => console.log("Order Response:", data))
  .catch((err) => console.error("Order Error:", err));

// Cancel Order: BTC, OrderID 1000001234
cancelOrder("btc_krw", 1000001234)
  .then((data) => console.log("Cancel Response:", data))
  .catch((err) => console.error("Cancel Error:", err));

ED25519

Quick Guide

Refer to the attached Node.js example code. Simply replace the API key and private key with your own to place an order using the code.

Verify Required Information

If you have generated an API key for authentication using the ED25519 method (user-generated key), first check the private key you provided to Korbit when creating the key. Also, ensure that the API key has the permissions required to perform the desired functions.

Enter Request Parameters

For example, if you want to use the Place Order function, you need to send a POST request to the /v2/orders endpoint of the Korbit Open API. Enter the request parameters according to the order details.

If you want to place a buy order for 1 BTC at a price of 100 million KRW, i.e., a BTC/KRW limit buy order (buy price 100,000,000 and buy quantity 1), you can enter the request parameters as follows:

symbol: btc_krw
side: buy
price: 100000000
qty: 1

Optionally, you can add the timeInForce value to set GTC, IOC, FOK, or Post Only. For a simple limit order, GTC is the default, so you can omit timeInForce or set it to gtc.

For GET and DELETE method requests, enter the request parameters in the URL query string. For POST method requests, enter them in the request body in application/x-www-form-urlencoded format.

Enter Timestamp

Next, as mentioned earlier, you need to enter the current UNIX timestamp (in milliseconds) as the timestamp value. In the example code, recvWindow is set to 5000, but you can omit recvWindow if you want (it defaults to 5000). Note that the order of the request parameters, including the timestamp, does not matter.

Create ED25519 Signature

To sign the message, concatenate all request parameters into a single string, and then generate the ED25519 signature using the private key.

For example, create a string like symbol=btc_krw&side=buy&price=100000000&qty=1&orderType=buy&timestamp=1719232467910, and sign it using the private key. Refer to the API documentation, Developers examples, or resources like internet searches or ChatGPT for ED25519 signature generation methods in different programming languages.

The generated ED25519 signature must be encoded in Base64 format before being sent to Korbit.

If request parameters exist in both the URL query string and the HTTP request body, concatenate them as-is. For example, if timestamp=1719232467910 is in the query string and symbol=btc_krw is in the request body, the string to sign becomes timestamp=1719232467910symbol=btc_krw (note: no & between query string and request body).

Once the signature is generated, add it to the request parameters as signature.

Send the Request

It's time to send the API request. For private API requests like placing an order, send the API key in the HTTP request header as X-KAPI-KEY along with the signed message. If you are not using a library that automatically handles HTTP requests, also include Content-Type: application/x-www-form-urlencoded.

When using an ED25519 API key, ensure that the Base64-encoded signature is URL-encoded when sent to Korbit. Use a utility like URLSearchParams in Node.js to handle the string conversion automatically or ensure the library used for sending HTTP requests properly URL-encodes the data. If handling HTTP requests manually, as with cURL, use the --data-urlencode option.

If the request is successful, you will receive a response indicating that the order has been placed in JSON format. Note that even if the request is successful, the order will not be placed if you do not have sufficient KRW balance for the cryptocurrency purchase.

ED25519 Signature Example (Node.js)

// Node.js Example
import crypto from "crypto";

const apiKey = "IrZybUY2WX-Quq_CHC5XQnq80CTVjUwd51TH3-yF6xY"; // API Key
const privateKeyPem = `-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIIyEYpSboChBdAqcvZUB7PVJNV37whhYeZq/wIo+PSej
-----END PRIVATE KEY-----`;

const baseUrl = "https://api.korbit.co.kr"; // Base URL

// Create ED25519 Signature
const createEd25519Signature = (data) => {
  const messageBuffer = Buffer.from(data);
  const signature = crypto.sign(null, messageBuffer, {
    key: privateKeyPem,
  });
  return signature.toString("base64");
};

// Place Order (POST Method Example)
const placeOrder = async (symbol, side, price, qty, orderType, timeInForce) => {
  const timestamp = Date.now(); // Timestamp (ms)

  // Request Parameters
  const params = new URLSearchParams({
    symbol: symbol,
    side: side,
    price: price,
    qty: qty,
    orderType: orderType,
    timeInForce: timeInForce,
    timestamp: timestamp,
  });

  // Create Signature
  const signature = createEd25519Signature(params.toString());

  // API Endpoint
  const url = `${baseUrl}/v2/orders`;

  const headers = {
    "X-KAPI-KEY": apiKey, // API Key
    "Content-Type": "application/x-www-form-urlencoded", // POST Method
  };

  // Add Signature to params (URLSearchParams: Base64 URL Safe)
  params.append("signature", signature);

  try {
    const response = await fetch(url, {
      method: "POST",
      headers: headers,
      // POST Request: params in body
      body: params.toString(),
    });
    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error Place Order:", error);
  }
};

// Cancel Order (DELETE Method Example)
// You can use this code for GET Method; modify method to "GET".
const cancelOrder = async (symbol, orderId) => {
  const timestamp = Date.now(); // Timestamp (ms)

  // Request Parameters
  const params = new URLSearchParams({
    symbol: symbol,
    orderId: orderId,
    timestamp: timestamp,
  });

  // Create Signature
  const signature = createEd25519Signature(params.toString());

  // API Endpoint
  const url = `${baseUrl}/v2/orders`;

  const headers = {
    "X-KAPI-KEY": apiKey, // API Key
  };

  // Add Signature to params (URLSearchParams: Base64 URL Safe)
  params.append("signature", signature);

  try {
    // GET, DELETE Method: params in URL Querystring
    const response = await fetch(url + "?" + params.toString(), {
      method: "DELETE",
      headers: headers,
    });
    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error Cancel Order:", error);
  }
};

// Place Order: Buy BTC
placeOrder("btc_krw", "buy", "90000000", "0.5", "limit", "gtc")
  .then((data) => console.log("Order Response:", data))
  .catch((err) => console.error("Order Error:", err));

// Cancel Order: BTC, OrderID 1000001234
cancelOrder("btc_krw", 1000001234)
  .then((data) => console.log("Cancel Response:", data))
  .catch((err) => console.error("Cancel Error:", err));

Get Tickers

GET/v2/tickers

Get latest price and trading volume for a symbol or symbols.

Request Parameters (Query)

symbol string

Enter the symbols of the trading pairs you want to query, separated by commas (,). If omitted, information for all available trading pairs on Korbit will be returned.

Example

btc_krw,eth_krw

Response (Array)

symbol string Mandatory

Trading pair symbol

Example

btc_krw

open string Mandatory

Open price (24H)

Example

361922.23

high string Mandatory

High price (24H)

Example

361922.23

low string Mandatory

Low price (24H)

Example

361922.23

close string Mandatory

Last price (24H)

Example

361922.23

prevClose string Mandatory

Previous close price (24H)

Example

261922.23

priceChange string Mandatory

changed price. prevClose - close

Example

261922.23

priceChangePercent string Mandatory

changed price percent. 100 * (prevClose - close) / prevClose

Example

10

volume string Mandatory

Trading volume (Base, 24H)

Example

100

quoteVolume string Mandatory

Trading volume (Quote/Counter, 24H)

Example

1000000000

bestBidPrice string Mandatory

Best bid price

Example

5000

bestAskPrice string Mandatory

Best ask price

Example

6000

lastTradedAt number Mandatory

Last traded timestamp (ms)

Example

1700000000000

Request

curl 'https://api.korbit.co.kr/v2/tickers?symbol=btc_krw,eth_krw'

Response

{
  "success": true,
  "data": [
    {
      "symbol": "btc_krw",
      "open": "77060000",
      "high": "79650000",
      "low": "76550000",
      "close": "77136000",
      "prevClose": "77060000",
      "priceChange": "76000",
      "priceChangePercent": "0.1",
      "volume": "48.73739983",
      "quoteVolume": "3785149733.32633",
      "bestBidPrice": "77136000",
      "bestAskPrice": "77193000",
      "lastTradedAt": 1725525721041
    },
    {
      "symbol": "eth_krw",
      "open": "3259000",
      "high": "3370000",
      "low": "3222000",
      "close": "3250000",
      "prevClose": "3259000",
      "priceChange": "-9000",
      "priceChangePercent": "-0.28",
      "volume": "161.99278306",
      "quoteVolume": "532827941.01581",
      "bestBidPrice": "3251000",
      "bestAskPrice": "3254000",
      "lastTradedAt": 1725525545630
    }
  ]
}

Get Orderbook

GET/v2/orderbook

Get orderbook data.

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

Response

timestamp number Mandatory

timestamp (ms)

Example

1700000000000

bids array of object Mandatory

bids

price string Mandatory

price

Example

250000

qty string Mandatory

quantity

Example

10

asks array of object Mandatory

asks

price string Mandatory

price

Example

250000

qty string Mandatory

quantity

Example

10

Request

curl 'https://api.korbit.co.kr/v2/orderbook?symbol=btc_krw'

Response

{
  "success": true,
  "data": {
    "timestamp": 1708057740895,
    "bids": [
      {
        "price": "73303000",
        "qty": "0.00898326"
      },
      {
        "price": "73302000",
        "qty": "0.00790837"
      },
      {
        "price": "73301000",
        "qty": "0.00843099"
      },
      {
        "price": "73300000",
        "qty": "0.00054024"
      },
      {
        "price": "73299000",
        "qty": "0.00663446"
      }
    ],
    "asks": [
      {
        "price": "73304000",
        "qty": "0.00985212"
      },
      {
        "price": "73305000",
        "qty": "0.00367505"
      },
      {
        "price": "73306000",
        "qty": "0.0096254"
      },
      {
        "price": "73307000",
        "qty": "0.00502544"
      },
      {
        "price": "73308000",
        "qty": "0.00640584"
      }
    ]
  }
}

Get Recent Trades

GET/v2/trades

Get recent trades.

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

limit number

limit (range: 1 ~ 500)

Example

100

Response (Array)

timestamp number Mandatory

timestamp (ms)

Example

1700000000000

price string Mandatory

price

Example

250000

qty string Mandatory

quantity

Example

10

isBuyerTaker boolean Mandatory

traded by an buy order

Example

true

tradeId number Mandatory

trade ID (The ID of the trade execution assigned to each trading pair.)

Example

1234

Request

curl 'https://api.korbit.co.kr/v2/trades?symbol=btc_krw&limit=4'

Response

{
  "success": true,
  "data": [
    {
      "timestamp": 1708057271149,
      "price": "70507000",
      "qty": "0.00981535",
      "isBuyerTaker": false
    },
    {
      "timestamp": 1708057271035,
      "price": "70508000",
      "qty": "0.00682475",
      "isBuyerTaker": false
    },
    {
      "timestamp": 1708057270922,
      "price": "70509000",
      "qty": "0.00844147",
      "isBuyerTaker": false
    },
    {
      "timestamp": 1708057270809,
      "price": "70510000",
      "qty": "0.00553963",
      "isBuyerTaker": false
    }
  ]
}

Get Candlesticks

GET/v2/candles

Get historical candlesticks (klines) data.

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

interval string Mandatory

interval

  • 1 1 min
  • 5 5 mins
  • 15 15 mins
  • 30 30 mins
  • 60 1 hour
  • 240 4 hours
  • 1D 1 day
  • 1W 1 week
Example

60

start number

start timestamp. (default: listed time)

Example

1600000000000

end number

end timestamp. must be larger than from. (default: now)

Example

1700000000000

limit number Mandatory

limit (range: 1 ~ 200)

Example

100

Response (Array)

timestamp number Mandatory

candle start timestamp

Example

1619244573612

open string Mandatory

open price

Example

361922.23

high string Mandatory

high price

Example

361922.23

low string Mandatory

low price

Example

361922.23

close string Mandatory

close price

Example

361922.23

volume string Mandatory

volume

Example

100

Request

curl 'https://api.korbit.co.kr/v2/candles?symbol=btc_krw&interval=60&limit=5&end=1700000000000'

Response

{
  "success": true,
  "data": [
    {
      "timestamp": 1708041600000,
      "open": "71211000",
      "high": "9999990000",
      "low": "300000",
      "close": "71392000",
      "volume": "1.932320026577213946"
    },
    {
      "timestamp": 1708045200000,
      "open": "73510000",
      "high": "74605000",
      "low": "300000",
      "close": "72315000",
      "volume": "2.418698679231323743"
    },
    {
      "timestamp": 1708048800000,
      "open": "72315000",
      "high": "9999990000",
      "low": "300000",
      "close": "72380000",
      "volume": "1.947520219976227299"
    },
    {
      "timestamp": 1708052400000,
      "open": "70267000",
      "high": "74777000",
      "low": "300000",
      "close": "74049000",
      "volume": "2.254855048982521506"
    },
    {
      "timestamp": 1708056000000,
      "open": "68304000",
      "high": "74834000",
      "low": "68241000",
      "close": "74825000",
      "volume": "0.630193755379195341"
    }
  ]
}

Get Trading Pairs

GET/v2/currencyPairs

Response (Array)

symbol string Mandatory

trading pair symbol

Example

btc_krw

status string Mandatory
  • launched trading available
  • stopped trading unavailable
Example

launched

Request

curl 'https://api.korbit.co.kr/v2/currencyPairs'

Response

{
  "success": true,
  "data": [
    {
      "symbol": "btc_krw",
      "status": "launched"
    },
    {
      "symbol": "eth_krw",
      "status": "launched"
    },
    {
      "symbol": "xrp_krw",
      "status": "stopped"
    }
  ]
}

Get Order

GET/v2/orders

Use either orderId or clientOrderId to query the status of an individual order.
However, orders with the statuses expired or canceled cannot be retrieved approximately 3 days after they have been closed.

Required Permissions

readOrders

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

orderId number

Enter orderID (responsed by POST /v2/orders). Enter one of orderID or clientOrderId.

Example

1234

clientOrderId string

Enter clientOrderId (requested by POST /v2/orders). Enter one of orderID or clientOrderId.

Example

20141231-155959-abcdef

Response

orderId number Mandatory

Order ID generated by the server.

Example

1234

clientOrderId string

clientOrderId submitted from the user by POST /v2/orders.

Example

20141231-155959-abcdef

symbol string Mandatory

symbol

Example

btc_krw

orderType string Mandatory
  • limit limit order
  • market market order
  • best best bid/offer
Example

limit

side string Mandatory
  • buy
  • sell
Example

buy

timeInForce string

Time in Force strategies.

  • gtc Good-Till-Canceled. The order will remain valid until terminated (fully executed or canceled)
  • ioc Immediate-Or-Cancel. The order will be filled immediately, if can not then will be canceled. (Taker-Only)
  • fok Fill-Or-Kill. The order will be filled fully, if can not then will be canceled. (Taker-Only)
  • po Post-Only. If the order would be filled immediately, then will be canceled. (Maker-Only)

Default:

  • limit order: gtc
  • market order: ioc
  • best bid/offer: no default(Bad Request error if omitted)

For market orders, only ioc can be entered.

Example

gtc

price string

Order price (limit/BBO order only. no price for market order. For BBO orders it's set after the price is determined)

Example

5000

qty string

Order quantity (limit/BBO order or sell-side market order only. For BBO orders it's set after the quantity is determined)

Example

10

amt string

Purchase amount in counter/quote asset like KRW. (buy-side market/BBO order only)

Example

50000

filledQty string Mandatory

Filled quantity

Example

10

filledAmt string Mandatory

Filled amount in counter/quote asset like KRW.

Example

50000

avgPrice string

Average execution price

Example

5000

createdAt number Mandatory

Order timestamp (ms)

Example

1700000000000

lastFilledAt number

Last execution timestamp (ms)

Example

1700000000000

triggeredAt number

Stop-limit order trigged timestamp

Example

1700000000000

status string Mandatory

Order status

  • pending Order pending. When the balance is insufficient or timeInForce condition is triggered, the order may fail and change to the expired status.
  • open Fully unfilled
  • filled Fully executed
  • canceled Fully canceled
  • partiallyFilled Partially filled
  • partiallyFilledCanceled Partially filled and remaining amount canceled
  • expired Order submission failed (due to insufficient balance or timeInForce conditions)
Example

partiallyFilled

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/orders?clientOrderId=20141231-155959-abcdef&symbol=btc_krw&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": {
    "orderId": 1234,
    "clientOrderId": "20141231-155959-abcdef",
    "symbol": "btc_krw",
    "orderType": "limit",
    "side": "buy",
    "timeInForce": "gtc",
    "avgPrice": "5000",
    "price": "5000",
    "qty": "10",
    "filledQty": "1",
    "filledAmt": "5000",
    "createdAt": 1700000000000,
    "lastFilledAt": 1700000000000,
    "status": "partiallyFilled"
  }
}

Get Open Orders

GET/v2/openOrders

Query the list of open orders for a single trading pair. Only orders with the status open or partiallyFilled are queried.

Required Permissions

readOrders

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

limit number

Number of queries (range: 1 to 1000). Default is 500.

Example

100

Response (Array)

orderId number Mandatory

Order ID generated by the server.

Example

1234

orderType string Mandatory
  • limit limit order
  • market market order
  • best best bid/offer
Example

limit

side string Mandatory
  • buy
  • sell
Example

buy

price string

Order price (limit/BBO order only. no price for market order. For BBO orders it's set after the price is determined)

Example

5000

qty string

Order quantity (limit/BBO order or sell-side market order only. For BBO orders it's set after the quantity is determined)

Example

10

amt string

Purchase amount in counter/quote asset like KRW. (buy-side market/BBO order only)

Example

50000

filledQty string Mandatory

Filled quantity

Example

10

filledAmt string Mandatory

Filled amount in counter/quote asset like KRW.

Example

50000

avgPrice string

Average execution price

Example

5000

createdAt number Mandatory

Order timestamp (ms)

Example

1700000000000

lastFilledAt number

Last execution timestamp (ms)

Example

1700000000000

status string Mandatory

Order status

  • pending Order pending. When the balance is insufficient or timeInForce condition is triggered, the order may fail and change to the expired status.
  • open Fully unfilled
  • filled Fully executed
  • canceled Fully canceled
  • partiallyFilled Partially filled
  • partiallyFilledCanceled Partially filled and remaining amount canceled
  • expired Order submission failed (due to insufficient balance or timeInForce conditions)
Example

partiallyFilled

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/openOrders?limit=100&symbol=btc_krw&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "orderId": 1234,
      "orderType": "limit",
      "side": "buy",
      "avgPrice": "5000",
      "price": "5000",
      "qty": "10",
      "filledQty": "1",
      "filledAmt": "5000",
      "createdAt": 1700000000000,
      "lastFilledAt": 1700000000000,
      "status": "partiallyFilled"
    },
    {
      "orderId": 1235,
      "orderType": "limit",
      "side": "sell",
      "price": "5000",
      "qty": "10",
      "filledQty": "0",
      "filledAmt": "0",
      "createdAt": 1700000000000,
      "status": "open"
    },
  ],
}

Get All Orders

GET/v2/allOrders

Query the recent order list for a single trading pair. Only orders created within 36 hours can be queried.
This API is for checking order history, and the information provided may have a delay of a few seconds.
If you need current information without delay, please use the /v2/openOrders or /v2/orders API.

Required Permissions

readOrders

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

startTime number

Query start time. Only data up to 36 hours prior to the current time can be queried. If not set, the query will retrieve data from 36 hours ago by default.

endTime number

Query end time. If not set, data will be retrieved up to the current time.

limit number

Maximum number of queries (range: 1 to 1000). Default is 500.

Example

100

Response (Array)

orderId number Mandatory

Order ID generated by the server.

Example

1234

clientOrderId string

clientOrderId submitted from the user by POST /v2/orders.

Example

20141231-155959-abcdef

symbol string Mandatory

symbol

Example

btc_krw

orderType string Mandatory
  • limit limit order
  • market market order
  • best best bid/offer
Example

limit

side string Mandatory
  • buy
  • sell
Example

buy

timeInForce string

Time in Force strategies.

  • gtc Good-Till-Canceled. The order will remain valid until terminated (fully executed or canceled)
  • ioc Immediate-Or-Cancel. The order will be filled immediately, if can not then will be canceled. (Taker-Only)
  • fok Fill-Or-Kill. The order will be filled fully, if can not then will be canceled. (Taker-Only)
  • po Post-Only. If the order would be filled immediately, then will be canceled. (Maker-Only)

Default:

  • limit order: gtc
  • market order: ioc
  • best bid/offer: no default(Bad Request error if omitted)

For market orders, only ioc can be entered.

Example

gtc

price string

Order price (limit/BBO order only. no price for market order. For BBO orders it's set after the price is determined)

Example

5000

qty string

Order quantity (limit/BBO order or sell-side market order only. For BBO orders it's set after the quantity is determined)

Example

10

amt string

Purchase amount in counter/quote asset like KRW. (buy-side market/BBO order only)

Example

50000

filledQty string Mandatory

Filled quantity

Example

10

filledAmt string Mandatory

Filled amount in counter/quote asset like KRW.

Example

50000

avgPrice string

Average execution price

Example

5000

createdAt number Mandatory

Order timestamp (ms)

Example

1700000000000

lastFilledAt number

Last execution timestamp (ms)

Example

1700000000000

triggeredAt number

Stop-limit order trigged timestamp

Example

1700000000000

status string Mandatory

Order status

  • pending Order pending. When the balance is insufficient or timeInForce condition is triggered, the order may fail and change to the expired status.
  • open Fully unfilled
  • filled Fully executed
  • canceled Fully canceled
  • partiallyFilled Partially filled
  • partiallyFilledCanceled Partially filled and remaining amount canceled
  • expired Order submission failed (due to insufficient balance or timeInForce conditions)
Example

partiallyFilled

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/allOrders?limit=100&symbol=btc_krw&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "orderId": 1234,
      "clientOrderId": "20141231-155959-abcdef",
      "symbol": "btc_krw",
      "orderType": "limit",
      "side": "buy",
      "timeInForce": "gtc",
      "avgPrice": "5000",
      "price": "5000",
      "qty": "10",
      "filledQty": "1",
      "filledAmt": "5000",
      "createdAt": 1700000000000,
      "lastFilledAt": 1700000000000,
      "status": "partiallyFilled"
    },
    {
      "orderId": 1235,
      "clientOrderId": "20141231-155959-abcdeg",
      "symbol": "btc_krw",
      "orderType": "limit",
      "side": "sell",
      "timeInForce": "gtc",
      "price": "5000",
      "qty": "10",
      "filledQty": "0",
      "filledAmt": "0",
      "createdAt": 1700000000000,
      "lastFilledAt": 1700000000000,
      "status": "open"
    },
  ],
}

Get Recent Trades

GET/v2/myTrades

Query the recent trades list for a single trading pair. Only trade history from the past 36 hours can be queried.
This API is for checking trade history, and the information provided may have a delay of a few seconds.

Required Permissions

readOrders

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

startTime number

Query start time. Only data up to 36 hours prior to the current time can be queried. If not set, the query will retrieve data from 36 hours ago by default.

endTime number

Query end time. If not set, data will be retrieved up to the current time.

limit number

Maximum number of queries (range: 1 to 1000). Default is 500.

Example

100

Response (Array)

symbol string Mandatory

symbol

Example

btc_krw

tradeId number Mandatory

trade ID (The ID of the trade execution assigned to each trading pair.)

Example

1234

orderId number Mandatory

order ID

Example

1234

side string Mandatory
  • buy
  • sell
Example

buy

price string Mandatory

trade price

Example

5000

qty string Mandatory

trade quantity (base)

Example

10

amt string Mandatory

trade amount (counter/quote)

Example

50000

tradedAt number Mandatory

trade timestamp (ms)

Example

1700000000000

isTaker boolean Mandatory

taker trade true, maker trade false.

Example

true

feeCurrency string

asset used for fee payment

Example

krw

feeQty string

fee quantity

Example

50

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/myTrades?limit=100&symbol=btc_krw&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "symbol": "btc_krw",
      "tradeId": 52,
      "orderId": 382312,
      "side": "buy",
      "price": "5000",
      "qty": "10",
      "amt": "50000",
      "tradedAt": 1700000000000,
      "isTaker": true,
      "feeCurrency": "krw",
      "feeQty": "50"
    }
  ],
}

Place Order

POST/v2/orders

Place a new order.

Required Permissions

writeOrders

Request Parameters (POST)

symbol string Mandatory

Trading pair

Example

btc_krw

side string Mandatory
  • buy
  • sell
Example

buy

price string

order price for a limit order.
omit for a market/BBO order.

Example

250000

qty string

order quantity for a limit order and a market/BBO sell order.
omit for a market/BBO buy order.

Example

10

amt string

order amount (purchase amount) for a market/BBO buy order.
omit for a limit order and a market/BBO sell order.

Example

250000

orderType string Mandatory
  • limit limit order
  • market market order
  • best best bid/offer. The timeInForce and bestNth parameters must be set.
Example

limit

bestNth number

Selects the order's price when orderType=best. For other types, this parameter must be omitted.

  • when timeInForce is one of gtc,ioc,fok: Opponent N price level where N is 1 ~ 5.
  • when timeInForce is po: Queue N price level where N is 1 ~ 5.
Example

1

timeInForce string

Time in Force strategies.

  • gtc Good-Till-Canceled. The order will remain valid until terminated (fully executed or canceled)
  • ioc Immediate-Or-Cancel. The order will be filled immediately, if can not then will be canceled. (Taker-Only)
  • fok Fill-Or-Kill. The order will be filled fully, if can not then will be canceled. (Taker-Only)
  • po Post-Only. If the order would be filled immediately, then will be canceled. (Maker-Only)

Default:

  • limit order: gtc
  • market order: ioc
  • best bid/offer: no default(Bad Request error if omitted)

For market orders, only ioc can be entered.

Example

gtc

clientOrderId string

User-defined order ID. Even if multiple requests are made with the same clientOrderId, it will be processed only once.
You can search for the order using clientOrderId with the GET /v2/orders. Only strings matching the following regex pattern are allowed: [0-9a-zA-Z.:_-]{1,36}
However, orders with the statuses expired or canceled cannot be searched by clientOrderId or same clientOrderId can be reused approximately three days after they have been closed.

Example

20141231-155959-abcdef

Response

orderId number Mandatory

order ID

Example

1234

Error Code

Common Errors +
  • DUPLICATE_CLIENT_ORDER_ID: Request rejected due to duplicate `clientOrderId`.
  • INVALID_CURRENCY_PAIR: Invaild symbol.
  • INVALID_USER_STATUS: Trading has been temporarily restricted according to Korbit's policy.
  • BAD_REQUEST: Bad request.
  • NO_BALANCE: Insufficient balance.
  • ONLY_SELL_LIMIT_ORDERS_ALLOWED: Only limit sell orders are allowed during the initial listing period.
  • ORDER_VALUE_TOO_LARGE: Order exceeds the maximum amount. Please adjust the `qty` * `price` to be 1 billion KRW or less.
  • ORDER_VALUE_TOO_SMALL: Order does not meet the minimum amount. Please adjust the `qty` * `price` to be at least 5,000 KRW.
  • PRICE_OVER_UPPER_BOUND: Below the upper price limit during the initial listing period.
  • PRICE_UNDER_LOWER_BOUND: Below the lower price limit during the initial listing period.
  • PRICE_TICK_SIZE_INVALID: Invaild tick size.
  • TOO_MANY_OPEN_ORDERS: Order quantity limit exceeded.

Request

curl -X POST -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/orders' -H Content-Type: application/x-www-form-urlencoded --data-raw orderType=limit&price=250000&qty=10&side=buy&symbol=btc_krw&timeInForce=gtc&timestamp=TIMESTAMP&signature=SIGNATURE

Response

{
  "success": true,
  "data": {
    "orderId": 1234
  }
}

Cancel Order

DELETE/v2/orders

Cancel an open order.
If the API call is successful or the error code is one of ORDER_ALREADY_CANCELED, ORDER_ALREADY_FILLED, or ORDER_ALREADY_EXPIRED, it means the order has been closed.

Required Permissions

writeOrders

Request Parameters (Query)

symbol string Mandatory

Trading pair

Example

btc_krw

orderId number

orderId responsed in POST /v2/orders. You must choose to enter either orderId or clientOrderId.

Example

1234

clientOrderId string

clientOrderId which is a user-defined order ID requested in POST /v2/orders. You must choose to enter either orderId or clientOrderId.

Example

20141231-155959-abcdef

Error Code

Common Errors +
  • ORDER_NOT_FOUND: Not found order
  • ORDER_ALREADY_CANCELED: Already canceled order
  • ORDER_ALREADY_FILLED: Already filled order
  • ORDER_ALREADY_EXPIRED: Already expired order
  • TRY_AGAIN: The order is currently being processed. Please try again in a few moments later.

Request

curl -X DELETE -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/orders?orderId=1234&symbol=btc_krw&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true
}

Get Balance

GET/v2/balance

Get balance.

Required Permissions

readBalances

Request Parameters (Query)

currencies string

List of assets to query. Enter them separated by commas (,). If this field is not provided, all currently held assets will be queried.

Example

btc,eth

Response (Array)

currency string Mandatory

asset name

Example

krw

balance string Mandatory

balance. available + tradeInUse + withdrawalInUse

Example

100

available string Mandatory

available quantity

Example

70

tradeInUse string Mandatory

quantity in trade

Example

20

withdrawalInUse string Mandatory

quantity in withdrawal

Example

10

avgPrice string Mandatory

average purchase price

Example

5000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/balance?currencies=btc%2Ceth&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "currency": "btc",
      "balance": "100",
      "available": "70",
      "tradeInUse": "20",
      "withdrawalInUse": "10",
      "avgPrice": "5000"
    },
    {
      "currency": "eth",
      "balance": "100",
      "available": "70",
      "tradeInUse": "20",
      "withdrawalInUse": "10",
      "avgPrice": "5000"
    }
  ]
}

Get All Address

GET/v2/coin/depositAddresses

Retrieve the list of cryptocurrency deposit addresses.

Required Permissions

readDeposits

Response (Array)

currency string Mandatory

symbol of the asset

Example

btc

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

deposit address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/depositAddresses?timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "currency": "btc",
      "network": "BTC",
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    },
    {
      "currency": "xrp",
      "network": "XRP",
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      "secondaryAddress": "1234",
    }
  ]
}

Get Single Address

GET/v2/coin/depositAddress

Get the deposit address for a single cryptocurrency.

Required Permissions

readDeposits

Request Parameters (Query)

currency string Mandatory

symbol of the asset

Example

btc

network string

symbol of the blockchain network. List of networks can be queried using the /v2/currencies API.
Uses the default network if omitted. Please always specify the network to prevent possible errors, as the default network can be changed.

Example

BTC

Response

currency string Mandatory

symbol of the asset

Example

btc

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

deposit address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/depositAddress?currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": {
    "currency": "btc",
    "network": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  }
}

Generate Address

POST/v2/coin/depositAddress

Generate a cryptocurrency deposit address. If a deposit address already exists, the existing address will be returned.

Required Permissions

writeDeposits

Request Parameters (POST)

currency string Mandatory

symbol of the asset

Example

btc

network string

symbol of the blockchain network. List of networks can be queried using the /v2/currencies API.
Uses the default network if omitted. Please always specify the network to prevent possible errors, as the default network can be changed.

Example

BTC

Response

currency string Mandatory

symbol of the asset

Example

btc

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

deposit address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

Request

curl -X POST -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/depositAddress' -H Content-Type: application/x-www-form-urlencoded --data-raw currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE

Response

{
  "success": true,
  "data": {
    "currency": "btc",
    "network": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  }
}

Get Recent Deposits

GET/v2/coin/recentDeposits

Get recent deposit history.

Required Permissions

readDeposits

Request Parameters (Query)

currency string Mandatory

symbol of the asset

Example

btc

limit number Mandatory

Maximum number of queries (range: 1 to 100).

Example

100

Response (Array)

id number Mandatory

deposit ID

Example

1234

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

deposit address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

status string Mandatory

deposit status

  • pending Deposit transaction is detected on the network.
  • actionRequired Pending deposit documentation submission. To process the deposit, please submit the required documents for approval on the Korbit website.
  • reviewing Deposit documentation reviewing.
  • done Deposit done.
  • refunded Deposit amount returned after review rejection.
  • failed Deposit failed (e.g., due to issues with the transaction).
Example

done

transactionHash string Mandatory

transaction hash

Example

0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

currency string Mandatory

symbol of the asset

Example

btc

quantity string Mandatory

deposit quantity

Example

1.234

createdAt number Mandatory

deposit timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/recentDeposits?currency=btc&limit=100&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "id": 1234,
      "network": "BTC",
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      "secondaryAddress": null,
      "status": "done",
      "transactionHash": "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
      "currency": "btc",
      "quantity": "1.234",
      "createdAt": 1700000000000
    }
  ]
}

Get Deposit Status

GET/v2/coin/deposit

Check the status of cryptocurrency deposits.

Required Permissions

readDeposits

Request Parameters (Query)

currency string Mandatory

symbol of the asset

Example

btc

coinDepositId number Mandatory

deposit ID

Example

1234

Response

id number Mandatory

deposit ID

Example

1234

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

deposit address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

status string Mandatory

deposit status

  • pending Deposit transaction is detected on the network.
  • actionRequired Pending deposit documentation submission. To process the deposit, please submit the required documents for approval on the Korbit website.
  • reviewing Deposit documentation reviewing.
  • done Deposit done.
  • refunded Deposit amount returned after review rejection.
  • failed Deposit failed (e.g., due to issues with the transaction).
Example

done

transactionHash string Mandatory

transaction hash

Example

0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

currency string Mandatory

symbol of the asset

Example

btc

quantity string Mandatory

deposit quantity

Example

1.234

createdAt number Mandatory

deposit timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/deposit?coinDepositId=1234&currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": {
    "id": 1234,
    "network": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "secondaryAddress": null,
    "status": "done",
    "transactionHash": "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "currency": "btc",
    "quantity": "1.234",
    "createdAt": 1700000000000
  }
}

Get Address

GET/v2/coin/withdrawableAddresses

Retrieve the list of addresses registered for API withdrawals.

Required Permissions

readWithdrawals

Response (Array)

network string Mandatory

symbol of the blockchain network

Example

ETH

currency string

symbol of the asset. Omitted for withdraw addesses registered for any currency on the network.

Example

btc

address string Mandatory

address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/withdrawableAddresses?timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "network": "BTC",
      "currency": "btc",
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    },
    {
      "network": "ETH",
      "address": "0x05a56e2d52c817161883f50c441c3228cfe54d9f"
    }
  ]
}

Get Withdrawable Amount

GET/v2/coin/withdrawableAmount

Get the available cryptocurrency withdrawal amount.

Required Permissions

readWithdrawals

Request Parameters (Query)

currency string

Symbol of the cryptocurrency to query. If not provided, all assets will be queried.

Example

btc

Response (Array)

currency string Mandatory

symbol of the asset

Example

btc

withdrawableAmount string Mandatory

withdrawable amount

Example

1.52

withdrawalInUseAmount string Mandatory

amount in withdrawal

Example

0.005

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/withdrawableAmount?currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "currency": "btc",
      "withdrawableAmount": "1.52",
      "withdrawalInUseAmount": "0.005"
    },
    {
      "currency": "eth",
      "withdrawableAmount": "10.52",
      "withdrawalInUseAmount": "2.5"
    }
  ]
}

Request Withdrawal

POST/v2/coin/withdrawal

Request for cryptocurrency withdrawal. You need to register your withdrawal addresses for use with API in order to use this feature.

Required Permissions

writeWithdrawals

Request Parameters (POST)

currency string Mandatory

symbol of the asset

Example

btc

network string

symbol of the blockchain network. List of networks can be queried using the /v2/currencies API.
Uses the default network if omitted. Please always specify the network to prevent possible errors, as the default network can be changed.

Example

BTC

amount string Mandatory

amount of cryptocurrency to withdraw (not including fees)

Example

0.02521236

address string Mandatory

Recipient address. Withdrawals can only be made to addresses registered for API withdrawals.

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, omit or set to an empty string.)

Response

status string Mandatory

Withdrawal status

  • pending Withdrawal request received.
  • actionRequired Pending email confirmation (withdrawal can be canceled). To proceed with the withdrawal, you must verify the confirmation email.
  • reviewing Pending withdrawal reviewing (withdrawal can be canceled). Withdrawal may be delayed according to Korbit's policy.
  • processing Withdrawal processing.
  • done Withdrawal done.
  • canceled Withdrawal canceled.
  • failed Withdrawal failed. (Insufficient balance or other error)
Example

pending

coinWithdrawalId number Mandatory

withdrawal ID

Example

1234

Error Code

Common Errors +
  • INVALID_CURRENCY: Invalid currency
  • WITHDRAWAL_SUSPENDED: Withdrawal suspended
  • UNREGISTERED_WITHDRAWAL_ADDRESS: The address hasn't been registered as an OpenAPI withdrawal address.
  • FORBIDDEN_WITHDRAWAL_ADDRESS: Withdrawals to the address is forbidden due to policy.
  • WITHDRAWAL_ALREADY_IN_PROGRESS: A withdrawal is already in progress. Please try again after the current transaction is completed.
  • INVALID_USER_STATUS: Your account is restricted. Please check your status or contact customer service.
  • NO_BALANCE: Your balance is insufficient. Note: If your balance is insufficient, a `NO_BALANCE` error may occur, or the withdrawal request may succeed but appear as `failed` when checking the withdrawal status.
  • DAILY_LIMIT_EXCEEDED: You have exceeded the daily withdrawal limit.

Request

curl -X POST -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/withdrawal' -H Content-Type: application/x-www-form-urlencoded --data-raw address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa&amount=0.02521236&currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE

Response

{
  "success": true,
  "data": {
    "status": "pending",
    "coinWithdrawalId": 1234
  }
}

Cancel Withdrawal

DELETE/v2/coin/withdrawal

Cancel a cryptocurrency withdrawal.
Withdrawals can only be canceled if the status is one of the following:

  • actionRequired
  • reviewing

Required Permissions

writeWithdrawals

Request Parameters (Query)

coinWithdrawalId number Mandatory

withdrawal ID (responsed by POST /v2/coin/withdrawal)

Example

1234

Error Code

Common Errors +
  • WITHDRAWAL_ALREADY_FINISHED: The withdrawal has already been finished
  • CANNOT_CANCEL_WITHDRAWAL: The withdrawal cannot be canceled (likely because it's being processed)
  • NOT_FOUND: The withdrawal cannot be found

Request

curl -X DELETE -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/withdrawal?coinWithdrawalId=1234&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true
}

Get Recent Withdrawals

GET/v2/coin/recentWithdrawals

Get recent cryptocurrency withdrawal history.

Required Permissions

readWithdrawals

Request Parameters (Query)

currency string Mandatory

symbol of the asset

Example

btc

limit number Mandatory

Maximum number of queries (Range: 1 to 100)

Example

100

Response (Array)

id number Mandatory

withdrawal ID

Example

1234

quantity string Mandatory

withdrawn coin quantity excluding fees.

Example

1.234

fee string Mandatory

withdrawal fee

Example

0.0001

currency string Mandatory

symbol of the asset

Example

btc

status string Mandatory

Withdrawal status

  • pending Withdrawal request received.
  • actionRequired Pending email confirmation (withdrawal can be canceled). To proceed with the withdrawal, you must verify the confirmation email.
  • reviewing Pending withdrawal reviewing (withdrawal can be canceled). Withdrawal may be delayed according to Korbit's policy.
  • processing Withdrawal processing.
  • done Withdrawal done.
  • canceled Withdrawal canceled.
  • failed Withdrawal failed. (Insufficient balance or other error)
Example

done

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

withdrawal address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

transactionHash string

transaction hash on the blockchain. If not yet sent to the blockchain, null is returned.

Example

0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

createdAt number Mandatory

withdrawal request timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/recentWithdrawals?currency=btc&limit=100&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "id": 1234,
      "quantity": "1.234",
      "fee": "0.0001",
      "currency": "btc",
      "status": "done",
      "network": "BTC",
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      "secondaryAddress": null,
      "transactionHash": "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
      "createdAt": 1700000000000
    }
  ]
}

Get Withdrawal Status

GET/v2/coin/withdrawal

Get the status of the requested withdrawal.

Required Permissions

readWithdrawals

Request Parameters (Query)

currency string Mandatory

symbol of the asset

Example

btc

coinWithdrawalId number Mandatory

withdrawal ID

Example

1234

Response

id number Mandatory

withdrawal ID

Example

1234

quantity string Mandatory

withdrawn coin quantity excluding fees.

Example

1.234

fee string Mandatory

withdrawal fee

Example

0.0001

currency string Mandatory

symbol of the asset

Example

btc

status string Mandatory

Withdrawal status

  • pending Withdrawal request received.
  • actionRequired Pending email confirmation (withdrawal can be canceled). To proceed with the withdrawal, you must verify the confirmation email.
  • reviewing Pending withdrawal reviewing (withdrawal can be canceled). Withdrawal may be delayed according to Korbit's policy.
  • processing Withdrawal processing.
  • done Withdrawal done.
  • canceled Withdrawal canceled.
  • failed Withdrawal failed. (Insufficient balance or other error)
Example

done

network string Mandatory

symbol of the blockchain network

Example

ETH

address string Mandatory

withdrawal address

Example

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

secondaryAddress string

secondary address (destination tag, memo, etc. if none, then null.)

transactionHash string

transaction hash on the blockchain. If not yet sent to the blockchain, null is returned.

Example

0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

createdAt number Mandatory

withdrawal request timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/coin/withdrawal?coinWithdrawalId=1234&currency=btc&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": {
    "id": 1234,
    "quantity": "1.234",
    "fee": "0.0001",
    "currency": "btc",
    "status": "done",
    "network": "BTC",
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "secondaryAddress": null,
    "transactionHash": "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "createdAt": 1700000000000
  }
}

Request Deposit

POST/v2/krw/sendKrwDepositPush

Send a notification for KRW deposit requests to your Korbit mobile app.
After receiving the notification, you must complete the verification process for the deposit to proceed.
To receive notifications, ensure that push notifications are enabled in the app settings.

Required Permissions

writeDeposits

Request Parameters (POST)

amount string Mandatory

Amount of KRW to deposit

Example

50000

Request

curl -X POST -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/krw/sendKrwDepositPush' -H Content-Type: application/x-www-form-urlencoded --data-raw 'amount=50000&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{"success":true}

Request Withdrawal

POST/v2/krw/sendKrwWithdrawalPush

Send a notification for KRW withdrawal requests to your Korbit mobile app.
After receiving the notification, you must complete the verification process for the withdrawal to proceed.
To receive notifications, ensure that push notifications are enabled in the app settings.

Required Permissions

writeWithdrawals

Request Parameters (POST)

amount string Mandatory

Amount of KRW to withdraw

Example

50000

Request

curl -X POST -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/krw/sendKrwWithdrawalPush' -H Content-Type: application/x-www-form-urlencoded --data-raw 'amount=50000&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{"success":true}

Get Recent Deposits

GET/v2/krw/recentDeposits

Get recent KRW deposit history.

Required Permissions

readDeposits

Request Parameters (Query)

limit number Mandatory

Maximum number of queries (range: 1 to 100).

Example

100

includeAll string

Retrieve all transaction history.

  • false Only regular KRW deposits (default)
  • true Includes additional items such as deposit fees, event rewards, etc.

Response (Array)

id number Mandatory

KRW deposit ID

Example

1234

type string

Deposit type (when includeAll=true)

  • general Regular KRW deposit
  • depositInterest Deposit fee
  • makerIncentive Maker incentive
  • reward Event reward
  • etc Other
Example

depositInterest

status string Mandatory

KRW deposit status

  • pending Deposit request received.
  • processing Processing deposit.
  • reviewing Reviewing deposit.
  • done Deposit done.
  • canceling Deposit cancel requested.
  • canceled Deposit canceled.
  • failed Deposit failed.
Example

done

quantity string Mandatory

deposit quantity

Example

1.234

createdAt number Mandatory

deposit timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/krw/recentDeposits?limit=100&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "id": 1234,
      "status": "done",
      "quantity": "50000",
      "createdAt": 1700000000000
    }
  ]
}

Get Recent Withdrawals

GET/v2/krw/recentWithdrawals

Get recent KRW withdrawal history.

Required Permissions

readWithdrawals

Request Parameters (Query)

limit number Mandatory

Maximum number of queries (Range: 1 to 100)

Example

100

Response (Array)

id number Mandatory

KRW withdrawal ID

Example

1234

quantity string Mandatory

Withdrawn KRW quantity excluding fees.

Example

50000

fee string Mandatory

withdrawal fee

Example

1000

status string Mandatory

KRW withdrawal status

  • processing Processing withdrawal.
  • done Withdrawal done.
  • failed Withdrawal failed.
  • canceled Withdrawal canceled.
Example

done

createdAt number Mandatory

withdrawal request timestamp (ms)

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/krw/recentWithdrawals?limit=100&timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "id": 1234,
      "quantity": "50000",
      "fee": "1000",
      "status": "done",
      "createdAt": 1700000000000
    }
  ]
}

Get Crypto Info

GET/v2/currencies

Get cryptocurrencies information.

Response (Array)

name string Mandatory

currency symbol

Example

btc

fullName string Mandatory

currency name

Example

Bitcoin

withdrawalStatus string

(deprecated) withdrawal status. Please refer to withdrawalStatus under the networkList field.

depositStatus string

(deprecated) deposit status. Please refer to depositStatus under the networkList field.

confirmationCount string

(deprecated) number of confirmations required for deposits. Please refer to confirmationCount under the networkList field.

withdrawalTxFee string

(deprecated) withdrawal fees. Please refer to withdrawalTxFee under the networkList field.

withdrawalMinAmount string

minimum withdrawal amount. Please refer to withdrawalMinAmount under the networkList field.

withdrawalMaxAmountPerRequest string Mandatory

max withdrawal amount per each request

Example

10

defaultNetwork string

symbol for the default blockchain network

Example

BTC

networkList array of object Mandatory

list of supported blockchain networks

name string Mandatory

network symbol

Example

ETH

fullName string Mandatory

network name

Example

Ethereum

withdrawalStatus string Mandatory

possible to withdraw:

  • launched yes
  • stopped no
Example

launched

depositStatus string Mandatory

possible to deposit:

  • launched yes
  • stopped no
Example

launched

confirmationCount string Mandatory

number of confirmations required for deposits

Example

3

withdrawalTxFee string Mandatory

withdrawal fees

Example

0.0001

withdrawalMinAmount string Mandatory

minimum withdrawal amount

Example

0.00000001

withdrawalPrecision number Mandatory

decimal places for withdrawal quantity

Example

8

hasSecondaryAddr boolean Mandatory

Whether the network has an secondary address

contractAddress string

contract address

Example

0x6b3595068778dd592e39a122f4f5a5cf09c90fe2

addressExplorerUrl string

블록체인 탐색기 주소

Example

https://etherscan.io/address/

요청

curl 'https://api.korbit.co.kr/v2/currencies'

응답

{
    "success": true,
    "data": [
        {
            "name": "krw",
            "fullName": "Won",
            "withdrawalMaxAmountPerRequest": "5000000000",
            "depositStatus": "launched",
            "withdrawalStatus": "launched",
            "withdrawalTxFee": "1000",
            "withdrawalMinAmount": "1000"
        },
        {
            "name": "btc",
            "fullName": "Bitcoin",
            "withdrawalMaxAmountPerRequest": "120",
            "defaultNetwork": "BTC",
            "networkList": [
                {
                    "name": "BTC",
                    "fullName": "Bitcoin",
                    "depositStatus": "launched",
                    "withdrawalStatus": "launched",
                    "confirmationCount": 3,
                    "withdrawalTxFee": "0.0008",
                    "withdrawalMinAmount": "0.0001",
                    "hasSecondaryAddr": false,
                    "addressExplorerUrl": "https://www.blockchain.com/ko/btc/address/"
                }
            ],
            "depositStatus": "launched",
            "withdrawalStatus": "launched",
            "confirmationCount": "3",
            "withdrawalTxFee": "0.0008",
            "withdrawalMinAmount": "0.0001"
        },
        {
            "name": "eth",
            "fullName": "Ethereum",
            "withdrawalMaxAmountPerRequest": "2000",
            "defaultNetwork": "ETH",
            "networkList": [
                {
                    "name": "ETH",
                    "fullName": "Ethereum",
                    "depositStatus": "launched",
                    "withdrawalStatus": "launched",
                    "confirmationCount": 45,
                    "withdrawalTxFee": "0.005",
                    "withdrawalMinAmount": "0.0001",
                    "hasSecondaryAddr": false,
                    "addressExplorerUrl": "https://etherscan.io/address/"
                },
                {
                    "name": "BASE",
                    "fullName": "BASE",
                    "depositStatus": "launched",
                    "withdrawalStatus": "launched",
                    "confirmationCount": 1,
                    "withdrawalTxFee": "0.001",
                    "withdrawalMinAmount": "0.0001",
                    "hasSecondaryAddr": false,
                    "addressExplorerUrl": "https://basescan.org/address/"
                }
            ],
            "depositStatus": "launched",
            "withdrawalStatus": "launched",
            "confirmationCount": "45",
            "withdrawalTxFee": "0.005",
            "withdrawalMinAmount": "0.0001"
        },
        {
            "name": "usdt",
            "fullName": "Tether",
            "withdrawalMaxAmountPerRequest": "500000",
            "defaultNetwork": "TRX",
            "networkList": [
                {
                    "name": "TRX",
                    "fullName": "Tron",
                    "depositStatus": "launched",
                    "withdrawalStatus": "launched",
                    "confirmationCount": 1,
                    "withdrawalTxFee": "1",
                    "withdrawalMinAmount": "1",
                    "hasSecondaryAddr": false,
                    "addressExplorerUrl": "https://tronscan.org/#/address/"
                }
            ],
            "depositStatus": "launched",
            "withdrawalStatus": "launched",
            "confirmationCount": "1",
            "withdrawalTxFee": "1",
            "withdrawalMinAmount": "1"
        }
    ]
}

Get Server Time

GET/v2/time

Get the current server time.

Response

time number Mandatory

timestamp

Example

1700000000000

Request

curl 'https://api.korbit.co.kr/v2/time'

Response

{
  "success": true,
  "data": {
    "time": 1700000000000
  }
}

Get Trading Fee Rates

GET/v2/tradingFeePolicy

Get the trading fee rates applied to your account.

Request Parameters (Query)

symbol string

Enter the symbols of the trading pairs to query. To input multiple trading pairs, separate them with commas(,). If omitted, information for all available trading pairs on Korbit will be returned.

Example

btc_krw,eth_krw

Response (Array)

symbol string Mandatory

Trading pair symbol

Example

btc_krw

buyFeeCurrency string Mandatory

Fee currency for buy orders

Example

btc

sellFeeCurrency string Mandatory

Fee currency for sell orders

Example

krw

maxFeeRate string Mandatory

Maximum fee rate. For buy orders of trading pairs where buyFeeCurrency is krw, an additional amount of KRW equal to quantity*price*maxFeeRate will be required (converted to the amount in use). Once the order is executed, it will be settled according to the fee rate at the time of execution.

Example

0.0015

takerFeeRate string Mandatory

Taker fee rate

Example

0.0007

makerFeeRate string Mandatory

Maker fee rate

Example

0.0003

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/tradingFeePolicy?timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": [
    {
      "symbol": "btc_krw",
      "buyFeeCurrency": "btc",
      "sellFeeCurrency": "krw",
      "maxFeeRate": "0.0015",
      "takerFeeRate": "0.0015",
      "makerFeeRate": "0"
    },
    {
      "symbol": "eth_krw",
      "buyFeeCurrency": "eth",
      "sellFeeCurrency": "krw",
      "maxFeeRate": "0.0015",
      "takerFeeRate": "0.0015",
      "makerFeeRate": "0"
    },
    {
      "symbol": "etc_krw",
      "buyFeeCurrency": "krw",
      "sellFeeCurrency": "krw",
      "maxFeeRate": "0.0015",
      "takerFeeRate": "0.0015",
      "makerFeeRate": "0"
    },
    {
      "symbol": "xrp_krw",
      "buyFeeCurrency": "krw",
      "sellFeeCurrency": "krw",
      "maxFeeRate": "0.0015",
      "takerFeeRate": "0.0015",
      "makerFeeRate": "0"
    }
  ]
}

Get API Key Info

GET/v2/currentKeyInfo

Get current API Key's information.

Required Permissions

None

Response

apiKey string Mandatory

API Key ID

Example

FFSoRME97Sr7WBCMZJ_NO5Bj8MZ03EyArRzqyr1NKIA

type string Mandatory

Key Type

  • hmac-sha256
  • ed25519
Example

hmac-sha256

publicKey string

ED25519 public key. (only for ED25519 type.)

Example

-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAk+Yp3C31eFwoky+zyRNB6rAv/lgULTeghxTQpqwQHzM=
-----END PUBLIC KEY-----

permissions array of strings Mandatory
  • readBalances
  • readOrders
  • writeOrders
  • readDeposits
  • writeDeposits
  • readWithdrawals
  • writeWithdrawals
Example

["readBalances", "readOrders"]

whitelist string Mandatory

IP Address Whitelist

Example

1.2.3.4,5.6.7.8

expiration number Mandatory

API key expiration timestamp (scheduled).

Example

1700000000000

status string Mandatory

status of the key

  • activated
  • deactivated
Example

activated

label string

label (custom name)

Example

test key

createdAt number Mandatory

API key creation timestamp

Example

1700000000000

Request

curl -H X-KAPI-KEY=APIKEY 'https://api.korbit.co.kr/v2/currentKeyInfo?timestamp=TIMESTAMP&signature=SIGNATURE'

Response

{
  "success": true,
  "data": {
    "apiKey": "FFSoRME97Sr7WBCMZJ_NO5Bj8MZ03EyArRzqyr1NKIA",
    "type": "ed25519",
    "publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAk+Yp3C31eFwoky+zyRNB6rAv/lgULTeghxTQpqwQHzM=\n-----END PUBLIC KEY-----\n",
    "permissions": ["readBalances", "readOrders"],
    "expiration": 1700000000000,
    "status": "activated",
    "label": "test key",
    "createdAt": 1700000000000
  }
}

WebSocket API

Open a Connection

The WebSocket API is a WebSocket connection interface designed for bidirectional communication between the Korbit server and user clients. Using the WebSocket API allows you to receive real-time information from the Korbit cryptocurrency exchange at the fastest possible speed.

With the REST API, users must send an HTTP request to receive a response and retrieve information. However, with the WebSocket API, a persistent, bidirectional connection is maintained between the Korbit server and user client. As a result, when events such as price changes or order executions occur, information is continuously delivered from the Korbit server to the user client in real-time. Therefore, if you aim to receive real-time information on prices, orders, and trades quickly and conveniently, we recommend using the WebSocket API over the REST API.

Data provided by the WebSocket API is classified into Public and Private types, depending on whether it is public information or specific to individual users. Public type data can be received without any authentication. However, to receive Private type data, authentication with Korbit Open API keys is required when establishing the WebSocket connection.

For Public type data, sending a subscription request via WebSocket immediately provides the latest data at the time of the request as snapshot data. (Snapshot data is not real-time.) All non-snapshot data is real-time.

Quotation: Public Type


  • Get Tickers ticker : Provides snapshots and real-time current prices for a specified trading pair.
  • Get Orderbook orderbook : Provides snapshots and real-time order book data for a specified trading pair.
  • Get Trades trade : Provides snapshots and real-time trade history for a specified trading pair.

Trade: Private Type


  • My Orders myOrder : Provides real-time status updates on your orders.
  • My Trades myTrade : Provides real-time execution updates on your trades.

Base URL

wss://ws-api.korbit.co.kr/v2/ws

Authentication

Public type data (Ticker, Orderbook, Trade) can be received simply by connecting to the WebSocket and sending a subscription message, without any authentication. However, to receive Private type data (My Order, My Trade), authentication using Korbit Open API keys is required upon establishing the WebSocket connection.

For authentication, as with the REST API, you need to send a request with an X-KAPI-KEY header and a signature generated using either HMAC-SHA256 or ED25519 during the WebSocket connection. Specifically, include the X-KAPI-KEY in the request header, and add timestamp and signature information to the URL query string.

Please refer to the Sign API Requests section and the attached example code for more details.

HMAC-SHA256 Signature Example (Node.js)

// Node.js, npm i ws
import crypto from "crypto";
import WebSocket from "ws";

const apiKey = "XyAZ_apaUv9pg4ZyGzNHTxabfIDrWIRpPBgk5-olIuM"; // API Key
const apiSecret = "ZwKS2evdxj9j3Neir2s0UHAmpNFfo4a0iHawEElGCBs"; // HMAC-SHA256 Secret Key

const wsUrl = "wss://ws-api.korbit.co.kr/v2/ws"; // Base URL

// HMAC-SHA256 Signature
const createHmacSignature = (query) => {
  return crypto.createHmac("sha256", apiSecret).update(query, "utf-8").digest("hex");
};

const timestamp = Date.now(); // Timestamp (ms)

const params = new URLSearchParams({
  timestamp: timestamp,
});

const signature = createHmacSignature(params.toString());

// Add Signature to params
params.append("signature", signature);

// Add API Key to the header, Open a WebSocket connection
const ws = new WebSocket(`${wsUrl}?${params.toString()}`, [], {
  headers: {
    "X-KAPI-KEY": apiKey,
  }
});

ws.on("open", () => {
  console.log("connected!");
  // Send messages to subscribe
  ws.send(`[{"method":"subscribe","type":"ticker","symbols":["btc_krw","eth_krw"]}]`);
  ws.send(`[{"method":"subscribe","type":"myOrder","symbols":["btc_krw","eth_krw"]},{"method":"subscribe","type":"myTrade","symbols":["btc_krw","eth_krw"]}]`);
});

ws.on("error", (error) => {
  console.error(error);
});

ws.on("message", (event) => {
  const message = JSON.parse(event);
  console.log(message);
});

ws.on("close", () => {
  console.log("connection closed!");
});

Send Requests

After the WebSocket connection is established, you must send a request indicating which type of data you wish to subscribe to. In the WebSocket API, subscription request messages are sent in JSON format, with method, type, and symbols specified accordingly.

Since multiple messages can be included at once, even when sending a single request message, it must be enclosed in square brackets []. (Please note that case sensitivity applies.)

[{"method":"subscribe","type":"ticker","symbols":["btc_krw","eth_krw"]}]
[{"method":"subscribe","type":"ticker","symbols":["btc_krw","eth_krw"]},[{"method":"subscribe","type":"orderbook","symbols":["btc_krw","eth_krw"]}]]
# Using wscat in a Node.js environment
$ npm install -g wscat
$ wscat -c wss://ws-api.korbit.co.kr/v2
connected (press CTRL+C to quit)

# Once the WebSocket connection is established, send a data subscription request
> [{"method":"subscribe","type":"ticker","symbols":["btc_krw","eth_krw"]}]
< {"symbol":"btc_krw","timestamp":1730365099072,"type":"ticker","snapshot":true,"data":{"open":"100500000","high":"100651000","low":"100492000","close":"100650000","prevClose":"100497000","priceChange":"153000","priceChangePercent":"0.15","volume":"0.89102242","quoteVolume":"89632429.21566","bestAskPrice":"100651000","bestBidPrice":"100650000","lastTradedAt":1730356819663}}
< {"symbol":"eth_krw","timestamp":1730365099072,"type":"ticker","snapshot":true,"data":{"open":"4390000","high":"4390000","low":"4357000","close":"4357000","prevClose":"4456000","priceChange":"-99000","priceChangePercent":"-2.22","volume":"0.1702132","quoteVolume":"744416.83456","bestAskPrice":"4357000","bestBidPrice":"4324000","lastTradedAt":1730361789775}}
< {"symbol":"btc_krw","timestamp":1730365220489,"type":"ticker","data":{"open":"100501000","high":"100651000","low":"100501000","close":"100650000","prevClose":"100492000","priceChange":"158000","priceChangePercent":"0.16","volume":"0.81866504","quoteVolume":"82360867.25161","bestAskPrice":"100651000","bestBidPrice":"100650000","lastTradedAt":1730356819663}}

In the example, a subscription request is sent to receive current price (ticker) information for the Bitcoin (btc_krw) and Ethereum (eth_krw) trading pairs. First, snapshot data is received, followed by a continuous stream of real-time data. If you want to receive information for multiple trading pairs, enclose the pairs in square brackets [] and separate them with commas ,, as shown in the example above.

To subscribe, set method to subscribe; to stop receiving a specific type of data, set method to unsubscribe to cancel the subscription.

Refer below for example subscription request and response messages for each type.

Ticker

Streams latest pricing information for a symbol.

Request Parameters

method string Mandatory

Set to subscribe or unsubscribe

type string Mandatory

Set to ticker

symbols array of strings Mandatory

Enter the symbols of the trading pairs you want to query.

Example

["btc_krw","eth_krw"]

Response

type string Mandatory

Fixed value ticker

timestamp number Mandatory

Server time (unix timestamp, in milliseconds)

Example

1700000000000

symbol string Mandatory

Trading pair symbol

Example

btc_krw

snapshot boolean

Whether the data is a snapshot or a real-time data.
true - The data is a latest snapshot and not a real-time data. Sent as the first message on subscription.
false or null - The data is from a real-time trade.

data object Mandatory
open string Mandatory

Open price (24H)

Example

361922.23

high string Mandatory

High price (24H)

Example

361922.23

low string Mandatory

Low price (24H)

Example

361922.23

close string Mandatory

Last price (24H)

Example

361922.23

prevClose string Mandatory

Previous close price (24H)

Example

261922.23

priceChange string Mandatory

changed price. prevClose - close

Example

261922.23

priceChangePercent string Mandatory

changed price percent. 100 * (prevClose - close) / prevClose

Example

10

volume string Mandatory

Trading volume (Base, 24H)

Example

100

quoteVolume string Mandatory

Trading volume (Quote/Counter, 24H)

Example

1000000000

bestBidPrice string Mandatory

Best bid price

Example

5000

bestAskPrice string Mandatory

Best ask price

Example

6000

lastTradedAt number Mandatory

Last traded timestamp (unix timestamp, in milliseconds)

Example

1700000000000

Request

[{"method":"subscribe","type":"ticker","symbols":["btc_krw","eth_krw"]}]

Response

{
  "type": "ticker",
  "timestamp": 1700000027754,
  "symbol": "btc_krw",
  "snapshot": true,
  "data": {
    "open": "94679000",
    "high": "111162000",
    "low": "93861000",
    "close": "99027000",
    "prevClose": "94679000",
    "priceChange": "4348000",
    "priceChangePercent": "4.59",
    "volume": "147.94385655",
    "quoteVolume": "14311735005.18033",
    "bestAskPrice": "99027000",
    "bestBidPrice": "99026000",
    "lastTradedAt": 1700000010022
  }
}

Orderbook

Streams orderbook data for a symbol. Up to 30 prices are available for each side.

Request Parameters

method string Mandatory

Set to subscribe or unsubscribe

type string Mandatory

Set to orderbook

symbols array of strings Mandatory

Enter the symbols of the trading pairs you want to query.

Example

["btc_krw","eth_krw"]

Response

type string Mandatory

Fixed value orderbook

timestamp number Mandatory

Server time (unix timestamp, in milliseconds)

Example

1700000000000

symbol string Mandatory

Trading pair symbol

Example

btc_krw

snapshot boolean

Whether the data is a snapshot or a real-time data.
true - The data is a latest snapshot and not a real-time data. Sent as the first message on subscription.
false or null - The data is from a real-time trade.

data object Mandatory
timestamp number Mandatory

Timestamp of the orderbook data (unix timestamp, in milliseconds)

Example

1700000000000

bids array of object Mandatory

bids

price string Mandatory

price

Example

250000

qty string Mandatory

quantity

Example

10

asks array of object Mandatory

asks

price string Mandatory

price

Example

250000

qty string Mandatory

quantity

Example

10

Request

[{"method":"subscribe","type":"orderbook","symbols":["btc_krw"]}]

Response

{
  "type": "orderbook",
  "timestamp": 1700000006177,
  "symbol": "btc_krw",
  "snapshot": true,
  "data": {
    "timestamp": 1700000000234,
    "asks": [
      {
        "price": "99131000",
        "qty": "0.00456677"
      },
      {
        "price": "99132000",
        "qty": "0.00616665"
      },
      {
        "price": "99133000",
        "qty": "0.00808569"
      }
    ],
    "bids": [
      {
        "price": "99120000",
        "qty": "0.00363422"
      },
      {
        "price": "99119000",
        "qty": "0.00475577"
      },
      {
        "price": "99118000",
        "qty": "0.00389054"
      }
    ]
  }
}

Trade

Streams real-time trades.

Request Parameters

method string Mandatory

Set to subscribe or unsubscribe

type string Mandatory

Set to trade

symbols array of strings Mandatory

Enter the symbols of the trading pairs you want to query.

Example

["btc_krw","eth_krw"]

Response

type string Mandatory

Fixed value trade

timestamp number Mandatory

Server time (unix timestamp, in milliseconds)

Example

1700000000000

symbol string Mandatory

Trading pair symbol

Example

btc_krw

snapshot boolean

Whether the data is a snapshot or a real-time data.
true - The data is a latest snapshot and not a real-time data. Sent as the first message on subscription.
false or null - The data is from a real-time trade.

data array of object Mandatory
timestamp number Mandatory

Time of the trade (unix timestamp, in milliseconds)

Example

1700000000000

price string Mandatory

trade price

Example

250000

qty string Mandatory

trade quantity

Example

10

isBuyerTaker boolean Mandatory

whether the taker is the buyer.

Example

true

tradeId number Mandatory

trade ID (unique for each currency pair)

Example

1234

Request

[{"method":"subscribe","type":"trade","symbols":["btc_krw"]}]

Response

{
  "symbol": "btc_krw",
  "timestamp": 1700000005498,
  "type": "trade",
  "snapshot": true,
  "data": [
    {
      "timestamp": 1700000001239,
      "price": "98909000",
      "qty": "0.00146702",
      "isBuyerTaker": true,
      "tradeId": 123456
    }
  ]
}

My Order

Streams the changes in my orders.

Required Permissions

readOrders

Request Parameters

method string Mandatory

Set to subscribe or unsubscribe

type string Mandatory

Set to myOrder

symbols array of strings Mandatory

Enter the symbols of the trading pairs you want to query.

Example

["btc_krw","eth_krw"]

Response

type string Mandatory

Fixed value myOrder

timestamp number Mandatory

Server time (unix timestamp, in milliseconds)

Example

1700000000000

symbol string Mandatory

Trading pair symbol

Example

btc_krw

snapshot boolean

Whether the data is a snapshot or a real-time data.
true - The data is a latest snapshot and not a real-time data. Sent as the first message on subscription.
false or null - The data is from a real-time trade.

data array of object Mandatory
orderId number Mandatory

order ID

Example

1234

status string Mandatory

Order status

  • pending Order pending. If the balance is insufficient, the order may fail and change to the expired status.
  • open Fully unfilled
  • filled Fully executed
  • canceled Fully canceled
  • partiallyFilled Partially filled
  • partiallyFilledCanceled Partially filled and remaining amount canceled
  • expired Order submission failed
Example

partiallyFilled

side string Mandatory
  • buy
  • sell
Example

buy

price string

Order price (limit order only. no price for market order.)

Example

5000

openQty string Mandatory

open quantity

Example

10

filledQty string Mandatory

filled quantity

Example

10

Request

[{"method":"subscribe","type":"myOrder","symbols":["btc_krw"]}]

Response

{
  "symbol": "btc_krw",
  "timestamp": 1700000000000,
  "type": "myOrder",
  "data": [
    {
      "orderId": 123456,
      "status": "partiallyFilled",
      "side": "buy",
      "price": "99017000",
      "openQty": "0.00206864",
      "filledQty": "0.53793136",
    }
  ]
}

My Trade

Streams trades on my orders.

Required Permissions

readOrders

Request Parameters

method string Mandatory

Set to subscribe or unsubscribe

type string Mandatory

Set to myTrades

symbols array of strings Mandatory

Enter the symbols of the trading pairs you want to query.

Example

["btc_krw","eth_krw"]

Response

type string Mandatory

Fixed value myTrades

timestamp number Mandatory

Server time (unix timestamp, in milliseconds)

Example

1700000000000

symbol string Mandatory

Trading pair symbol

Example

btc_krw

snapshot boolean

Whether the data is a snapshot or a real-time data.
true - The data is a latest snapshot and not a real-time data. Sent as the first message on subscription.
false or null - The data is from a real-time trade.

data array of object Mandatory
tradeId number Mandatory

trade ID

Example

1234

orderId number Mandatory

order ID

Example

1234

side string Mandatory
  • buy
  • sell
Example

buy

price string Mandatory

price

Example

5000

qty string Mandatory

quantity

Example

10

isTaker boolean Mandatory

taker=true, maker=false

Example

true

Request

[{"method":"subscribe","type":"myTrade","symbols":["btc_krw"]}]

Response

{
  "symbol": "btc_krw",
  "timestamp": 1700000000000,
  "type": "myTrade",
  "data": [
    {
      "tradeId": 123456,
      "orderId": 456789,
      "side": "buy",
      "price": "99051000",
      "qty": "0.0013",
      "isTaker": true
    }
  ]
}