Skip to content

Repository files navigation

ZAIF

Exchange plugin for bt_api framework — Japanese cryptocurrency exchange.

PyPI VersionPython VersionsLicenseCIDocs


English | 中文

Overview

Zaif is a Japanese cryptocurrency exchange licensed by the Japan Financial Services Agency (FSA), offering JPY trading pairs for Bitcoin and other cryptocurrencies. This plugin integrates Zaif into the bt_api unified trading framework, supporting SPOT markets.

Features

  • REST API — market data queries, order management, account queries
  • JPY trading pairs — supports JPY (Japanese Yen) trading pairs
  • Japanese market focus — licensed exchange compliant with Japanese regulations
  • Simple API key auth — standard API key + secret authentication

Exchange Code

CodeDescriptionAsset Type
ZAIF___SPOTZaif spot marketsSPOT

Installation

pip install bt_api_zaif

Or install from source:

git clone https://github.com/cloudQuant/bt_api_zaif
cd bt_api_zaif
pip install -e .

Quick Start

frombt_apiimportBtApiapi=BtApi(
exchange_kwargs={
"ZAIF___SPOT": {
"api_key": "your_api_key",
"secret": "your_secret",
}
}
)
# Get ticker dataticker=api.get_tick("ZAIF___SPOT", "BTC_JPY")
print(ticker)
# Get order bookdepth=api.get_depth("ZAIF___SPOT", "BTC_JPY", count=20)
print(depth)
# Get klinesbars=api.get_kline("ZAIF___SPOT", "BTC_JPY", period="1h", count=100)
print(bars)

Supported Operations

OperationStatusDescription
TickerReal-time price and 24h statistics
OrderBook/DepthMarket depth and order book
Klines/BarsHistorical OHLCV data
Exchange InfoTrading rules and symbol info
BalanceAccount balance queries
AccountAccount information
Make OrderPlace limit/market orders
Cancel OrderCancel existing orders

API Reference

Feed — ZaifRequestDataSpot

Inherits from ZaifRequestData. Access via BtApi.

api.get_tick("ZAIF___SPOT", "BTC_JPY") # Tickerapi.get_depth("ZAIF___SPOT", "BTC_JPY") # Order bookapi.get_kline("ZAIF___SPOT", "BTC_JPY") # Klinesapi.get_exchange_info("ZAIF___SPOT") # Exchange info

Container — ZaifExchangeDataSpot

Exchange metadata and configuration.

frombt_api_zaifimportZaifExchangeDataSpotinfo=ZaifExchangeDataSpot()
print(info.get_rest_url()) # https://api.zaif.jpprint(info.get_wss_url()) # wss://ws.zaif.jp:8888print(info.get_kline_periods()) # { "1m": "1", "5m": "5", ... }

REST Endpoints

ActionPathMethod
ticker/api/1/ticker/{symbol}GET
depth/api/1/depth/{symbol}GET
trades/api/1/trades/{symbol}GET
candles/api/1/candles/{symbol}GET
markets/api/1/marketsGET
balance/api/1/account_balanceGET

Architecture

bt_api_zaif/
├── src/bt_api_zaif/
│ ├── containers/ # ZaifExchangeDataSpot
│ ├── feeds/ # ZaifRequestDataSpot
│ ├── exchange_data/ # Exchange metadata
│ ├── errors/ # Error translation
│ └── plugin.py # register_zaif()
└── docs/
└── index.md # Bilingual API docs

Requirements

  • Python 3.9+
  • bt_api_base >= 0.15

Online Documentation

ResourceLink
Full Docshttps://bt-api-zaif.readthedocs.io/
Chinese Docshttps://bt-api-zaif.readthedocs.io/zh/latest/
GitHub Repositoryhttps://github.com/cloudQuant/bt_api_zaif
Issue Trackerhttps://github.com/cloudQuant/bt_api_zaif/issues

License

MIT License — see LICENSE for details.


中文

概述

Zaif 是一家受 日本金融厅 (FSA) 许可的 日本加密货币交易所,提供比特币和其他加密货币的日元(JPY)交易对。本插件将 Zaif 接入 bt_api 统一交易框架,支持 现货 (SPOT) 市场。

功能特点

  • REST API — 行情查询、订单管理、账户查询
  • 日元交易对 — 支持 JPY(日本円)交易对
  • 日本市场监管 — 合规持牌交易所
  • 简单 API Key 认证 — 标准 API Key + Secret 认证方式

交易所代码

代码描述资产类型
ZAIF___SPOTZaif 现货市场SPOT

安装

pip install bt_api_zaif

或从源码安装:

git clone https://github.com/cloudQuant/bt_api_zaif
cd bt_api_zaif
pip install -e .

快速开始

frombt_apiimportBtApiapi=BtApi(
exchange_kwargs={
"ZAIF___SPOT": {
"api_key": "your_api_key",
"secret": "your_secret",
}
}
)
# 获取行情ticker=api.get_tick("ZAIF___SPOT", "BTC_JPY")
print(ticker)
# 获取订单簿depth=api.get_depth("ZAIF___SPOT", "BTC_JPY", count=20)
print(depth)
# 获取K线bars=api.get_kline("ZAIF___SPOT", "BTC_JPY", period="1h", count=100)
print(bars)

支持的操作

操作状态说明
行情 (Ticker)实时价格和24小时统计
订单簿 (OrderBook)市场深度和挂单
K线 (Klines)历史OHLCV数据
交易所信息交易规则和交易对信息
余额 (Balance)账户余额查询
账户 (Account)账户信息
下单 (Make Order)限价/市价下单
撤单 (Cancel Order)取消现有订单

API 参考

Feed — ZaifRequestDataSpot

继承自 ZaifRequestData,通过 BtApi 访问。

api.get_tick("ZAIF___SPOT", "BTC_JPY") # 行情api.get_depth("ZAIF___SPOT", "BTC_JPY") # 订单簿api.get_kline("ZAIF___SPOT", "BTC_JPY") # K线api.get_exchange_info("ZAIF___SPOT") # 交易所信息

Container — ZaifExchangeDataSpot

交易所元数据和配置。

frombt_api_zaifimportZaifExchangeDataSpotinfo=ZaifExchangeDataSpot()
print(info.get_rest_url()) # https://api.zaif.jpprint(info.get_wss_url()) # wss://ws.zaif.jp:8888print(info.get_kline_periods()) # { "1m": "1", "5m": "5", ... }

REST 端点

动作路径方法
ticker/api/1/ticker/{symbol}GET
depth/api/1/depth/{symbol}GET
trades/api/1/trades/{symbol}GET
candles/api/1/candles/{symbol}GET
markets/api/1/marketsGET
balance/api/1/account_balanceGET

项目结构

bt_api_zaif/
├── src/bt_api_zaif/
│ ├── containers/ # ZaifExchangeDataSpot
│ ├── feeds/ # ZaifRequestDataSpot
│ ├── exchange_data/ # 交易所元数据
│ ├── errors/ # 错误翻译
│ └── plugin.py # register_zaif()
└── docs/
└── index.md # 中英文API文档

系统要求

  • Python 3.9+
  • bt_api_base >= 0.15

在线文档

资源链接
完整文档https://bt-api-zaif.readthedocs.io/
中文文档https://bt-api-zaif.readthedocs.io/zh/latest/
GitHub 仓库https://github.com/cloudQuant/bt_api_zaif
问题反馈https://github.com/cloudQuant/bt_api_zaif/issues

许可证

MIT 许可证 — 详见 LICENSE

About

Exchange adapter package for bt_api

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages