NAV Navbar
cURL

Introduction

GDAC aims to bring about innovation in Finance using Blockchain Technology.

In order to create synergy with our partners, we offer partners exclusive API access that gives programmatic control over:

Revision History

Version Date (dd/mm/yyyy) Changes
0.1 02/02/2019 Initial Commit
0.2 13/02/2019 Update authentication method with api key, secret key
0.3 28/02/2019 Update API docs - Market Data, Account, Order, Trade
0.4 05/03/2019 Order Price Unit: it depends on the order price rather than current price
List Open Orders: added Status parameter
Ticker: removed Ask, Bid from response
Cancel Order: remove pair from request parameter
API endpoint: Version prefix of all API endpoints changed to v0.4

General

Rate Limit

In order to provide a stable API service, requests that exceed the rate limit within a short period of time are not allowed. Partner API users can make up to 200 requests per minute.

When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.

Datetime Format

All timestamps are returned in ISO 8601 format(UTC). Example: "2019-02-26T14:57:04Z"

Endpoint URL

Environment Base URL
production https://partner.gdac.com

Request URL needs to be determined by Base and specific endpoint combination.

Error

{
  "code": "ERROR CODE"
}

Any endpoint can return an ERROR

Order Price Unit

The order price should be a multiple of the order price unit. The order price unit depends on the price at which you want to order.

<= Order Price Order Price < Order Price Unit
0 0.00001 0.00000001
0.00001 0.00005 0.00000005
0.00005 0.0001 0.0000001
0.0001 0.0005 0.0000005
0.0005 0.001 0.000001
0.001 0.005 0.000005
0.005 0.01 0.00001
0.01 0.05 0.00005
0.05 0.1 0.0001
0.1 0.5 0.0005
0.5 1 0.001
1 5 0.01
5 100 0.1
100 500 0.5
500 1000 1
1000 5000 5
5000 10000 10
10000 50000 50
50000 100000 100
100000 500000 500
500000 1000

Authentication

All API calls require an authentication token in the header.

Creating an authentication token

The authentication token follows JWT format and HS256 is recommended for signing.

JWT Payload Format

{
  "api_key": "api:ak:{API Key}",
  "nonce": "current timestamp in ISO 8601 format"
}

Payload contains api key and nonce. api_key should begin with the prefix "api:ak:". nonce should not differ by more than 10 seconds from the current time on the server.

Creating a JWT Signature

const jwt = require("jsonwebtoken");

const payload = {
  api_key: "THIS_IS_API_KEY",
  nonce: "2019-02-13T08:10:13Z"
};

const jwtToken = jwt.sign(payload, "THIS_IS_SECRET_KEY");

Create a JWT Signature using the payload and secret key.

Creating a request with an authentication token

Authorization: Bearer "JWT Token"

When making a new request, you must insert a JWT Token into your Request Header.

api_key and secret_key Issuance method

We will provide an access_token to each partner company.

HTTP GET Example in Python with API Key

#!/usr/bin/env python3.6
import datetime
import requests
import logging
import jwt


logging.basicConfig(level=logging.DEBUG)


if __name__ == '__main__':
    API_KEY = 'API_KEY'
    SECRET = 'SECRET'

    payload = {
        'api_key': "api:ak:" + API_KEY,
        'nonce': datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
    }

    jwtToken = jwt.encode(payload, SECRET, 'HS256')
    headers = {'Authorization': 'Bearer '+jwtToken.decode('utf-8')}
    r = requests.get("https://partner.gdac.com/v0.4/balance", headers=headers)

    print('Request')
    print(r.request.headers)
    print('Response')
    print(r.status_code)
    print(r.headers)
    print(r.content)

Market Data

Pairs

Request URI

curl https://partner.gdac.com/v0.4/public/pairs

Response Body

[
  {
    "pair": "BTC/KRW",
    "base_currency": "KRW",
    "quote_currency": "BTC",
    "quote_order_unit": "0.00010000",
    "fee_rate_taker": "0.001",
    "fee_rate_maker": "0.001"
  },
  {
    "pair": "ETH/KRW",
    "base_currency": "KRW",
    "quote_currency": "ETH",
    "quote_order_unit": "0.00010000",
    "fee_rate_taker": "0.001",
    "fee_rate_maker": "0.001"
  }
]

Get a list of available currency pairs for trading.

HTTP Request

GET /v0.4/public/pairs

Request Param

N/A

Response Body

Field Name Type Description
array Array of currency pairs
pair string Pair identifier
base_currency string Name of base currency
quote_currency string Name of quote currency
quote_order_unit string Minimum order unit for quote; order quantity should be a multiple of this unit.
fee_rate_taker string fee rate for taker
fee_rate_maker string fee rate for maker

Please refer to Order Price Unit to get the minimum order price.

Ticker

Request URI

curl https://partner.gdac.com/v0.4/public/tickers/BTC%2FKRW

Response Body

{
  "pair": "BTC/KRW",
  "last": "4251000",
  "open": "4213000",
  "low": "4202000",
  "high": "4271000",
  "volume": "247.52648136",
  "dtime": "2019-03-01T11:00:00Z"
}

