Skip to content

gbrunner/python-api-for-okcoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-api-for-okcoin

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.

Python API for okcoin Quickstart

Install the API

pip install okcoin-GBRUNNER

Register an API Key with okcoin

  1. Go to API.
  2. 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.

Create an auth.config file

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

Import classes from okcoin

from okcoin import Account
acc  = Account('auth.config')

Use the API!

ledger = acc.get_ledger()
ledger.df

About

A python API to interact with okcoin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages