Navbar
javascript php python

소개

GOPAX REST API 문서에 오신 것을 환영합니다. REST API를 통해 거래 주문 접수 및 마켓과 가격 정보를 확인하실 수 있습니다.

API는 인증토큰을 사용해야 요청할 수 있는 주문 및 잔고에 관계된 Private API, 최근 거래 체결 정보, 가격 등을 확인할 수 있는 Public API로 나뉘어집니다.

REST API 주소

고팍스의 REST API는 계정/주문 관리 및 공개 마켓 데이터에 대한 엔드포인트를 제공합니다.

https://api.gopax.co.kr

API 호출 횟수 제한

요청 및 응답 형식

모든 요청 및 응답의 content-type 은 application/json 이며, 통상적인 HTTP 상태코드를 준수합니다. 예를 들어 성공적으로 접속한 경우에는 200의 상태코드가 반환됩니다.

인증

Private API에 인증하기 위해, REST 요청에 항상 다음의 HTTP 헤더가 포함되어야 합니다.

  1. API-KEY: 발급받은 API 키
  2. SIGNATURE: 메시지 서명 값 (* SIGNATURE 생성 과정)
  3. NONCE: 중복되지 않고 계속 증가하는 값 (통상적으로 timestamp)

SIGNATURE 생성 과정

인증이 필요한 API는 아래 코드를 이용해주세요 :

const crypto = require('crypto');

const generateSignature = (secret, nonce, method, path, body = null) => {
  const requestPath = path.split('?')[0];
  const _body = body ? JSON.stringify(body) : '';

  const what = `${nonce}${method}${requestPath}${_body}`;
  const key = Buffer(secret, 'base64');
  const hmac = crypto.createHmac('sha512', key);
  return hmac.update(what).digest('base64');
};
<?
function generateSignature($secret, $nonce, $method, $path, $body = null)
{
  $_body = $body ? json_encode($body) : '';
  $tokenizedPath = explode('?', $path);
  $requestPath   = $tokenizedPath[0];
  $what          = $nonce . $method . $requestPath . $_body;
  $secret        = base64_decode($secret);
  return base64_encode(hash_hmac('sha512', $what, $secret, true));
}
import time, base64, hmac, hashlib

nonce = str(time.time())
method = 'GET'
request_path = '/balances'

what = nonce + method + request_path # + request_body
key = base64.b64decode(secret)
signature = hmac.new(key, what, hashlib.sha512)
return base64.b64encode(signature.digest())
  1. 다음의 내용을 순서대로 문자열로 연결합니다.
    1. 헤더의 NONCE 값
    2. HTTP Method(대문자로): 'GET', 'POST', 'DELETE' 등
    3. API 엔드포인트 경로 (예: '/orders', '/trading-pairs/ETH-KRW/book')
    4. JSON 형식의 요청 변수 본문 (없을 경우 아무 문자열도 연결하지 마십시오)
  2. 발급 받은 Secret Key를 base64로 디코딩합니다.
  3. 2.의 값을 Secret key를 사용하여 sha512 HMAC 으로 서명합니다.
  4. 3.의 값을 base64로 인코딩합니다.

HTTP 헤더 예제

API-KEY: 128f0123-2a5d-48f5-8f19-e937f38f0a99 SIGNATURE: gn2poOBVCAd5GLqXFAZGK9Pk4VD7+OaNtDIkFjejwIBjBm1X/DYPZVAP1rex6XqwH8vHt36ap26lTN85HVJz2g== NONCE: 1520994527165 Content-Type: application/json

인증이 필요한 API

잔액 조회하기

GOPAX의 모든 자산에 대해 잔액을 조회할 수 있습니다.

결과 :

[
  {
    "asset": "KRW",
    "avail": 9101080.53,
    "hold": 0,
    "pendingWithdrawal": 0
  }, {
    "asset": "ETH",
    "avail": 0,
    "hold": 0,
    "pendingWithdrawal": 0
  }, {
    "asset": "BTC",
    "avail": 0.42317058,
    "hold": 0,
    "pendingWithdrawal": 0
  }, {
    "asset": "BCH",
    "avail": 0,
    "hold": 0,
    "pendingWithdrawal": 0
  }
]

HTTP 요청

GET /balances

결과값 설명

