Upbit

CryptoExchangeAPIs.Upbit.UpbitClientType
UpbitClient <: AbstractAPIsClient

Client info.

Required fields

  • base_url::String: Base URL for the client.

Optional fields

  • public_key::String: Public key for authentication.
  • secret_key::String: Secret key for authentication.
  • interface::String: Interface for the client.
  • proxy::String: Proxy information for the client.
  • account_name::String: Account name associated with the client.
  • description::String: Description of the client.
source
CryptoExchangeAPIs.Upbit.UpbitAPIErrorType
UpbitAPIError{T} <: AbstractAPIsError

Exception thrown when an API method fails with code T.

Required fields in UpbitAPIsErrorMsg

  • name::Int64: Error code.
  • message::String: Error message.

Required fields

  • error::UpbitAPIsErrorMsg: Error struct.
source

Spot

CryptoExchangeAPIs.Upbit.Spot.DayCandle.day_candleFunction
day_candle(client::UpbitClient, query::DayCandleQuery)
day_candle(client::UpbitClient = Upbit.Spot.public_client; kw...)

Daily candle data.

GET v1/candles/days

Parameters:

ParameterTypeRequiredDescription
marketStringtrue
convertingPriceUnitStringfalse
countInt64falseMax: 200
toDateTimefalse

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.day_candle(;
    market = "KRW-BTC"
)

to_pretty_json(result.result)

Result:

[
  {
    "market":"KRW-BTC",
    "candle_acc_trade_price":2.0574363150768314e11,
    "candle_acc_trade_volume":2137.74569241,
    "candle_date_time_kst":"2024-03-25T09:00:00",
    "candle_date_time_utc":"2024-03-25T00:00:00",
    "change_price":-419000.0,
    "change_rate":-0.0043363968,
    "high_price":9.7e7,
    "low_price":9.56e7,
    "opening_price":9.6624e7,
    "prev_closing_price":9.6624e7,
    "timestamp":"2024-03-25T10:22:43.660999936",
    "trade_price":9.6205e7
  }
]
source
CryptoExchangeAPIs.Upbit.Spot.MarketList.market_listFunction
market_list(client::UpbitClient, query::MarketListQuery)
market_list(client::UpbitClient = Upbit.Spot.public_client; kw...)

Listing Market List

GET v1/market/all

Parameters:

ParameterTypeRequiredDescription
isDetailsBoolfalse

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.market_list()

to_pretty_json(result.result)

Result:

[
  {
    "market":"KRW-BTC",
    "english_name":"Bitcoin",
    "korean_name":"비트코인",
    "market_event":{
      "warning":false,
      "caution":{
        "PRICE_FLUCTUATIONS":false,
        "TRADING_VOLUME_SOARING":false,
        "DEPOSIT_AMOUNT_SOARING":false,
        "GLOBAL_PRICE_DIFFERENCES":false,
        "CONCENTRATION_OF_SMALL_ACCOUNTS":false
      }
    }
  },
  ...
]
source
CryptoExchangeAPIs.Upbit.Spot.OrderBook.order_bookFunction
order_book(client::UpbitClient, query::OrderBookQuery)
order_book(client::UpbitClient = Upbit.Spot.public_client; kw...)

Order book data

GET v1/orderbook

Parameters:

ParameterTypeRequiredDescription
marketsStringtrue

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.order_book(;
    markets = "KRW-BTC"
)

to_pretty_json(result.result)

Result:

[
  {
    "market":"KRW-BTC",
    "orderbook_units":[
      {
        "ask_price":9.6234e7,
        "ask_size":0.00612883,
        "bid_price":9.6228e7,
        "bid_size":0.36973888
      },
      ...
    ],
    "timestamp":"2024-03-25T10:34:07.163000064",
    "total_ask_size":1.74427302,
    "total_bid_size":1.46524011
  }
]
source
CryptoExchangeAPIs.Upbit.Spot.StatusWallet.status_walletFunction
status_wallet(client::UpbitClient, query::StatusWalletQuery)
status_wallet(client::UpbitClient; kw...)

