Skip to main content

bitmart crypto exchange api client

Project description

bitmart-python

Python SDK (sync and async) for Bitmart with Rest and WS capabilities.

You can check Bitmart's docs here: Docs

You can check the SDK docs here: SDK

This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly

Installation

pip install bitmart

Usage

Sync

from bitmart import BitmartSync

def main():
    instance = BitmartSync({})
    ob =  instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = instance.fetch_balance()
    # order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

Async

import asyncio
from bitmart import BitmartAsync

async def main():
    instance = BitmartAsync({})
    ob =  await instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = await instance.fetch_balance()
    # order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

asyncio.run(main())

Websockets

from bitmart import BitmartWs

async def main():
    instance = BitmartWs({})
    while True:
        ob = await instance.watch_order_book("BTC/USDC")
        print(ob)
        # orders = await instance.watch_orders("BTC/USDC")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitmart-0.0.10.tar.gz (567.7 kB view details)

Uploaded Source

Built Distribution

bitmart-0.0.10-py3-none-any.whl (1.5 kB view details)

Uploaded Python 3

File details

Details for the file bitmart-0.0.10.tar.gz.

File metadata

  • Download URL: bitmart-0.0.10.tar.gz
  • Upload date:
  • Size: 567.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for bitmart-0.0.10.tar.gz
Algorithm Hash digest
SHA256 a6b7e4968f5d9068dd9739260eec470b65a572059ab001e2321c55d5ba15a3a3
MD5 f1671da672915d5817b52c3c4be6aac0
BLAKE2b-256 1cade56ca0969d5295882591704b0a705c12b19ceec7db7c132501ff5bd9b838

See more details on using hashes here.

File details

Details for the file bitmart-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: bitmart-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 1.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for bitmart-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f85622cfecc27c6f958862423accd7b3cec946e3264885c3251cc21560a652b5
MD5 87ae5fe8ccbb60c9078aaf3bac63b25e
BLAKE2b-256 8150932a436b93455db8b5d0d31f528dc0232a874b20c89c122b55fd3862c91e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page