[ { "asset": [Asset Name], "avail": [Avail], "hold": [Hold], "pendingWithdrawal": [Pending Withdrawal] } ]

설명
Asset Name 자산 이름. 자산 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Avail 거래 가능 금액 (수량)
Hold 미체결 금액 (수량)
Pending Withdrawal 출금 중인 금액 (수량)

자산 이름에 따라 잔액 조회하기

자산에 대한 잔액을 조회할 수 있습니다.

결과 :

{
  "asset": "KRW",
  "avail": 9101080.53,
  "hold": 0,
  "pendingWithdrawal": 0
}

HTTP 요청

GET /balances/<Asset Name>

URL 파라미터

파라미터 설명
Asset Name 자산 이름. 자산 목록 조회하기에서 전체 목록을 확인할 수 있습니다.

결과값 설명

{ "asset": [Asset Name], "avail": [Avail], "hold": [Hold], "pendingWithdrawal": [Pending Withdrawal] }

설명
Asset Name 자산 이름. 자산 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Avail 거래 가능 금액 (수량)
Hold 미체결 금액 (수량)
Pending Withdrawal 출금 중인 금액 (수량)

주문 조회하기

미체결, 체결 및 취소된 주문들을 조회할 수 있습니다.

결과 :

[
  {
    "id": "23712",
    "status": "placed",
    "side": "sell",
    "type": "limit",
    "price": 101,
    "amount": 100,
    "remaining": 100,
    "tradingPairName": "CND-KRW",
    "createdAt": "2020-01-08T12:44:03.000Z",
    "updatedAt": "2020-01-09T03:02:58.233Z",
    "clientOrderId": "gopax1234"
  }, {
    "id": "34873",
    "status": "completed",
    "side": "buy",
    "type": "market",
    "price": 104039440,
    "amount": 1.3,
    "remaining": 0,
    "tradingPairName": "BTC-KRW",
    "createdAt": "2020-01-08T12:44:03.000Z",
    "updatedAt": "2020-01-09T03:02:58.233Z",
    "clientOrderId": "gopax23456"
  }
]

HTTP 요청

GET /orders

결과값 설명

[ { "id": [ID], "status": [Status], "side": [Side], "type": [Type], "price": [Price], "amount": [Amount], "remaining": [Remaining Amount], "tradingPairName": [Trading Pair], "createdAt": [Created At], "updatedAt": [Updated At], "clientOrderId": [Client Order ID] }, ... ]

설명
ID 주문 고유번호
Status 주문 상태 (placed, completed, cancelled, updated)
Side 주문 구분 (buy: 구매 또는 sell: 판매)
Type 주문 종류 (limit: 지정가, market: 시장가)
Price 주문 가격
Amount 주문 수량
Remaining Amount 미체결 주문 수량
Trading Pair 거래쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Created At 주문 시간
Updated At 주문 업데이트 시간
Client Order ID 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능).

주문 ID로 주문 조회하기

주문 ID나 사용자 지정 주문 ID로 주문을 조회할 수 있습니다.

결과 :

{
  "id": "23712",
  "status": "placed",
  "side": "sell",
  "type": "limit",
  "price": 101,
  "amount": 100,
  "remaining": 100,
  "tradingPairName": "CND-KRW",
  "createdAt": "2020-01-08T12:44:03.000Z",
  "updatedAt": "2020-01-09T03:02:58.233Z",
  "clientOrderId": "gopax1234"
}

HTTP 요청

GET /orders/<Order ID> GET /orders?clientOrderId=<Client Order ID>

URL 파라미터

파라미터 설명
Order ID 자산 이름. 자산 목록 조회하기에서 전체 목록을 확인할 수 있습니다.

Query 파라미터

파라미터 필수 여부 설명
Client Order ID 선택 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능)

결과값 설명

{ "id": [ID], "status": [Status], "side": [Side], "type": [Type], "price": [Price], "amount": [Amount], "remaining": [Remaining Amount], "tradingPairName": [Trading Pair], "createdAt": [Created At], "updatedAt": [Updated At], "clientOrderId": [Client Order ID] }

설명
ID 주문 고유번호
Status 주문 상태 (placed, completed, cancelled, updated)
Side 주문 구분 (buy: 구매 또는 sell: 판매)
Type 주문 종류 (limit: 지정가, market: 시장가)
Price 주문 가격
Amount 주문 수량
Remaining Amount 미체결 주문 수량
Trading Pair 거래쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Created At 주문 시간
Updated At 주문 업데이트 시간
Client Order ID 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능).

