Skip to content

verbose0/mexc-api-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: Proprietary Private Code Paid Access

🔷 MEXC Futures API Python

This unofficial MEXC Futures API library circumvents the ongoing maintenance limitations of the official endpoints, enabling complete access to trading and account features—even when certain routes are marked as 'Under maintenance'

🚀 API initialization

from MexcClient import MexcClient

client = MexcClient(api_key=os.getenv('YOUR_U_ID'), is_testnet=True)

orderShort = client.create_order({
    'symbol': 'BTC_USDT',
    'type': 5, # Market
    'side': 3, # Open Short
    'openType': 1, # Isolated
    'vol': 1,
    'leverage': 20,
    'stopLossPrice': 110000,
    'takeProfitPrice': 105000,
})

💥 Create Order Example

from MexcClient import MexcClient

client = MexcClient(api_key=os.getenv('YOUR_U_ID'), is_testnet=True)

order = client.create_order({
    'symbol': 'BTC_USDT',
    'type': 5, # Market
    'side': 3, # Open Short
    'openType': 1, # Isolated
    'vol': 1,
    'leverage': 20,
    'stopLossPrice': 110000,
    'takeProfitPrice': 105000,
})

💼 Available Methods

Method Description
get_symbols Get all available symbols
get_funding_rate Get funding rate daat for a symbol
get_index_price Get K-line data of the index price
get_ticker_price Get contract trend data
get_fair_price Get contract fair price
get_assets Get all informations of user's asset
get_asset_transfer_records Get the user's asset transfer records
get_positions_history Get the user’s history position information
get_open_positions Get the user's current holding position
get_open_orders Get the user's current pending order
get_orders_history Get all of the user's historical orders
create_order Create order
cancel_orders Cancel the orders
cancel_all_orders Cancel all uncompleted orders under a contract
get_trigger_orders Gets the trigger order list
create_trigger_order Trigger order
cancel_trigger_orders Cancel the trigger order
cancel_all_trigger_orders Cancel all trigger orders
get_stop_limit_orders Get the Stop-Limit order list
cancel_stop_limit_orders Cancel the Stop-Limit trigger order
cancel_all_stop_limit_orders Cancel all Stop-Limit price trigger orders
get_risk_limits Get risk limits
change_margin Increase or decrease margin
get_leverage Get leverage
change_leverage Switch leverage
close_all_positions Close all positions

▶️ Watch Demo Video: placing and cancelling a futures order

Contact me

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors