Skip to main content

zaifer

zaiferとは、ZaifAPIをPythonから呼び出すためのライブラリです。 webapiを利用するための煩雑な手続きを隠蔽し、 methodベースでZaifAPIを簡単に利用できます。

使い方

1.ZaifのアカウントページでAPIKeyを発行します。

APIKeyは第3者に明かさないよう大切に扱ってください。

2.pipコマンドを実行し、モジュールをダウンロードしてください。

pip install zaifer

3.クラスをインポートし、下記の通り使用してください。

from datetime import datetime
from decimal import Decimal

from zaifer import *


# Zaifのアカウント画面で取得したAPIキーを設定します。
key = 'aa75ffcc-6c72-4b54-a936-xxxxxxxxxxxx'
secret = '0fbe7367-0821-4417-9c65-xxxxxxxxxxxx'

# アカウント情報を取得します。
account = Account(key, secret)
print(account.get_info())
print(account.get_info2())
print(account.get_personal_info())
print(account.get_id_info())
print(account.withdraw('btc', '17A16QmavnUfCW11DAApiJxp7ARxxxxxxxx', Decimal('10.0'), None, Decimal('0.0005')))
print(account.get_deposit_history('jpy'))
print(account.get_withdraw_history('btc'))

# チャート情報を取得します。
chart = Chart()
print(chart.get_ohlc('btc_jpy', '60', datetime(
        2018, 11, 4, 0), datetime(2018, 11, 5, 0)))

# 現物取引のマーケット情報を取得します。
market = Market()
print(market.get_currencies('all'))
print(market.get_currency_pairs('btc_jpy'))
print(market.get_last_price('btc_jpy'))
print(market.get_ticker('btc_jpy'))
print(market.get_trade_history('btc_jpy'))
print(market.get_depth('btc_jpy'))

# 現物取引の注文情報を取得・送信します。
trade = Trade(key, secret)
print(trade.get_trade_history('btc_jpy', datetime(2018, 11, 5)))
print(trade.get_active_orders())
print(trade.open_order('btc_jpy', 'bid', Decimal('780000'), Decimal('1')))
print(trade.cancel_order(92537563))

# AirFXのマーケット情報を取得します。
airfx_market = AirFXMarket()
print(airfx_market.get_last_price())
print(airfx_market.get_ticker())
print(airfx_market.get_trade_history())
print(airfx_market.get_depth())
print(airfx_market.get_swap_history())

# AirFXの注文情報を取得・送信します。
airfx_trade = AirFXTrade(key, secret)
print(airfx_trade.get_positions())
print(airfx_trade.get_position_history(2864))
print(airfx_trade.get_active_positions())
print(airfx_trade.create_position('bid', 420100, 1, 4))
print(airfx_trade.update_position(22904, 720000))
print(airfx_trade.cancel_position(22905))

関連情報

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zaifer-1.2.0.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file zaifer-1.2.0.tar.gz.

File metadata

  • Download URL: zaifer-1.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for zaifer-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8f72f0620c4ac2cb63619b089149d30844f47281d6331d3aa81d7acb75b4a170
MD5 094bad8df6b0d37530569cfe7989bfd8
BLAKE2b-256 6ae66e1f063e5d64ca23fdcf5144ecbe70d0c19a878a3b262eab05971540ae69

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 file

1.1.8

1 file

1.1.7

1 file

1.1.6

1 file

1.1.5

1 file

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.9

1 file

1.0.8

1 file

1.0.7

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page