주문 등록하기

새로운 주문을 등록할 수 있습니다.

예제 :

import time, base64, hmac, hashlib, requests, json

apikey = '' 
secret = ''  
nonce = str(time.time())
method = 'POST'
request_path = '/orders'

request_body = 
# ETH-KRW를 지정가로 100만원에 ETH 10개 매수
{
    "type": "limit",
    "side": "buy",
    "price": 1000000,
    "amount": 10,
    "tradingPairName": "ETH-KRW"
}
# ETH-KRW를 시장가로 ETH 10개 매도
{
      "type": "market",
      "side": "sell",
      "amount": 10,
      "tradingPairName": "ETH-KRW"
}
# ETH-KRW를 시장가로 100만원어치의 이더리움을 구매
{
    "type": "market",
    "side": "buy",
    "amount": 1000000,
    "tradingPairName": "ETH-KRW"
}

what = nonce + method + request_path + json.dumps(request_body)
key = base64.b64decode(secret)
signature = hmac.new(key, str(what).encode('utf-8'), hashlib.sha512)
signature_b64 = base64.b64encode(signature.digest())

custom_headers = {
  'API-Key': apikey,
  'Signature': signature_b64,
  'Nonce': nonce
}

def main():
  req = requests.post(url = 'API End point URL' + request_path, headers = custom_headers,json=request_body)

  if req.ok:
    print(req.text)
  else:
    print ('요청 에러')
    print(req.text)

if __name__ == '__main__':
  main()
var crypto = require('crypto');
var request = require('request');

var apikey = '';
var secret = '';
var nonce = Date.now() * 1000;
var method = 'POST';
var requestPath = '/orders';
var json_body = 
// ETH-KRW를 지정가로 100만원에 ETH 10개 매수
{
    type: "limit",
    side: "buy",
    price: 1000000,
    amount: 10,
    tradingPairName: "ETH-KRW"
};
// ETH-KRW를 시장가로 ETH 10개 매도
{
    type: "market",
    side: "sell",
    amount: 10,
    tradingPairName: "ETH-KRW"
};
// ETH-KRW를 시장가로 100만원어치의 이더리움을 구매
{
    type: "market",
    side: "buy",
    amount: 1000000,
    tradingPairName: "ETH-KRW"
};

var body = JSON.stringify(json_body, Object.keys(json_body).sort());
var what = nonce + method + requestPath + body;
var key = Buffer(secret, 'base64');
var hmac = crypto.createHmac('sha512', key);
var sign = hmac.update(what).digest('base64');

var host = 'API End point URL';

var options = {
  method,
  body: json_body,
  json: true,
  url: `https://${host}${requestPath}`,
  headers: {
    API-KEY: apikey,
    Signature: sign,
    Nonce: nonce
  },
  strictSSL: false,
};

request(options, (err, response, b) => {
  if (err) {
    console.log('err:', err);
    return;
  }
  console.log(b);
});
<?
private apiKey = '';
private apiSecret = '';

const API_HOST = 'API End point URL';
const VERSION = 'gopax-php-sdk-20171216';

private function request(string $method, string $path, $request = NULL)
{
    $curl = curl_init();

    $mt = explode(' ', microtime());
    $nonce     = $mt[1] . substr($mt[0], 2, 6);
    $method    = strtoupper($method);

    $tokenizedPath = explode('?', $path);
    $requestPath   = $tokenizedPath[0];
    $what          = $nonce . $method . $requestPath . $request;
    $secret        = base64_decode($this->apiSecret);
    $signature     = base64_encode(hash_hmac('sha512', $what, $secret, true));

    $headers[] = 'Content-Type: application/json';
    $headers[] = 'API-KEY: ' . $this->apiKey;
    $headers[] = 'SIGNATURE: ' . $signature;
    $headers[] = 'NONCE: ' . $nonce;
    curl_setopt($curl, CURLOPT_USERAGENT, self::VERSION);
    curl_setopt($curl, CURLOPT_URL, self::API_HOST . $path);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, TRUE);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);

    $json       = curl_exec($curl);
    $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    curl_close($curl);

    return new Response($httpStatus, $json);
}