Balance information.

GET v1/status/wallet

Parameters:

ParameteTypeRequiredDescription
signatureStringfalse

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.status_wallet() 

to_pretty_json(result.result)

Result:

[
  {
    "currency": "KLAY",
    "wallet_state": "working",
    "block_state": "normal",
    "block_height": 7235123,
    "block_updated_at": "2019-02-18T07:08:50.499+00:00",
    "block_elapsed_minutes": 2502349,
    "net_type": "KLAY",
    "network_name": "Klaytn"
  },
  ...
]
source
CryptoExchangeAPIs.Upbit.Spot.Ticker.tickerFunction
ticker(client::UpbitClient, query::TickerQuery)
ticker(client::UpbitClient = Upbit.Spot.public_client; kw...)

Returns a snapshot of the stock at the time of the request

GET v1/ticker

Parameters:

ParameterTypeRequiredDescription
marketsString OR Vector{String}true

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.ticker(;
    markets = "KRW-BTC"
)

to_pretty_json(result.result)

Result:

[
  {
    "market":"KRW-BTC",
    "acc_trade_price":2.1238782327620905e11,
    "acc_trade_price_24h":4.622074226861333e11,
    "acc_trade_volume":2206.86731219,
    "acc_trade_volume_24h":4823.01685822,
    "change":"FALL",
    "change_price":544000.0,
    "change_rate":0.0056300712,
    "high_price":9.7e7,
    "highest_52_week_date":"2024-03-14",
    "highest_52_week_price":1.05e8,
    "low_price":9.56e7,
    "lowest_52_week_date":"2023-06-15",
    "lowest_52_week_price":3.251e7,
    "opening_price":9.6624e7,
    "prev_closing_price":9.6624e7,
    "signed_change_price":-544000.0,
    "signed_change_rate":-0.0056300712,
    "timestamp":"2024-03-25T10:53:39.956999936",
    "trade_date":"2024-03-25",
    "trade_date_kst":"2024-03-25",
    "trade_price":9.608e7,
    "trade_time":"10:53:39",
    "trade_time_kst":"19:53:39",
    "trade_timestamp":"2024-03-25T10:53:39.924",
    "trade_volume":0.0198534
  }
]
source
CryptoExchangeAPIs.Upbit.Spot.Ticker.ticker_allFunction
ticker_all(client::UpbitClient, query::TickerAllQuery)
ticker_all(client::UpbitClient = Upbit.Spot.public_client; kw...)

Returns a snapshot of the all tickers at the time of the request

GET v1/ticker/all

Parameters:

ParameterTypeRequiredDescription
quoteCurrenciesStringtrue

Code samples:

using Serde
using CryptoExchangeAPIs.Upbit

result = Upbit.Spot.ticker_all(;
    quoteCurrencies = "BTC"
)

to_pretty_json(result.result)

Result:

[
  {
    "market":"BTC-ALT",
    "acc_trade_price":32.21413915723261,
    "acc_trade_price_24h":64.33381026,
    "acc_trade_volume":1.834787177510889e7,
    "acc_trade_volume_24h":3.697238710586164e7,
    "change":"FALL",
    "change_price":5.0e-8,
    "change_rate":0.0285714286,
    "high_price":1.85e-6,
    "highest_52_week_date":"2024-02-27",
    "highest_52_week_price":1.013e-5,
    "low_price":1.63e-6,
    "lowest_52_week_date":"2024-09-17",
    "lowest_52_week_price":1.24e-6,
    "opening_price":1.76e-6,
    "prev_closing_price":1.75e-6,
    "signed_change_price":-5.0e-8,
    "signed_change_rate":-0.0285714286,
    "timestamp":"2024-09-20T12:02:30.590000128",
    "trade_date":"2024-09-20",
    "trade_date_kst":"2024-09-20",
    "trade_price":1.7e-6,
    "trade_time":"12:02:17",
    "trade_time_kst":"21:02:17",
    "trade_timestamp":"2024-09-20T12:02:17.777999872",
    "trade_volume":2512.88823396
  },
  ...
]
source