Skip to main content

BitFex.Trade python API wrapper

Project description

BitFex-API.py

BitFex.trade trading API python library.

Installation

pip install bitfex

Usage Examples

from bitfex_api import Api

client = Api(token='4320dbf5-3df1-483d-a155-1fc860c4a14d')

client.user().response
# ApiResponse(
#   success=True,
#   response={'username': 'client', 'balances': {'BTC': 0.985e-05, 'RUR': 0.0, ..., 'DOGE': 0.0}},
#   error=None
# )

client.orders_my()
# ApiResponse(
#   success=True,
#   response={'orders': [
#     {'id': 1, 'pair': 'KWH_ETH', 'amount': 10000.0, 'price': 1.2e-07, 'operation': 'sell', 'completed': False, 'updated': 1563824693000, 'user_id': 'xx12'},
#     ...
#   ]}
# )

client.orders('BTC_RUR')
# ApiResponse(
#   success=True,
#   response={'orders': [
#     {'id': 11256624, 'pair': 'BTC_RUR', 'amount': 2.597e-05, 'price': 640988.03, 'operation': 'buy', 'completed': True, 'updated': 1563995215000, 'user_id': 'YZ'},
#     ...
#   ]}
# )

client.create_order(pair='BTC_RUR', operation='buy', amount=0.01, price=600000.0)
# ApiResponse(success = True) # fully completed
# ApiResponse(success = True, response = {'order_id': 1}) # not fully completed

client.cancel_order(order_id=1)
# ApiResponse(success = True)

License

MIT

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

bitfex-1.0.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: bitfex-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for bitfex-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4c3cf2789c0d4624cd408ec866e56b9480d611aecb569d081b3c04da51107c7e
MD5 91f425a4ef98c466c78653a4d1c29ffa
BLAKE2b-256 42ef9f8898eb37f967d8b5dc12289c621bb4cde8959dbf8df77106a7a30183dc

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