public function setParameter(string $type, string $side, float $price, float $amount, string $tradingPairName)
{
    $data['type']            = $type; // LIMIT, MARKET
    $data['side']            = $side; // BUY, SELL
    $data['price']           = $price;
    $data['amount']          = $amount;
    $data['tradingPairName'] = $tradingPairName;
    return json_encode($data);
}

$orderRequest = setParameter(
  // ETH-KRW를 지정가로 100만원에 ETH 10개 매수
   'limit', 'buy', 10000000, 0.1, 'ETH-KRW'
 );
 (
   // ETH-KRW를 시장가로 ETH 10개 매도
   'market', 'sell', 0, 10, 'ETH-KRW'
 );
 (
   // ETH-KRW를 시장가로 100만원어치의 이더리움을 구매
   'market', 'buy', 0, 1000000,'ETH-KRW'
 );

print_r($this->request('POST','/orders',$orderRequest));

결과 :

{
  "id": "98723",
  "status": "completed",
  "price": 750000,
  "amount": 9,
  "remaining": 3.2,
  "tradingPairName": "ETH-KRW",
  "side": "buy",
  "type": "limit",
  "createdAt": "2020-01-09T10:43:10.000Z",
  "timeInForce": "gtc",
  "protection": "yes",
  "clientOrderId": "gopax1234"
}

HTTP 요청

POST /orders

요청 본문 설명

{ "type": [Type], "side": [Side], "price": [Price], "stopPrice": [StopPrice], "amount": [Amount], "tradingPairName": [Trading Pair], "timeInForce": [Time In Force], "protection": [Protection], "clientOrderId": [Client Order ID] }

필수 여부 기본값 설명
Type 필수 - 주문 종류 (limit: 지정가, market: 시장가)
Side 필수 - 주문 구분 (buy: 구매, sell: 판매)
Price 필수 - 주문 가격
StopPrice 선택 - 주문 가격
Amount 필수 - 주문 수량
Trading Pair 필수 - 거래쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Time In Force 선택 지정가 주문은 gtc 지정가 주문 유형 (gtc,po,ioc,fok)
Protection 선택 no 최초 체결가 기준 ±10% 초과 되는 주문 취소 (yes, no)
Client Order ID 선택 - 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능).

결과값 설명

{ "id": [ID], "status": [Status], "price": [Price], "stopPrice": [StopPrice], "amount": [Amount], "remaining": [Remaining Amount], "tradingPairName": [Trading Pair], "side": [Side], "type": [Type], "createdAt": [Created At], "timeInForce": [Time In Force], "protection": [Protection], "clientOrderId": [Client Order ID], "forcedCompletionReason": [Forced Completion Reason] }

설명
ID 주문 고유번호
Status 주문 상태 (placed, completed, cancelled, updated)
Price 주문 가격
StopPrice 예약 주문 가격
Amount 주문 수량
Remaining Amount 미체결 주문 수량
Trading Pair 거래쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Type 주문 종류 (limit: 지정가, market: 시장가)
Side 주문 구분 (buy: 구매 또는 sell: 판매)
Created At 주문 시간
Time In Force 지정가 주문 유형 (gtc,po,ioc,fok)
Protection 최초 체결가 기준 ±10% 초과 되는 주문 취소 (yes, no)
Client Order ID 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능). 주문 조회시 사용자 지정 주문번호를 사용할 수 있습니다.
Forced Completion Reason 특정 시장가 주문 오더타입이나 주문 프로텍션 기능을 사용할 경우 주문이 완료된 사유

주문 ID로 주문 취소하기

주문 ID나 사용자 지정 주문 ID로 주문을 취소할 수 있습니다.

결과 :

{}

HTTP 요청

DELETE /orders/<Order Id> DELETE /orders?clientOrderId=[Client Order ID]

URL 파라미터

파라미터 설명
Order Id 주문 고유번호

Query 파라미터

파라미터 필수 여부 설명
Client Order ID 선택 사용자 지정 주문번호 (최대 20자, [a-zA-Z0-9_-] 문자열 사용 가능). 주문 조회시 사용자 지정 주문번호를 사용할 수 있습니다.

사용자 거래 기록 조회하기

GOPAX 사용자의 거래 기록을 반환합니다.