Get market ticker for a trading pair.

HTTP Request

GET /v0.4/public/tickers/{pair}

Request Param

Parameter Name Required Description Example
pair Y Pair identifier BTC/KRW

Response Body

Field Name Type Description
pair string Pair identifier
last string Last trade price
open string Last trade price 24 hours ago
low string Lowest trade price for 24 hours
high string Highest trade price for 24 hours
volume string Total trade volume for 24 hours
dtime string Ticker timestamp

Tickers

Request URI

curl https://partner.gdac.com/v0.4/public/tickers

Response Body

[
  {
    "pair": "BTC/KRW",
    "last": "4251000",
    "open": "4213000",
    "low": "4202000",
    "high": "4271000",
    "volume": "247.52648136",
    "dtime": "2007-03-01T11:00:00Z"
  },
  {
    "pair": "ETH/KRW",
    "last": "4720",
    "open": "4705",
    "low": "4505",
    "high": "4720",
    "volume": "25351.20553302",
    "dtime": "2007-03-01T11:00:00Z"
  }
]

Get market ticker for all trading pairs.

HTTP Request

GET /v0.4/public/tickers

Response Body

Returns an array of ticker response.

Trades

Request URI

curl https://partner.gdac.com/v0.4/public/trades?pair=BTC%2FKRW&offset=2019-02-28T01%3A12%3A31Z&limit=100

Response Body

[
  {
    "pair": "BTC/KRW",
    "side": "S",
    "price": "4252000.00000000",
    "quantity": "3.51234406",
    "trade_dtime": "2019-02-27T06:29:56Z"
  },
  {
    "pair": "BTC/KRW",
    "side": "S",
    "price": "4251000.00000000",
    "quantity": "1.93214406",
    "trade_dtime": "2019-02-27T06:29:54Z"
  }
]

Get the latest trades for a trading pair. The trade list is returned in descending order.

HTTP Request

GET /v0.4/public/trades

Request Param

Parameter Name Required Description Example
pair Y Pair identifier BTC/KRW
offset N Timestamp in datetime format. If assigned, a list of trades older than offset is returned 2019-02-28T01:12:31Z
limit N default: 50 50

Response Body

Field Name Type Description
array Array of latest trades
pair string Pair identifier
side string Trade side; S: Sell, B: Buy
price string Trade price
quantity string Trade quantity
trade_dtime string Trade timestamp

Orderbook

Request URI

curl https://partner.gdac.com/v0.4/public/orderbook?pair=BTC%2FKRW

Response Body

{
  "ask": [
    {
      "price": "4372000",
      "volume": "0.18566022"
    },
    {
      "price": "4373000",
      "volume": "0.01586508"
    }
  ],
  "bid": [
    {
      "price": "4233000",
      "volume": "0.00800000"
    },
    {
      "price": "4227000",
      "volume": "19.62506668"
    }
  ]
}

Get a list of open orders for a trading pair. It returns the 50 best bid/asks

HTTP Request

GET /v0.4/public/orderbook

Request Param

Parameter Name Required Description
pair Y Pair identifier

Response Body

Field Name Type Description
ask array Sell side array of price levels
bid array Buy side array of price levels
price string Price level
volume string Total volume of orders at specified price level

Currencies

Request URI

curl https://partner.gdac.com/v0.4/public/currencies

Response Body

[
  {
    "currency": "BTC",
    "name": "Bitcoin",
    "precision": "8"
  },
  {
    "currency": "ETC",
    "name": "Ethereum",
    "precision": "8"
  }
]

Return a list of all currencies and their decimal precision.

HTTP Request

GET /v0.4/public/currencies

Request Param

N/A

Response Body

Field Name Type Description
array Array of currencies
currency string Currency identifier
name string Currency name
precision string Currency precision (in decimals). Currently 8 for all assets

Account

Balance

Request URI

curl https://partner.gdac.com/v0.4/balance

Response Body

[
  {
    "currency": "BTC",
    "balance": "0.18566022",
    "available": "0.13166022"
  },
  {
    "currency": "ETH",
    "balance": "0.01586508",
    "available": "0.00800000"
  }
]

Get account info about available and total balance for each currency.

HTTP Request

GET /v0.4/balance

Request Param

N/A

Response Body

Field Name Type Description
array Array of currency balances
currency string Currency identifier
balance string Total balance for currency
available string Funds available (withdrawal/trading) for currency

Order

Place a new Order

Request URI

curl -d '{"pair":"BTC/KRW","side":"B","price":"1000.000","quantity":"10.1021"}'  -H "Content-Type: application/json" -X POST https://partner.gdac.com/v0.4/orders

Response Body

{
  "pair": "BTC/KRW",
  "order_id": "1902270000000030060"
}

Place a new buy or sell order.

HTTP Request

POST /v0.4/orders

Request Body

