Address
Gopax REST API can be accessed via the following address.
https://api.gopax.co.kr
Authentication
import base64, hashlib, hmac, json, requests, time
API_KEY = '<Insert Yours>'
SECRET = '<Insert Yours>'
def call(need_auth, method, path, body_json=None, recv_window=None):
method = method.upper()
if need_auth:
timestamp = str(int(time.time() * 1000))
include_querystring = method == 'GET' and path.startswith('/orders?')
p = path if include_querystring else path.split('?')[0]
msg = 't' + timestamp + method + p
msg += (str(recv_window) if recv_window else '') + (json.dumps(body_json) if body_json else '')
raw_secret = base64.b64decode(SECRET)
raw_signature = hmac.new(raw_secret, str(msg).encode('utf-8'), hashlib.sha512).digest()
signature = base64.b64encode(raw_signature)
headers = {'api-key': API_KEY, 'timestamp': timestamp, 'signature': signature}
if recv_window:
headers['receive-window'] = str(recv_window)
else:
headers = {}
req_func = {'GET': requests.get, 'POST': requests.post, 'DELETE': requests.delete}[method]
resp = req_func(url='https://api.gopax.co.kr' + path, headers=headers, json=body_json)
return {
'statusCode': resp.status_code,
'body': resp.json(),
'header': dict(resp.headers),
}
post_orders_req_body = {
'side': 'buy', 'type': 'limit', 'amount': 1,
'price': 10000, 'tradingPairName': 'BTC-KRW'
}
print(call(True, 'POST', '/orders', post_orders_req_body, 200))
print(call(True, 'GET', '/orders'))
print(call(True, 'GET', '/orders?includePast=true'))
print(call(True, 'GET', '/trades?limit=1'))
print(call(False, 'GET', '/trading-pairs/BTC-KRW/book?level=1'))
const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
const crypto = require('crypto');
const API_KEY = '<Insert Yours>';
const SECRET = '<Insert Yours>';
function call(needAuth, method, path, bodyJson = null, recvWindow = null) {
const bodyStr = bodyJson ? JSON.stringify(bodyJson) : '';
const http = new XMLHttpRequest();
const methodInUpperCase = method.toUpperCase();
http.open(methodInUpperCase, `https://api.gopax.co.kr${path}`, false);
if (needAuth) {
const timestamp = new Date().getTime();
const includeQuerystring = methodInUpperCase === 'GET' && path.startsWith('/orders?');
const p = includeQuerystring ? path : path.split('?')[0];
const msg = `t${timestamp}${methodInUpperCase}${p}${recvWindow || ''}${bodyStr}`;
const rawSecret = Buffer.from(SECRET, 'base64');
const signature = crypto.createHmac('sha512', rawSecret).update(msg).digest('base64');
http.setRequestHeader('api-key', API_KEY);
http.setRequestHeader('timestamp', timestamp);
http.setRequestHeader('signature', signature);
if (recvWindow) {
http.setRequestHeader('receive-window', recvWindow);
}
}
http.send(bodyStr);
return {
statusCode: http.status,
body: JSON.parse(http.responseText),
header: http.getAllResponseHeaders(),
};
}
function printAllDepth(json) {
console.dir(json, { depth: null });
}
const postOrdersReqBody = {
side: 'buy', type: 'limit', amount: 1,
price: 10000, tradingPairName: 'BTC-KRW',
};
printAllDepth(call(true, 'POST', '/orders', postOrdersReqBody, 200));
printAllDepth(call(true, 'GET', '/orders'));
printAllDepth(call(true, 'GET', '/orders?includePast=true'));
printAllDepth(call(true, 'GET', '/trades?limit=1'));
printAllDepth(call(false, 'GET', '/trading-pairs/BTC-KRW/book?level=1'));
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"strconv"
"strings"
"time"
)
const (
apiKey = "<Insert Yours>"
secret = "<Insert Yours>"
)
func call(
needAuth bool, method string, path string,
body map[string]interface{}, // can be nil
recvWindow int, // set -1 not to assign
) *map[string]interface{} {
method = strings.ToUpper(method)
var bodyBytes []byte = nil
if body != nil {
bodyBytes, _ = json.Marshal(body)
}
req, _ := http.NewRequest(method, "https://api.gopax.co.kr"+path, bytes.NewBuffer(bodyBytes))
if needAuth {
timestamp := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
msg := "t" + timestamp + method
if method == "GET" && strings.HasPrefix(path, "/orders?") {
msg += path
} else {
msg += strings.Split(path, "?")[0]
}
if recvWindow != -1 {
msg += strconv.Itoa(recvWindow)
req.Header.Set("receive-window", strconv.Itoa(recvWindow))
}
if bodyBytes != nil {
msg += string(bodyBytes)
}
rawSecret, _ := base64.StdEncoding.DecodeString(secret)
mac := hmac.New(sha512.New, rawSecret)
mac.Write([]byte(msg))
signature := base64.StdEncoding.EncodeToString(mac.Sum(nil))
req.Header.Set("api-key", apiKey)
req.Header.Set("timestamp", timestamp)
req.Header.Set("signature", signature)
}
resp, resp_err := (&http.Client{}).Do(req)
if resp_err != nil {
panic(resp_err)
}
defer resp.Body.Close()
respBodyBytes, _ := ioutil.ReadAll(resp.Body)
return &map[string]interface{}{
"statusCode": resp.StatusCode,
"body": string(respBodyBytes),
"header": resp.Header,
}
}
func main() {
postOrderReqBody := map[string]interface{}{
"side": "buy", "type": "limit", "amount": 1,
"price": 10000, "tradingPairName": "BTC-KRW",
}
log.Print(*call(true, "POST", "/orders", postOrderReqBody, 200))
log.Print(*call(true, "GET", "/orders", nil, -1))
log.Print(*call(true, "GET", "/orders?includePast=true", nil, -1))
log.Print(*call(true, "GET", "/trades?limit=1", nil, -1))
log.Print(*call(false, "GET", "/trading-pairs/BTC-KRW/book?level=1", nil, -1))
}
An API key and its secret are needed to use Gopax REST API, which can be issued via Gopax's website.
- Get current
timestamp
value in milliseconds as an integer. - Concatenate the following strings to get
msg
.- String 't'
timestamp
- Request method in uppercase (e.g. 'GET')
- Request path (e.g. '/orders')
- Request body (omit this part in case there is no body)
- Get
raw secret
by decodingsecret
with base64. - Sign
msg
withraw secret
as the key with SHA512 HMAC to getraw signature
. - Get
signature
by encodingraw signature
with base64. - Add
api-key
,timestamp
,signature
in request header.
Receive Window
A user can set a limit on the network latency beyond which the request will be rejected.
Add the key receive-window
in your request header with values ranging from 200 to 60000 (in milliseconds). This tells the server “reject my order if it doesn’t arrive within x milliseconds”.
When generating a signature, put the value of receive-window
after the request path.
If the request reaches the server later than timestamp
+ receive-window
, the order will be rejected.
Private APIs
Private APIs need authentication.
Read Balance
GET /balances
Example
Path
GET /balances
Request Body
N/A
Response Body
[
{
"asset": "KRW", # asset name
"avail": 1759466.76, # available amount to place order
"hold": 16500, # outstanding amount on order books
"pendingWithdrawal": 0, # amount being withdrawan
"lastUpdatedAt": "1600684352032" # balance last update time
},
{
"asset": "ETH",
"avail": 100979.57523727,
"hold": 50.02,
"pendingWithdrawal": 0,
"lastUpdatedAt": "1600686162591"
},
...
]
Read Balance by Asset
GET /balances/<AssetName>
Example
Path
GET /balances/ETH
Request Body
N/A
Response Body
{
"asset": "ETH", # asset name
"avail": 100979.57523727, # available amount to place order
"hold": 50.02, # outstanding amount on order books
"pendingWithdrawal": 0, # amount being withdrawan
"lastUpdatedAt": "1600686162591" # balance last update time
}
Read Order
Read outstanding orders on order books.
GET /orders
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
includePast | X | false | If true, completed and canceled orders are included as the result. They are accessible for 10 minutes only from its completion or cancellation time. |
pagination | X | false | In case the result is more than 3,000 orders, set this value as true to access 1,000 orders at max per each page. |
tradingPairName | X | - | Trading pair name of the order. (e.g. BTC-KRW, ETH-KRW ...) |
status | X | - | A status of the order. (e.g. placed, cancelled, completed, updated, reserved) |
since | X | - | A date since timestamp (in milliseconds) |
filterByUpdatedAt | X | false | It needs since parameter. If this value is true, read data after since timestamp as of updatedAt. Else, read data after since timestamp as of createdAt. |
limit | X | - | Limited number of orders |
tail | X | false | It needs limit parameter. If tail is true, return limited data from latest. Else, return limited data from oldest. |
Example
Path
GET /orders
Request Body
N/A
Response Body
[
{
"id": "453324", # order ID
"clientOrderId": "zeckrw23456", # client order ID (showed only when it exists)
"status": "updated", # placed, cancelled, completed, updated, reserved
"forcedCompletionReason": undefined, # the reason in case it was canceled in the middle (protection or timeInForce)
"tradingPairName": "ZEC-KRW", # order book
"side": "buy", # buy, sell
"type": "limit", # limit, market
"price": 1000000, # price
"stopPrice": undefined, # stop price (showed only for stop orders)
"amount": 4, # initial amount
"remaining": 1, # outstanding amount
"protection": "yes", # whether protection is activated (yes or no)
"timeInForce": "gtc", # limit order's time in force (gtc/po/ioc/fok)
"createdAt": "2020-09-25T04:06:20.000Z", # order placement time
"updatedAt": "2020-09-25T04:06:29.000Z", # order last update time
"balanceChange": {
"baseGross": 3, # base asset balance's gross change (in ZEC for this case)
"baseFee": {
"taking": 0, # base asset fee imposed as taker
"making": -0.0012 # base asset fee imposed as maker
},
"baseNet": 2.9988, # base asset balance's net change (in ZEC for this case)
"quoteGross": -3000000, # quote asset balance's gross change (in KRW for
"quoteFee": {
"taking": 0, # quote asset fee imposed as taker
"making": 0 # quote asset fee imposed as maker
},
"quoteNet": -3000000 # quote asset balance's net change (in KRW for this case)
}
},
...
]
Read Order by ID
GET /orders/<OrderId>
or GET /orders/clientOrderId/<ClientOrderID>
Example
Path
GET /orders/453324
Request Body
N/A
Response Body
{
"id": "453324", # order ID
"clientOrderId": "zeckrw23456", # client order ID (showed only when it exists)
"status": "updated", # placed, cancelled, completed, updated, reserved
"forcedCompletionReason": undefined, # the reason in case it was canceled in the middle (protection or timeInForce)
"tradingPairName": "ZEC-KRW", # order book
"side": "buy", # buy, sell
"type": "limit", # limit, market
"price": 1000000, # price
"stopPrice": undefined, # stop price (showed only for stop orders)
"amount": 4, # initial amount
"remaining": 1, # outstanding amount
"protection": "yes", # whether protection is activated (yes or no)
"timeInForce": "gtc", # limit order's time in force (gtc/po/ioc/fok)
"createdAt": "2020-09-25T04:06:20.000Z", # order placement time
"updatedAt": "2020-09-25T04:06:29.000Z", # order last update time
"balanceChange": {
"baseGross": 3, # base asset balance's gross change (in ZEC for this case)
"baseFee": {
"taking": 0, # base asset fee imposed as taker
"making": -0.0012 # base asset fee imposed as maker
},
"baseNet": 2.9988, # base asset balance's net change (in ZEC for this case)
"quoteGross": -3000000, # quote asset balance's gross change (in KRW for
"quoteFee": {
"taking": 0, # quote asset fee imposed as taker
"making": 0 # quote asset fee imposed as maker
},
"quoteNet": -3000000 # quote asset balance's net change (in KRW for this case)
}
}
Place Order
POST /orders
Example
Path
POST /orders
Request Body
{
"clientOrderId": "test4321", # opt. | client order ID (max 20 characters of [a-zA-Z0-9_-])
"tradingPairName": "BCH-KRW", # man. | order book
"side": "sell", # man. | buy, sell
"type": "limit", # man. | limit, market
"price": 11000000, # man. (only for limit) | price
"stopPrice": 12000000, # opt. (becomes a stop order if set) | stop price
"amount": 0.5, # man. | amount
"protection": "no", # opt. (default=no) | whether protection is activated (yes or no)
"timeInForce": "gtc" # opt. (default=gtc) | limit order's time in force (gtc/po/ioc/fok)
}
Response Body
{
"id": "453327", # order ID
"clientOrderId": "test4321", # client order ID (showed only when it exists)
"status": "reserved", # placed, cancelled, completed, updated, reserved
"forcedCompletionReason": undefined, # the reason in case it was canceled in the middle (protection or timeInForce)
"tradingPairName": "BCH-KRW", # order book
"side": "sell", # buy, sell
"type": "limit", # limit, market
"price": 11000000, # price
"stopPrice": 12000000, # stop price (showed only for stop orders)
"amount": 0.5, # initial amount
"remaining": 0.5, # outstanding amount
"protection": "no", # whether protection is activated (yes or no)
"timeInForce": "gtc", # limit order's time in force (gtc/po/ioc/fok)
"createdAt": "2020-09-25T04:51:31.000Z", # order placement time
"balanceChange": {
"baseGross": 0, # base asset balance's gross change (in BCH for this case)
"baseFee": {
"taking": 0, # base asset fee imposed as taker
"making": 0 # base asset fee imposed as maker
},
"baseNet": 0, # base asset balance's net change (in BCH for this case)
"quoteGross": 0, # quote asset balance's gross change (in KRW for
"quoteFee": {
"taking": 0, # quote asset fee imposed as taker
"making": 0 # quote asset fee imposed as maker
},
"quoteNet": 0 # quote asset balance's net change (in KRW for this case)
}
}
Cancel Order
DELETE /orders/<OrderId>
or DELETE /orders/clientOrderId/<ClientOrderID>
Example
Path
DELETE /orders/453327
Request Body
N/A
Response Body
{}
Read Trading History
GET /trades
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
limit | X | - | Maximum number of returned items (up to 100) |
pastmax | X | - | Read data older than this ID |
latestmin | X | - | Read data newer than this ID |
after | X | - | Read data after this timestamp (in seconds) |
before | X | - | Read data before this timestamp (in seconds) |
deepSearch | X | false | Read data older than one month ago are inclusively looked up only when it is "true" (More prioritized than the other parameters) |
tradingPairName | X | - | Trading pair name of the trade. (e.g. BTC-KRW, ETH-KRW ...) |
Example
Path
GET /trades
Request Body
N/A
Response Body
[
{
"id": 73953, # trading event ID
"orderId": 453324, # order ID
"baseAmount": 3, # traded base asset amount
"quoteAmount": 3000000, # traded quote asset amount
"fee": 0.0012, # fee
"feeAsset": "KRW", # fee asset name
"price": 1000000, # price
"timestamp": "2020-09-25T04:06:30.000Z", # trading time
"side": "buy", # buy, sell
"tradingPairName": "ZEC-KRW", # order book
"position": "maker" # maker, taker
},
...
]
Read Deposit/Withdrawal Status
GET /deposit-withdrawal-status
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
limit | X | - | Maximum number of returned items (up to 20) |
latestmin | X | - | Read data older than this ID |
after | X | - | Read data after this timestamp (in milliseconds) |
before | X | - | Read data before this timestamp (in milliseconds) |
completedOnly | X | false | Read completed data only (true/false) |
asset | X | - | Filter data by this vaild asset name (e.g. BTC, ETH, ... ) |
Example
Path
GET /deposit-withdrawal-status
Request Body
N/A
Response Body
[
{
"id": 640, # deposit/withdrawal event ID
"asset": "BTC", # asset name
"type": "crypto_withdrawal", # fiat_withdrawal, fiat_deposit, crypto_withdrawal, crypto_deposit
"netAmount": 0.0001, # amount
"feeAmount": 0.0005, # fee (null if there is no imposed fee)
"status": "completed", # reviewing, rejected, processing, failed, completed
"reviewStartedAt": 1595556218, # request time
"completedAt": 1595556902, # completion time (showed only in case of completed)
"txId": "eaca5ad3...", # tx ID
"sourceAddress": null, # sender address (showed only in case of crypto_deposit)
"destinationAddress: "3H8...", # recipient address (showed only in case of crypto_withdrawal)
"destinationMemoId": null # recipient address's memo ID
},
...
]
Read Crypto Deposit Address
GET /crypto-deposit-addresses
Example
Path
GET /crypto-deposit-addresses
Request Body
N/A
Response Body
[
{
"asset": "BTC", # asset name
"address": "1CwC2cMFu1jRQUBtw925cENbT1kctJBMdm", # deposit address
"memoId": null, # memo ID (showed only for assets using memo ID)
"createdAt": 1594802312 # deposit address creation time
},
...
]
Read Crypto Withdrawal Address
GET /crypto-withdrawal-addresses
Example
Path
GET /crypto-withdrawal-addresses
Request Body
N/A
Response Body
[
{
"asset": "BTC", # asset name
"address": "3QEdPvg2XuK8Q1tGU1RpyzxkkEsiLkvQF3", # withdrawal address
"memoId": null, # memo ID
"nickname": "My External BTC Address", # withdrawal address' nickname
"createdAt": 1588417815 # withdrawal address registration time
}
...
]
Crypto Withdrawal
POST /withdrawals
Example
Path
POST /withdrawals
Request Body
{
"asset": "BCH", # man. | asset name
"nickname": "WithdrawalAddress", # man. | withdrawal address's nickname
"amount": "10000000000", # man. | withdrawal amount
}
Response Body
N/A
Public APIs
Public APIs don't need authentication. There is no need to set headers.
Read Asset
GET /assets
Example
Path
GET /assets
Request Body
N/A
Response Body
[
...,
{
"id": "ETH", # asset name
"name": "이더리움", # asset name in Korean
"englishName": "Ethereum", # asset name in English
"scale": 8, # asset's scale below decimal point
"withdrawalFee": 0.03, # withdrawal fee
"withdrawalAmountMin": 0.015 # withdrawal amount's minimum
},
...
]
Read Trading Pair
GET /trading-pairs
Example
Path
GET /trading-pairs
Request Body
N/A
Response Body
[
{
"id": 1, # trading pair ID
"name": "ETH-KRW", # trading pair name
"baseAsset": "ETH", # base asset
"quoteAsset": "KRW", # quote asset
"baseAssetScale": 8, # base asset scale below decimal point
"quoteAssetScale": 0, # quote asset scale below decimal point
"priceMin": 1, # price's minimum
"restApiOrderAmountMin": { # REST API order amount's minimum
"limitAsk": {
"amount": 1000,
"unit": "KRW"
},
"limitBid": {
"amount": 1000,
"unit": "KRW"
},
"marketAsk": {
"amount": 0.001,
"unit": "ETH"
},
"marketBid": {
"amount": 1000,
"unit": "KRW"
}
},
"makerFeePercent": 0.2, # maker fee percent
"takerFeePercent": 0.2 # taker fee percent
},
...
]
Read Price Tick Size
GET /trading-pairs/<TradingPair>/price-tick-size
Example
Path
GET /trading-pairs/BTC-KRW/price-tick-size
Request Body
N/A
Response Body
[
{ startPrice: 1, tickSize: 1 },
{ startPrice: 5000, tickSize: 5 },
{ startPrice: 10000, tickSize: 10 },
{ startPrice: 50000, tickSize: 50 },
{ startPrice: 100000, tickSize: 100 },
{ startPrice: 500000, tickSize: 500 },
{ startPrice: 2000000, tickSize: 1000 }
]
Read Ticker
GET /trading-pairs/<TradingPair>/ticker
Example
Path
GET /trading-pairs/BTC-KRW/ticker
Request Body
N/A
Response Body
{
"price": 15393000, # current price on the order book
"ask": 15397000, # min selling price on the order book
"askVolume": 0.56, # min selling price's volume on the order book
"bid": 15393000, # max buying price on the order book
"bidVolume": 1.9513, # max buying price's volume on the order book
"volume": 487.43035427, # 24h accumulated traded volume (in base asset unit; BTC for this case)
"quoteVolume": 7319576689.34135, # 24h accumulated traded volume (in quote asset unit; KRW for this case)
"time": "2020-10-28T02:05:55.958Z" # ticker last update time
}
Read Order Book
GET /trading-pairs/<TradingPair>/book
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
level | X | 3 | 1 = The best ask entry and bid entry 2 = 50 ask entries and 50 bid entries 3 = All entries |
Example
Path
GET /trading-pairs/BTC-KRW/book
Request Body
N/A
Response Body
{
"sequence": 110815766,
"ask": [ # order book ask entries
[
"110815528", # order book entry sequence (+1 for each change)
12371000, # order book entry price
0.808, # order book entry volume
"1601030126425" # order book entry last update time
],
...
],
"bid": [ # order book bid entries
...,
[
"108223577",
11870000,
0.72446908,
"1600956121521"
]
]
}
Read Trading History
GET /trading-pairs/<TradingPair>/trades
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
limit | X | - | Maximum number of returned items (up to 100) |
pastmax | X | - | Read data older than this ID |
latestmin | X | - | Read data newer than this ID |
after | X | - | Read data after this timestamp (in seconds) |
before | X | - | Read data before this timestamp (in seconds) |
Example
Path
GET /trading-pairs/BTC-KRW/trades
Request Body
N/A
Response Body
[
{
"time": "2020-09-25T11:10:29.000Z", # trading time
"date": 1601032229, # trading timestamp in seconds
"id": 21876490, # trading event ID
"price": 12353000, # price
"amount": 0.2951, # trading volume (in base asset unit; BTC for this case)
"side": "sell" # buy, sell
},
...
]
Read 24h Statistics
GET /trading-pairs/<TradingPair>/stats
Example
Path
GET /trading-pairs/BTC-KRW/stats
Request Body
N/A
Response Body
{
"open": 12132000, # the price before 24h
"high": 12543000, # the highest price for the last 24h
"low": 12059000, # the lowest price for the last 24h
"close": 12349000, # the current price (updated every 1 minute)
"volume": 332.12915604, # the accumulated trading volume for the last 24h (in base asset unit, BTC for this case)
"time": "2020-09-25T11:13:47.371Z" # statistics last update time
}
Read 24h Statistics for All
GET /trading-pairs/stats
Example
Path
GET /trading-pairs/stats
Request Body
N/A
Response Body
[
{
"name": "ETH-KRW", # trading pair
"open": 394200, # the price before 24h
"high": 409900, # the highest price for the last 24h
"low": 388700, # the lowest price for the last 24h
"close": 397200, # the current price (updated every 1 minute)
"volume": 4017.90526766, # the accumulated trading volume for the last 24h (in base asset unit, BTC for this case)
"time": "2020-09-25T11:14:14.866Z" # statistics last update time
},
...
]
Read Chart Data
GET /trading-pairs/<TradingPair>/candles
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
start | O | - | Range start timestamp (in milliseconds) |
end | O | - | Range end timestamp (in milliseconds) |
interval | O | - | Interval between sticks (in minutes, one of 1/5/30/1440) |
limit | X | 1024 | Limited number of items (up to 1024) |
Example
Path
GET /trading-pairs/BTC-KRW/candles?start=1601032379683&end=1601033046191&interval=1
Request Body
N/A
Response Body
[
...,
[
1601032200000, # stick's start time
12353000, # stick's lowest price
12361000, # stick's highest price
12361000, # stick's start price
12353000, # stick's end price
0.5902 # stick's trading volume (in base asset unit; BTC for this case)
],
...
]
Read Cautious to Invest
GET /trading-pairs/cautions
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
showActive | 선택 | false | true : Show risk list, false : Show all list |
Example
Path
GET /trading-pairs/cautions?showActive=true
Request Body
N/A
Response Body
[
{
"id": 1, # trading pair ID
"name": "ETH-KRW", # trading pair name
"alertLevel": 0, # Alert Level - NORMAL(0), RISKY(1), HIGHLY_RISKY(2)
"isPriceChange": false, # abrupt price change
"isMonopolyBuy": false, # (deprecated)
"isLowLiquidity": false, # (deprecated)
"isSoarTradingVolume": false, # abrupt trading volume change
"isSoarDepositAmount": false, # abrupt deposit amount change
"isGlobalPriceDifference": false, # global price difference
"isMonopolyTrading": false, # single account over trading
},
...
]
Read All Tickers
GET /tickers
Read all tickers
Example
Path
GET /tickers
Request Body
N/A
Response Body
[
{
'baseVolume': 0.02, # 24h accumulated traded volume (in base asset unit; BTC for this case)
'high': 37300000, # highest trading price in last 24 hours
'highestBid': 0, # max buying price on the order book
'last': 37300000, # current price on the order book
'lastTraded': 1665640796413, # Last trade time(Unix time)
'low': 37300000, # Lowest trading price in the last 24 hours
'lowestAsk': 0, # min selling price's volume on the order book
'open': 37300000, # Opening Price, The price at which the first transaction was made after 00:00(KST)
'quoteVolume': 746000, # 24h accumulated traded volume (in quote asset unit; KRW for this case)
'tradingPairName': 'BTC-KRW' # order book
},
...
{
'baseVolume': 0,
'high': 9000000,
'highestBid': 9000000,
'last': 9000000,
'lastTraded': 1629260634639,
'low': 9000000,
'lowestAsk': 9000000,
'open': 9000000,
'quoteVolume': 0,
'tradingPairName': 'UNC-KRW'
}
]
Read Server Time
GET /time
Example
Path
GET /time
Request Body
N/A
Response Body
{
"serverTime": 1601033421109 # timestamp in milliseconds
}
Read Announcement
GET /notices
Querystring | Mandatory | Default | Remarks |
---|---|---|---|
limit | X | 20 | Items per page (20 at max) |
page | X | 0 | Page number (starting from 0) |
type | X | 0 | Type (0 = any, 1 = general announcement, 2 = listing new asset, 3 = event) |
format | X | 0 | Format (0 = HTML, 1 = plain text) |
Example
Path
GET /notices?format=1
Request Body
N/A
Response Body
[
{
"id": 531, # announcement ID
"type": 1, # announcement type
"title": "Maintenance", # announcement title
"content": "Under the maintenance soon", # announcement content
"createdAt": "2020-12-29T01:24:13.000Z" # announcement creation time
"updatedAt": "2020-12-29T01:24:13.000Z" # announcement update time
},
...
]
Call Rate Limit
- Private APIs are limited per API key whereas public APIs are limited per IP address.
- At most 20 calls can be made within the 1 second moving window, respectively.
- For FOK orders and GET /trades?deepSearch=false, you can call them twice during the aforementioned 1 second window.
- For GET /trades?deepSearch=true and GET /trading-pairs/<TradingPair>/book, you can call them once during the aforementioned 1 second window.
- The following keys in the HTTP header in the response shows your current rate limit status.
- x-gopax-ip-addr-used-weight : weight limits used in the current rate limit window (1 second) based on IP address
- x-gopax-ip-addr-left-weight : weight limits remaining in the current rate limit window (1 second) based on IP address
- x-gopax-api-key-used-weight : weight limits used in the current rate limit window (1 second) based on API key
- x-gopax-api-key-left-weight : weight limits remaining in the current rate limit window (1 second) based on API key
- When the API call rate limit is exceeded, the status code 429 (Too Many Requests) will be returned.
API Key Expiration Policy
- An expiration date of one year is applied from the moment the API Key is issued.
- This policy, effective from November 19, 2024, calculates the expiration date of previously registered API Keys from the policy implementation date.
- Renewal of the expiration date is not possible; issuance must be done anew.
- The IP registered in advance at the time of API Key issuance is applied restrictively only for crypto withdrawal.
Errors
HTTP Error Status Code
Status Code | Description |
---|---|
400 | Bad Request - Invalid request format |
401 | Not Authorized - Invalid API key |
403 | Forbidden - Not Permitted to access requested resource |
404 | Not Found |
429 | Too many requests - API rate limit exceeded |
500 | Internal server error - Temporary problem with the service |
Errors
{
"100": "Invalid Asset",
"101": "Invalid Trading Pair",
"102": "Invalid User",
"104": "Not Enabled Trading Pair",
"105": "Not Activated Trading Pair",
"106": "Not Enabled Asset",
"107": "Invalid Amount",
"108": "Invalid Price",
"201": "Insufficient Balance",
"202": "Invalid Id",
"203": "Invalid Numbers Overflow",
"204": "Not Allowed Bid Order",
"206": "Invalid Option Combination",
"10004": "Not Authorized", # check again your signing logic
"10006": "User Not Found",
"10033": "Asset Not Allowed",
"10041": "Invalid Exchange",
"10044": "Invalid Asset Id",
"10052": "Order Server Not Available", # stop trading for a while if it happens
"10056": "No Registered Asset",
"10057": "No Registered Trading Pair",
"10058": "No Such Asset Code",
"10059": "No Such Trading Pair",
"10061": "Invalid Trading Pair Id",
"10062": "Invalid Chart Interval",
"10064": "User Locked",
"10069": "No Such Order Id",
"10074": "Send To Order Server Failed", # stop trading for a while if it happens
"10105": "Rate Limit Exceeded", # you are causing too much traffic
"10108": "Nonce Too Low",
"10155": "Invalid Api Key",
"10157": "Invalid Price",
"10166": "Invalid Chart Range",
"10195": "Invalid Internal Data",
"10204": "Not Hedge Token User", # visit the website and agree on using Pro market
"10212": "Too Small Quote Amount",
"10221": "No Such Client Order Id",
"10222": "Client Order Id Being Used",
"10223": "Soon Expired Client Order Id",
"10227": "Invalid Client Order Id Format",
"10229": "Invalid Signature",
"10230": "No Api Key",
"10231": "No Nonce And Timestamp",
"10232": "Nonce Too High",
"10233": "Unusable Api Key",
"10234": "Cannot Check Rate Limit",
"10255": "Too Long Request Body",
"10256": "Unparsable Request Body",
"10263": "Timestamp Too Low",
"10264": "Timestamp Too High",
"10265": "Choose Either Nonce Or Timestamp",
"10296": "Invalid Receive Window",
"10297": "Invalid Timestamp To Check Receive Window",
"10298": "Fail To Meet Server Arrival Deadline",
"10319": "Pagination Required",
"10358": "Invalid Order Type",
"10359": "Invalid Order Side",
"10360": "Invalid Order Status",
"10361": "Invalid Time In Force",
"10362": "Invalid Protection",
"10364": "Ip Address Banned Temporarily", # you are causing too much traffic
"10367": "Mandatory Query String Missing"
}
Changelog
2024-11-19
Added feature
- Adding a new endpoint
POST /withdrawals
for crypto withdrawal
Changed policy
- Application of the API Key expiration date policy
- It is limited to one year from the time of issuance, and the policy application time is the standard for the previously issued API Key.
2024-10-07
Changed policy
- Modification of the minimum order value in KRW (10,000 KRW -> 1,000 KRW)
2023-07-25
Added response data
- Adding
isSoarTradingVolume
,isSoarDepositAmount
,isGlobalPriceDifference
,isMonopolyTrading
on the response ofGET /trading-pairs/cautions
- Deprecated
isMonopolyBuy
,isLowLiquidity
on the response ofGET /trading-pairs/cautions
2022-02-07
Updated feature
GET /assets
Adding english name property to response (englishName)
2022-10-25
Added feature
- Adding a new endpoint
GET /tickers
2022-10-14
Updated feature
GET /trades
Adding fee asset property to response (feeAsset)POST /orders
Adding fee/reward asset id and changing fee policy- All trading fees are paid in the quote asset of the trading pair. (Apply after regular maintenance on November 1, 2022)
- In the case of an ask order, fee rate is applied to the quote asset received after the sale is completed. For example, for a user who has received 10,000 KRW from a sell trade, user will receive 9980 KRW after 20 KRW (presuming 0.2% fee rate) is paid as trading fee.
- In the case of a bid order, the bidder needs enough balance to pay the fee in addition to the quote amount required to place the order. (quote balance > order quote amount + fee (amount * fee rate) For example, for a user to place a bid order of 10,000 KRW, s/he needs at least 10,020 KRW (presuming 0.2 % fee rate)
- https://www.gopax.co.kr/notice/1303
2022-09-06
Added feature
- Adding investment risk notice api
2021-05-25
Updated feature
- Call rate is limited at 1 call within a 1 second window for
GET /trading-pairs/<TradingPair>/book
(Previously 20 calls within 1 second window)- For real time update of order books, refer to the Websocket API documentation (section "Subscription to Order Book")
2021-03-02
Added feature
- Adding trading pair name filtering option
GET /orders?tradingPairName=ETH-KRW
. - Adding order status option
GET /orders?status=completed
. - Adding start timestamp option
GET /orders?since=1601032379683&filterByUpdatedAt=true
as of updatedAt or createdAt. - Adding data length option
GET /orders?limit=1000&tail=true
as of latest or oldest. - Adding trading pair name filtering option
GET /trades?tradingPairName=BTC-KRW
. - Adding asset name filtering option
GET /deposit-withdrawal-status?asset=BTC
to read deposit and withdrawal. - Adding chart data length option
GET /trading-pairs/BTC-KRW/candles?limit=1024
.
2021-02-24
Updated feature
- Cancelled orders have been accessible for 1 hour from its completion or cancellation time. For the sake of stability, we've decreased the duration from 1 hour to 10 minutes.
2021-01-12
Added feature
- Adding a new endpoint
GET /trading-pairs/<TradingPair>/price-tick-size
2020-12-29
Added feature
- Adding a new endpoint
GET /notices
2020-10-28
Added response data
- Adding
scale
,withdrawalFee
, andwithdrawalAmountMin
on the response ofGET /assets
- Adding
baseAssetScale
,quoteAssetScale
,priceMin
, andrestApiOrderAmountMin
on the response ofGET /trading-pairs
- Adding
quoteVolume
on the response ofGET /trading-pairs/<TradingPair>/tickers
2020-08-26
Added feature
- Adding a new endpoint option
GET /orders?pagination=true
to support pagination
2020-08-18
Added response data
- Adding last update time on response of
GET /balances
andGET /trading-pairs/<Trading Pair>/book
2020-08-11
Updated feature
- Adding a new option, which is
GET /trades?deepSearch=true
2020-06-30
Added feature
- Adding a new endpoint option
GET /orders?includePast=true
to include completed/canceled orders in response.
2020-06-09
Added feature
- Including balanceChange in order data which descirbes change in user balance by the order.
- Describing maker fee and taker fee in the balanceChange.
2020-05-26
Added feature
- Introducing RECEIVE-WINDOW which is an advanced feature to allow users to set maximum tolerable network latency.
2020-05-13
Added feature
- For convenience, Timestamp is introduced as an alternative of Nonce.
2020-03-24
Added feature
- Get transaction history : returns deposit and withdrawal history of the user on GOPAX.
- Get crypto deposit addesses : returns crypto deposit addesses of the user on GOPAX.
- Get crypto withdrawal addesses : returns crypto withdrawal addesses of the user on GOPAX.
- Get server time
2020-03-07
Changed nonce policy
- Nonce migration and set-up the Nonce limit.
2020-02-25
Added feature
- Client Order Id : custom order id generated by user.
2020-02-19
Added feature
- Stop Order : an order functionality where if current price matches or exceeds (in either directions) the triggering price (stopPrice).
2020-01-07
Added feature
- Order protection : will protect a given order by cancelling remaining amount if the price is over 10% of first matching price.
- PO(Post Only) : only places an entire order, and cancels the order when there are corresponding orders present for matching.
- IOC(Immediate-Or-Cancel Order) : matches a given order for an amount coverable upto the given price. After matching, if there's still an amount remaining, rest of the order will be immediately cancelled.
- FOK(Fill-Or-Kill Order) : matches a given order if and only if all of the order amount can be matched for the given price. Otherwise, all order amount is immediately cancelled.
2018-08-08
Added feature
- Market order : will be matched market price.
2017-12-16
Feature
- Authenticated Calls
- Get balances
- Get balance by asset name
- Get orders
- Get order by order ID
- Place order
- Cancel order by order ID
- Get trade history
- Unauthenticated Calls
- Get assets
- Get trading pairs
- Get ticker by trading pair
- Get order book by trading pair
- Get recent trades
- Get 24hr stats by trading pair
- Get historic rates by trading pair
- Get 24hr stats for all trading pairs