결과 :

[
  {
    "id": 23152,
    "orderId": 23712,
    "baseAmount": 0.00968007,
    "quoteAmount": 99999.963135,
    "fee": 0,
    "price": 10330500,
    "timestamp": "2018-03-10T16:07:32.000Z",
    "side": "buy",
    "tradingPairName": "BTC-KRW"
  }, {
    "id": 23302,
    "orderId": 23916,
    "baseAmount": 0.00149051,
    "quoteAmount": 15399.94932,
    "fee": 0,
    "price": 10332000,
    "timestamp": "2018-03-10T16:03:54.000Z",
    "side": "buy",
    "tradingPairName": "BTC-KRW"
  }
]

HTTP 요청

GET /trades?limit=[limit]&pastmax=[pastmax]&latestmin=[latestmin]&after=[after]&before=[before]

Query 파라미터

파라미터 필수 여부 설명
limit 선택 반환되는 항목의 갯수 (최대 100)
pastmax 선택 이 ID보다 오래된 데이터를 조회
latestmin 선택 이 ID보다 새로운 최신 데이터를 조회
after 선택 이 타임스탬프 이후의 데이터를 조회 (ms 단위)
before 선택 이 타임스탬프 이전의 데이터를 조회 (ms 단위)

결과값 설명

{ "id": [ID], "orderId": [Order ID], "baseAmount": [Base Amount], "quoteAmount": [Quote Amount], "fee": [Fee], "price": [Price], "timestamp": [Timestamp], "side": [Side], "tradingPairName": [Trading Pair] }

설명
ID 거래 고유번호
Order ID 주문 고유번호
Base Amount 주문한 자산의 수량 (구매시 Fee 가 포함된 수량)
Quote Amount 결제한 자산의 수량 (거래 수량 * 주문 가격, 판매시 Fee 가 포함된 금액)
Fee 거래 수수료
Price 주문 가격
Timestamp 거래 체결 시간
Side 거래 체결 종류 (buy 또는 sell)
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.

인증이 필요하지 않은 API

자산 목록 조회하기

GOPAX 지갑에서 취급하는 모든 자산의 목록을 조회할 수 있습니다.

결과 :

[
  {
    "id": "KRW",
    "name": "대한민국 원"
  }, {
    "id": "ETH",
    "name": "이더리움"
  }, {
    "id": "BTC",
    "name": "비트코인"
  }
]

HTTP 요청

GET /assets

결과값 설명

{ "id": [ID], "name": [Name] }

설명
ID 자산 아이디
Name 자산 이름

거래쌍 목록 조회하기

GOPAX 거래소에서 취급하는 모든 거래쌍의 목록을 조회할 수 있습니다.

결과 :

[
  {
    "name": "ETH-KRW",
    "baseAsset": "ETH",
    "quoteAsset": "KRW"
  }, {
    "name": "BTC-KRW",
    "baseAsset": "BTC",
    "quoteAsset": "KRW"
  }, {
    "name": "BCH-KRW",
    "baseAsset": "BCH",
    "quoteAsset": "KRW"
  }
]

HTTP 요청

GET /trading-pairs

결과값 설명

{ "id": [ID], "name": [Name], "baseAsset": [Base Asset], "quoteAsset": [Quote Asset] }

설명
ID 거래쌍 고유번호
Name 거래쌍 이름
Base Asset 주문하는 자산 아이디
Quote Asset 결제하는 자산 아이디

Ticker 조회하기

GOPAX 거래쌍에 대해 최근 체결된 거래의 티커를 조회할 수 있습니다. 티커에 대한 설명은 다음을 참조할 수 있습니다. https://www.investopedia.com/ask/answers/12/what-is-a-stock-ticker.asp

결과 :

{
  "price": 10194500,
  "ask": 10195000,
  "bid": 10184500,
  "volume": 1752.05558316,
  "time": "2018-03-14T03:50:41.184Z"
}

HTTP 요청

GET /trading-pairs/<Trading Pair>/ticker

URL 파라미터

파라미터 설명
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다

결과값 설명

{ "price": [Price], "volume": [Volume], "bid": [Bid], "ask": [Ask], "bidVolume": [Bid Volume], "askVolume": [Ask Volume] }

