23 lines
664 B
Python
23 lines
664 B
Python
from mexc_api.spot import Spot
|
|
|
|
def test_mexc_api():
|
|
try:
|
|
# Initialize client with empty API keys for public endpoints
|
|
client = Spot("", "")
|
|
|
|
# Test server time endpoint
|
|
server_time = client.market.server_time()
|
|
print(f"Server time: {server_time}")
|
|
|
|
# Test ticker price endpoint
|
|
ticker = client.market.ticker_price("ETHUSDT")
|
|
print(f"ETH/USDT price: {ticker}")
|
|
|
|
print("MEXC API is working correctly!")
|
|
return True
|
|
except Exception as e:
|
|
print(f"Error testing MEXC API: {e}")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
test_mexc_api() |