A Python API for interacting with okcoin. The API returns account information as
pandas dataframes and plotly graph objects
where possible. The API currently only supports reading from the account.
pip install okcoin-GBRUNNER
Register an API Key with okcoin
- Go to API.
- Click Create API Key
- Give your key a Label.
- Give your key a passphrase.
- Select Read for Permissions (The current Python API only supports Read).
- Get a code via SMS.
- Click Confirm.
Your auth.config file must contain the following fields:
[DEFAULT]
api_key=YOUR_API_KEY
secret_key=YOUR SECRET_KEY
pass_phrase=
If the pass_phrase is not included in your auth.config file, you will be prompted to enter it when connecting to your account. Optionally, you can add the pass_phrase into your auth.config file as follows:
[DEFAULT]
api_key=YOUR_API_KEY
secret_key=YOUR SECRET_KEY
pass_phrase=YOUR_PASS_PHRASE
from okcoin import Account
acc = Account('auth.config')
ledger = acc.get_ledger()
ledger.df