설명
Price 거래쌍 가격
Volume 거래쌍 거래량
Bid 주문하는 자산 아이디
Ask 결제하는 자산 아이디

Orderbook 조회하기

GOPAX 거래쌍에 대해 오더북의 상태를 조회할 수 있습니다.

결과 :

{
  "ask": [
    ["6915204", 11750000, 0.00502585],
    ["6653192", 11760000, 1.5095297],
    ["7396549", 11764000, 2.06163009],
    ["6511609", 11779000, 0.00502585],
    ["6006245", 11783000, 0.00043595],
    ["4892806", 11785000, 0.15],
    ["7408873", 11800000, 2.556479],
    ["4364772", 11802000, 0.003]
  ],
  "bid": [
    ["7472733", 11434000, 0.389],
    ["7475050", 11431000, 0.404],
    ["7472998", 11426000, 0.043],
    ["7472436", 11425000, 0.435],
    ["7476623", 11423000, 0.521],
    ["7475983", 11422000, 0.34966115],
    ["7472231", 11421000, 0.043]
  ],
  "sequence": 7476694
}

HTTP 요청

GET /trading-pairs/<Trading Pair>/book GET /trading-pairs/<Trading Pair>/book?level=[Level]

URL 파라미터

파라미터 설명
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다

Query 파라미터

파라미터 필수 여부 기본값 설명
Level 선택 3 호가창의 상세정보 수준

1 = 매수호가 및 매도호가
2 = 매수 및 매도 주문 각 50개
기타 = 호가창 전체

결과값 설명

{ "sequence": [Sequence], "bid": [[OrderBookEntryId], [Price], [Volume]], "ask": [[OrderBookEntryId], [Price], [Volume]] }

설명
Sequence 오더북의 마지막 엔트리 고유번호
OrderBookEntryId 오더북 엔트리 고유번호
Price 해당 오더북 엔트리 가격
Volume 해당 오더북 엔트리 물량

최근 체결 거래 조회하기

GOPAX 거래쌍에 대해 최근 발생한 체결 거래들을 조회할 수 있습니다.

결과 :

[
  {
    "time": "2018-03-14T04:01:17.000Z",
    "date": 1521000077,
    "id": 6436174,
    "price": 10163000,
    "amount": 0.38115097,
    "side": "sell"
  }, {
    "time": "2018-03-14T04:01:17.000Z",
    "date": 1521000077,
    "id": 6436173,
    "price": 10164500,
    "amount": 0.12818829,
    "side": "sell"
  }, {
    "time": "2018-03-14T04:01:11.000Z",
    "date": 1521000071,
    "id": 6436171,
    "price": 10163000,
    "amount": 0.098,
    "side": "sell"
  }
]

HTTP 요청

GET /trading-pairs/<Trading Pair>/trades?limit=[limit]&pastmax=[pastmax]&latestmin=[latestmin]&after=[after]&before=[before]

URL 파라미터

파라미터 설명
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다

Query 파라미터

파라미터 필수 여부 설명
limit 선택 반환되는 항목의 갯수 (최대 100)
pastmax 선택 이 ID보다 오래된 데이터를 조회
latestmin 선택 이 ID보다 새로운 최신 데이터를 조회
after 선택 이 타임스탬프 이후의 데이터를 조회 (ms 단위)
before 선택 이 타임스탬프 이전의 데이터를 조회 (ms 단위)

결과값 설명

{ "time": [Time], "id": [ID], "price": [Price], "amount": [Amount], "side": [Side] }

설명
Time 거래 체결 시각
ID 거래 체결 고유번호
Price 거래 체결 가격
Amount 거래 체결 수량
Side 거래 체결 종류 (buy 또는 sell)

최근 24시간 통계 조회하기

GOPAX 거래쌍에 대해 최근 24시간의 통계치를 조회할 수 있습니다.

결과 :

{
  "open": 10297000,
  "high": 10362500,
  "low": 9901000,
  "close": 10089500,
  "volume": 1700.84866009,
  "time": "2018-03-14T05:02:37.337Z"
}

HTTP 요청

GET /trading-pairs/<Trading Pair>/stats

결과값 설명

{ "open": [Open], "high": [High], "low": [Low], "close": [Close], "volume": [Volume], "time": [Time] }

