Skip to main content

Python client library for EXIR cryptocurrency exchange API

Project description

EXIR Python Client - Examples

This repository contains a lightweight Python client in index.py and runnable examples under example/ for:

  • Public: Fetching market data (e.g., ticker)
  • Private: Authenticated calls (user, balance, place orders)
  • WebSocket: Streaming market data (orderbook)

Requirements

  • Python 3.8+
  • Install dependencies:
python3 -m pip install -r requirements.txt

Project layout

  • index.py: EXIR client (public, private, and WebSocket helpers)
  • utils.py: HTTP and auth utilities
  • example/public.py: Public ticker example
  • example/balance.py: Private user + balance example
  • example/order.py: Private create order example
  • example/websocket.py: WebSocket orderbook subscription example

Public usage

Fetch the ticker for btc-usdt:

python3 example/public.py

Example:

python3 example/public.py

Private usage (user, balance)

Set your api keys:

EXIR_API_KEY=<your-api-key> \
EXIR_API_SECRET=<your-api-secret> \

Notes:

  • Ensure your key has the required permissions (e.g., trading, read balance).
  • If IP whitelisting is enabled on the key, include your current IP.
  • Your system clock must be accurate; auth uses expiring signatures.

Private usage (create order)

Places a limit BUY order for 0.001 BTC at 50,000 USDT on btc-usdt:

If you receive 401 Unauthorized when creating orders:

  • Check key permissions and IP whitelist
  • Ensure your system clock is in sync

WebSocket usage (orderbook)

Subscribes to orderbook:btc-usdt and logs messages for ~10 seconds:

Notes:

  • Public WS channels (e.g., orderbook, trade) do not require credentials, but the script will include them if provided.
  • The client automatically reconnects by default.

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

exir_py_lib-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exir_py_lib-1.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file exir_py_lib-1.0.1.tar.gz.

File metadata

  • Download URL: exir_py_lib-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for exir_py_lib-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e2968764c0cdbaec91e852ac4713215e7d9f83ff8c4cb936eba15fae2d2c8fe7
MD5 0edbead16cf1da89b8e6409691a7c71e
BLAKE2b-256 afcc662d97e688b442c71212ed741b0145292342f052fa765d0ffe6778bb8656

See more details on using hashes here.

File details

Details for the file exir_py_lib-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: exir_py_lib-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for exir_py_lib-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e39ef1b58d0d529e8edffe874f78a8e4f4f69fe43a40f205519b00a2830160
MD5 c421137ced18090fe48f2a255e04a573
BLAKE2b-256 e7393a6fcfc9a7141c736095541dbdf69ca8ee1db0d6f29181ede2f4e31e3100

See more details on using hashes here.

Supported by

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