Skip to main content

bitmart crypto exchange api client

Project description

bitmart-python

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

You can check the SDK docs here: SDK You can check Bitmart's docs here: Docs

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.11.tar.gz (567.7 kB view details)

Uploaded Source

Built Distribution

bitmart-0.0.11-py3-none-any.whl (690.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitmart-0.0.11.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.11.tar.gz
Algorithm Hash digest
SHA256 5b6c3f24435e4b68d6553d824b4385ba0baf15f97313a714a9b3e04d63675f4d
MD5 9ff44b9762e2cddcdd94cbaf635883c7
BLAKE2b-256 7c06ac8bc46517bbc3637676bc6caf5d4f49e78b6b50961621dda256be4707d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitmart-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 690.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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 487f777bb96f0a0c226212dd43c38c6a37b95fb62d7fb70c8d76764bcadc97b4
MD5 b8f71021dadde26487fa6682dd89eaf4
BLAKE2b-256 f1669c413e510ecbc6f76bd9fd0d3787a55c91560a599e6b8914ca6c4403ecb4

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