설명
Open 24시간 전의 가격
High 24시간 동안의 최고가
Low 24시간 동안의 최저가
Close 현재가 (1분마다 갱신)
Volume 24시간 동안의 거래량
Time 최근 데이터 갱신 시각

모든 거래쌍의 최근 24시간 통계 조회하기

GOPAX 모든 거래쌍에 대해 최근 24시간의 통계치를 조회할 수 있습니다.

결과 :

[
  {
    "name": "ETH-KRW",
    "open": 780000,
    "high": 784000,
    "low": 756000,
    "close": 763500,
    "volume": 1602.93236136,
    "time": "2018-03-14T05:13:08.364Z"
  }, {
    "name": "BTC-KRW",
    "open": 10308000,
    "high": 10362500,
    "low": 9901000,
    "close": 10074000,
    "volume": 1687.88476801,
    "time": "2018-03-14T05:12:08.245Z"
  }, {
    "name": "BCH-KRW",
    "open": 1234000,
    "high": 1234000,
    "low": 1120000,
    "close": 1149500,
    "volume": 35.12077207,
    "time": "2018-03-14T04:40:06.535Z"
  }
]

HTTP 요청

GET /trading-pairs/stats

결과값 설명

{ "name": [Trading Pair], "open": [Open], "high": [High], "low": [Low], "close": [Close], "volume": [Volume], "time": [Time] }

설명
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
Open 24시간 전의 가격
High 24시간 동안의 최고가
Low 24시간 동안의 최저가
Close 현재가 (1분마다 갱신)
Volume 24시간 동안의 거래량
Time 최근 데이터 갱신 시각

과거 기록 조회하기

GOPAX 거래쌍에 대해 과거 통계치를 조회할 수 있습니다.

결과 :

[
  [
    1521004020000,
    10081000,
    10081000,
    10081000,
    10081000,
    0.0398393
  ],
  [
    1521004080000,
    10081000,
    10081000,
    10081000,
    10081000,
    0.01
  ]
]

HTTP 요청

GET /trading-pairs/<Trading Pair>/candles?start=<Start>&end=<End>&interval=<Interval>

URL 파라미터

파라미터 설명
Trading Pair 거래 쌍. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.

Query 파라미터

파라미터 필수 여부 설명
Start 필수 시작 시점 Timestamp (밀리세컨드 단위)
End 필수 종료 시점 Timestamp (밀리세컨드 단위)
Interval 필수 희망하는 시간 간격 (분 단위, 1/5/30/1440)

결과값 설명

[ [ [Time], [Low], [High], [Open], [Close], [Volume] ], [ 1521004080000, 10081000, 10081000, 10081000, 10081000, 0.01 ] ]

설명
Time 최근 데이터 갱신 시각
Low 24시간 동안의 최저가
High 24시간 동안의 최고가
Open 24시간 전의 가격
Close 현재가 (1분마다 갱신)
Volume 24시간 동안의 거래량

© Streami, Inc. 모든 권리 보유.

에러

HTTP Status (응답 코드)

오류 코드 설명
400 잘못된 요청 - 요청 형식이 유효하지 않음
401 권한 없음 - 잘못된 API 키
403 금지됨 - 요청한 리소스에 대한 접근 권한이 없음
404 찾을 수 없음
429 요청 한도 초과 - API 호출 횟수 제한 초과
500 내부 서버 오류 - 서버에 문제가 발생함

GOPAX 오류

오류 코드 설명
100, 106 자산 이름(Asset Name)이 올바르지 않음. 자산 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
103 주문 종류(Type)가 올바르지 않음.
101, 104 거래 쌍(Trading Pair)이 올바르지 않음. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
105 거래 쌍(Trading Pair)이 일시적으로 비활성화 되어있음. 거래쌍 목록 조회하기에서 전체 목록을 확인할 수 있습니다.
107 주문 수량이 올바르지 않음.
108 주문 가격이 올바르지 않음.
201 주문을 위한 잔고가 부족.
202 주문 고유번호가 일치하지 않음.
203 주문 수량 X 주문 가격이 너무 큼.
204 현재 매수 주문이 허용되지 않음. 공지사항을 확인하십시오.
206 주문 옵션들이 서로 상충됨.
10010 출금지갑주소가 올바르지 않음.
10041 거래소가 올바르지 않음.
10155 API키가 올바르지 않음.
10202 주문 결제 수량이 부족.