Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
AscendEx
Backpack
BigONE
Binance
Bitfinex
bitFlyer
Bitget
Bithumb
Bitstamp
Bybit
Coincheck
Coinone
CoinW
Crypto.com
DeepCoin
Deribit
DigiFinex
Gate
Gemini
HashKey
HitBTC
HTX
Korbit
Kraken
KuCoin
LBank
MEXC
OKX
Poloniex
Upbit
WEEX
WOO X
Zaif
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Spot trading on the Japanese exchange Zaif (API address https://api.zaif.jp). It uses REST only, with no market-data or order push. Private endpoints (/tapi) are signed with a Zaif API key (Access Key and Secret Key). The exchange has no K-line or all-market ticker endpoint, supports GTC limit orders only, and does not support conditional orders or order amendment.

Names and Configuration

exchange.GetName(): Zaif (Spot).

FieldRequired
Access KeyYes
Secret KeyYes

Trading Pairs and Contract Codes

Pair examples: BTC_JPY, ETH_JPY

Trading pairs are written BASE_QUOTE, matching the Zaif native code btc_jpy. For pairs whose currency names contain . (such as the native polygon.mv_jpy), write the . in the currency name as -: POLYGON-MV_JPY; exchange.GetMarkets() and the account assets return currency names in the same form.

Function Support

Not supported (the call fails with an error and returns null): exchange.GetTickers, exchange.ModifyOrder, exchange.CreateConditionOrder, exchange.ModifyConditionOrder, exchange.CancelConditionOrder, exchange.GetConditionOrder, exchange.GetConditionOrders, exchange.GetHistoryConditionOrders.

Served through a fallback:

  • exchange.GetRecords: The exchange has no K-line endpoint; bars are synthesized by the docker from trades. The first call covers only the few bars spanned by recent trades, and more accumulate with later calls.
  • exchange.GetOrder: The exchange has no single-order query interface, so the order is looked up among the current open orders and the historical orders. The historical orders are rebuilt from trade records whose Id is not guaranteed to equal the order ID, so a completed order may not be found.

Notes
  • Market orders are not supported, only GTC limit orders: a tif of ioc or fok, or postOnly, fails.
  • Without the symbol argument, exchange.GetOrders() queries the current trading pair only. The returned open orders carry no fill information, so DealAmount is 0.
  • Zaif has no order history endpoint, so exchange.GetHistoryOrders() is rebuilt from the trade history (trade_history): each trade is returned as a filled order, with Price and AvgPrice set to that trade's price, Amount and DealAmount set to that trade's amount, and Type set to this account's side in the trade (the trade's aggressor side for self-trades). Trade records carry no order ID, so an order filled in several trades shows up as several rows that cannot be merged; Id is the trade record's number and is not guaranteed to equal the order ID returned when the order was placed; orders cancelled without any fill never appear, and an order cancelled after a partial fill shows only the filled part. Without limit, at most 100 rows are returned; since is passed to the exchange with second precision, and with it the earliest records after that time are returned, without it the most recent ones. Without symbol, regular pairs and token pairs (the exchange's is_token) are queried once each and merged; the exchange allows at most 12 calls to this endpoint per 60 seconds.
  • exchange.GetTicker() has no opening price (Open is 0), and the exchange gives no ticker time, so Time is the local time.