Coder Social home page Coder Social logo

kulisu / max-exchange-api-python3 Goto Github PK

View Code? Open in Web Editor NEW
32.0 6.0 12.0 47 KB

MAX Exchange API python3 implementation for automated trading

License: MIT License

Python 100.00%
max maicoin cryptocurrency exchange http restful api python3 trading

max-exchange-api-python3's Introduction

max-exchange-api-python3

Warning

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

And this wrapper does not receive active maintainance, plaese consider using CCXT

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

Usage

  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 strategies and get profits !

Linux

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

Windows

cd %USERPROFILE%\Downloads
git clone https://github.com/kulisu/max-exchange-api-python3

cd max-exchange-api-python3 && copy examples\all_api_endpoints.py .

# update API key and secret
# notepad all_api_endpoints.py

python3 all_api_endpoints.py

Example

#!/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')}")

Donation

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

  • BTC: 32awSDjEY8V3KYS3bazLjSsu6SB3JiQcDi
  • ETH: 0xAC2a7571EBA8986e4Ec9bA1A81Cde323c959c614
  • LTC: 3CAJbZ2RbHa2xGtTD42qs3ZDFfHhMM7mF8
  • MAX: 0xAC2a7571EBA8986e4Ec9bA1A81Cde323c959c614
  • USDT: 34yVszuBhejsbSfnULK187srAhGkoeWgL6

max-exchange-api-python3's People

Contributors

kulisu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.