Field Name Required Description
pair Y Pair identifier
side Y Order type (buy or sell) "B":Buy, "S":Sell)
price Y Price at which you wish to buy/sell
quantity Y Quantity you wish to buy/sell

Response Body

Field Name Type Description
pair Y Pair identifier
order_id string Order identifier

Cancel an order

Request URI

curl -X DELETE https://partner.gdac.com/v0.4/api/orders?order_id=1901323000111044636

Response Body

{
  "pair": "BTC/KRW",
  "order_id": "1902270000000030060"
}

Cancel an open buy or sell order.

HTTP Request

DELETE /v0.4/orders

Request Param

Parameter Name Required Description
order_id Y Order identifier

Response Body

Field Name Type Description
pair string Pair identifier
order_id string Order identifier

Get Order Status

Request URI

curl https://partner.gdac.com/v0.4/orders/1902270000000030060

Response Body

{
  "pair": "BTC/KRW",
  "order_id": "1902270000000030060",
  "status": "P",
  "price": "1000.0000",
  "quantity": "10.1021",
  "open_quantity": "7.8712",
  "created_dtime": "2019-03-01T11:00:00Z"
}

Get a single order by order id.

HTTP Request

GET /v0.4/orders/{order_id}

Request Param

Parameter Name Required Description
order_id Y Order identifier

Response Body

Field Name Type Description
pair string Pair identifier
order_id string Order identifier
status string O:Open, P:PartiallyFilled, F:Filled, C:Canceled
side string Order type (buy or sell). "B":Buy, "S":Sell
price string Price at which you wish to buy/sell
quantity string Quantity you wish to buy/sell
open_quantity string Remaining amount waiting to be filled. If side is "B", then open_quantity is in base_currency units, otherwise open_quantity is in quote_currency units.
created_dtime string Order creation time

List Open Orders

Request URI

curl https://partner.gdac.com/v0.4/orders?pair=BTC%2FKRW&offset=2019-02-28T01%3A12%3A31Z&limit=100

Response Body

[
  {
    "pair": "BTC/KRW",
    "order_id": "1902270000000030060",
    "status": "P",
    "price": "1000.0000",
    "quantity": "10.1021",
    "open_quantity": "7.8712",
    "created_dtime": "2019-03-01T11:00:00Z"
  },
  {
    "pair": "BTC/KRW",
    "order_id": "1902270000000030059",
    "status": "P",
    "price": "950.0000",
    "quantity": "12.8182",
    "open_quantity": "0.8712",
    "created_dtime": "2019-03-01T10:31:00Z"
  }
]

Get a list of the user's open orders.

HTTP Request

GET /v0.4/orders

Request Param

Parameter Name Required Description
pair Y Pair identifier
offset N Timestamp in datetime format. If assigned, a list of orders older than offset is returned
limit N default: 50
status N Status filter. Can be combined with the following~ O:Open, P:PartiallyFilled, C:Canceled. i.e. "OP". If not specified, a list of all open orders is returned

Response Body

Field Name Type Description
array Array of orders
pair string Pair identifier
order_id string Order identifier
status string O:Open, P:PartiallyFilled, C:Canceled
side string Order type (buy or sell) "B":Buy, "S":Sell)
price string Price at which you wish to buy/sell
quantity string Quantity you wish to buy/sell
open_quantity string Remaining amount waiting to be filled. If side is "B", then open_quantity is in base_currency units, otherwise open_quantity is in quote_currency units.
created_dtime string Order creation time

Trade

Trade History

Request URI

curl https://partner.gdac.com/v0.4/trades?pair=BTC%2FKRW&offset=2019-02-28T01%3A12%3A31Z&limit=100

Response Body

[
  {
    "pair": "BTC/KRW",
    "trade_id": "1902270000000022289",
    "order_id": "1902270000000030059",
    "side": "S",
    "price": "4252000.00000000",
    "quantity": "3.51234406",
    "trade_dtime": "2019-02-27T06:29:56Z",
    "fee": "14934.00000000",
    "fee_currency": "KRW",
    "type": "M"
  },
  {
    "pair": "BTC/KRW",
    "trade_id": "1902270000000022287",
    "order_id": "1902270000000030053",
    "side": "S",
    "price": "4251000.00000000",
    "quantity": "1.93214406",
    "trade_dtime": "2019-02-27T06:29:54Z",
    "fee": "8213.00000000",
    "fee_currency": "KRW",
    "type": "M"
  }
]

Get a list of a user's trades.

HTTP Request

GET /v0.4/trades

Request Param

Parameter Name Required Description
pair Y Pair identifier
offset N Timestamp in datetime format. If assigned, a list of trades older than offset is returned
limit N default: 50

Response Body

Field Name Type Description
array Array of trades
pair string Pair identifier
trade_id string Trade identifier
order_id string Order identifier
side string Order type (buy or sell) "B":Buy, "S":Sell)
price string Price at which you wish to buy/sell
quantity string Quantity you wish to buy/sell
trade_dtime string Time of the trade
fee string Fee for transaction, withdrawal, etc.
fee_currency string Currency identifier for fee
type string M:Maker, T:Taker