Skip to content
MAX Exchange API python3 implementation for automated trading
Branch: master
Clone or download
Latest commit c063d03 Jun 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update issue templates Jun 17, 2019
examples Initial commit Jun 17, 2019
max Initial commit Jun 17, 2019
.gitignore Initial commit Jun 17, 2019
LICENSE Initial commit Jun 10, 2019
README.md Initial commit Jun 17, 2019

README.md

max-exchange-api-python3

Warning

This is an UNOFFICIAL wrapper for MAX exchange HTTP API v2 written in Python 3.6

USE THIS WRAPPER AT YOUR OWN RISK, I WILL NOT CORRESPOND TO ANY LOSES

Features

  • Implementation of all public and private endpoints
  • Simple handling of authentication with API key and secret
  • All HTTP raw requests and responses can be found here

Donate

If you feel this wrapper saved your lifes, buy me a coffee ?

  • BTC: 3GEvzXZpAEoW8ZT5PYsj6rfnq1wGQnAkQY
  • ETH: 0x7b91ac177aba5fc8f73b915d62c895296f6e93c4
  • LTC: LW13jRjsyfUXHxyNLQGd1UTAsgerY9iHuc
  • MAX: 0x7b91ac177aba5fc8f73b915d62c895296f6e93c4
  • USDT: 177YJBfn412AuaFmJc5m24Km5pF7Ufvm53

Example

  1. Register an account with MAX exchange (referral link)
  2. Generate API key and secret, assign relevant permissions to it
  3. Clone this repository, and run examples/all_api_endpoints.py
  4. Write your own trading policies and get profits !
cd ~/ && git clone https://github.com/kulisu/max-exchange-api-python3
cd ~/max-exchange-api-python3 && cp examples/all_api_endpoints.py .

# update API key and secret
# vim all_api_endpoints.py

python3 all_api_endpoints.py
#!/usr/bin/env python3

from max.client import Client

if __name__ == '__main__':
    client = Client('PUY_MY_API_KEY_HERE', 'PUY_MY_API_SECRET_HERE')

    try:
        # Public (Read)
        result = client.get_public_all_currencies()
        print(f"[I] Invoked get_public_all_currencies() API Result: \n    {result}\n")

        result = client.get_public_k_line('maxtwd', 2, 60)
        print(f"[I] Invoked get_public_k_line('maxtwd', 2, 60) API Result: \n    {result}\n")

        result = client.get_public_pair_depth('maxtwd', 2)
        print(f"[I] Invoked get_public_pair_depth('maxtwd', 2) API Result: \n    {result}\n")

        result = client.get_public_server_time()
        print(f"[I] Invoked get_public_server_time() API Result: \n    {result}\n")

        result = client.get_public_withdrawal_constraints()
        print(f"[I] Invoked get_public_withdrawal_constraints() API Result: \n    {result}\n")

        # Private (Read)
        result = client.get_private_account_balances()
        print(f"[I] Invoked get_private_account_balances() API Result: \n    {result}\n")

        result = client.get_private_deposit_history()
        print(f"[I] Invoked get_private_deposit_history() API Result: \n    {result}\n")

        result = client.get_private_max_rewards()
        print(f"[I] Invoked get_private_max_rewards() API Result: \n    {result}\n")

        result = client.get_private_member_profile()
        print(f"[I] Invoked get_private_member_profile() API Result: \n    {result}\n")

        result = client.get_private_order_history('maxtwd', ['cancel', 'wait', 'done'])
        print(f"[I] Invoked get_private_order_history('maxtwd', ['cancel', .., 'done']) API Result: \n    {result}\n")

        result = client.get_private_reward_history()
        print(f"[I] Invoked get_private_reward_history() API Result: \n    {result}\n")

        result = client.get_private_trade_history('maxtwd')
        print(f"[I] Invoked get_private_trade_history('maxtwd') API Result: \n    {result}\n")

        result = client.get_private_transfer_history()
        print(f"[I] Invoked get_private_transfer_history() API Result: \n    {result}\n")

        result = client.get_private_withdrawal_history()
        print(f"[I] Invoked get_private_withdrawal_history() API Result: \n    {result}\n")
    except Exception as error:
        print(f"[X] {str(error)}")

        # Networking errors occurred here
        response = getattr(error, 'read', None)
        if callable(response):
            print(f"[X] {response().decode('utf-8')}")
You can’t perform that action at this time.