Catalog PyPI
PACKAGE EXPLORERView in registry

abfinance-python-api

PyPI

Python3 HTTP/WebSocket API Connector

apiconnector
Versions collected1
Direct dependencies3From release 1.0.6
Last observed20 Oct, 17:21 UTC

README

Version 1.0.6 documentation

ABfinance Python API

PyPI version Python License: MIT

Official Python3 API connector for ABFinance's HTTP and WebSocket APIs.

Installation

pip install abfinance-python-api

Requires Python 3.9+

Quick Start

HTTP API

from abfinance_api.unified_trading import HTTP

# Public endpoints (no authentication required)
session = HTTP(testnet=True)
print(session.get_server_time())
print(session.get_orderbook(category="linear", symbol="BTCUSDT"))

# Private endpoints (authentication required)
session = HTTP(
    testnet=True,
    api_key="your_api_key",
    api_secret="your_api_secret",
)

# Get wallet balance
print(session.get_wallet_balance(accountType="UNIFIED"))

# Place an order
print(session.place_order(
    category="linear",
    symbol="BTCUSDT",
    side="Buy",
    orderType="Limit",
    qty="0.01",
    price="30000",
))

WebSocket API

from abfinance_api.unified_trading import WebSocket

def handle_message(message):
    print(message)

# Public WebSocket
ws = WebSocket(testnet=True, channel_type="linear")
ws.orderbook_stream(depth=50, symbol="BTCUSDT", callback=handle_message)

# Private WebSocket
ws_private = WebSocket(
    testnet=True,
    channel_type="private",
    api_key="your_api_key",
    api_secret="your_api_secret",
)
ws_private.order_stream(callback=handle_message)

Features

  • HTTP API support for all endpoints
  • WebSocket API for real-time data
  • HMAC and RSA authentication
  • Testnet and mainnet support

Examples

See the examples directory for more usage examples.

License

MIT License

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.63 Feb 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
abfinance-exchange/abfinance-python-api

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:21 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0097469d8e54c49b839d869e7b2cf61acca6251ac09941dc6e1c584cf3998f49