Skip to main content

Bitfinex REST API client

Project description

# Python Bitfinex API client

---
This is a simple Python client for the Bitfinex REST API (V1 and V2). It supports public as well as private endpoints.

---
## Installation

You can either clone the repository directly from the Github webpage or run the following command(s) in your terminal:

Pip Installation:
```
pip install bitfinex-tencars
```

Alternatively you can clone the Git repository:
```
git clone https://github.com/akcarsten/bitfinex_api.git
```

Then go to the folder to which you cloned the repository and run:

```
python setup.py install
```

Now you can run Python and import the Bitfinex client.

---
## Examples of how to use the interface

### Public endpoints
Public endpoints can be used without entering any keys as shown in the examples below.

#### Example 1: Retrieving current tick data
```python
import bitfinex

# Initialize the api
api = bitfinex.api_v1()

# Select a trading pair
pair = 'btcusd'

# Get the current ticker data for the pair
api.ticker(pair)
```

#### Example 2: Available currency pairs
```python
import bitfinex

# Initialize the api
api = bitfinex.api_v1()

# Get all available currency pairs
symbols = api.symbols()
```

All available public endpoints are included in this client. For a full documentation check the Bitfinex API [webpage](
https://docs.bitfinex.com/docs/public-endpoints)

### Private endpoints
In order to use private endpoints the public- and secrete keys need to be provided while initializing the API as shown in the example below in which the current account balance can be retrieved.

#### Example 1: Check account balance
```python
import bitfinex

key = 'YOUR_PUBLIC_KEY'
secrete = 'YOUR_SECRETE_KEY'

api = bitfinex.api_v1(key, secrete)
my_balance = api_bitfinex.balance()
```

#### Example 2: Place an buy order
```python
import bitfinex

symbol = 'btcusd' # Currency pair to trade
amount = '0' # Amount to buy
price = '0' # Buy price
side = 'buy' # Buy or sell
type = 'exchange market' # Which type

# Send the order
api.place_order(symbol, amount, price, side, type)
```

---
## Further information

For a full documentation of all API commands and what parameters are needed to run them, check out the Bitfinex API documentation for [public endpoints](https://docs.bitfinex.com/docs/public-endpoints) and the documentation for the [private endpoints](https://docs.bitfinex.com/docs/rest-auth) of the V1 API.

For the V2 API you can find the reference [here](https://docs.bitfinex.com/v2/reference).

All endpoints should be included in this API. In case of changes or bugs please let me know.


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

bitfinex-tencars-0.0.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

bitfinex_tencars-0.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file bitfinex-tencars-0.0.3.tar.gz.

File metadata

  • Download URL: bitfinex-tencars-0.0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/27.2.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.4.5

File hashes

Hashes for bitfinex-tencars-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ad967777ebc25602dd10ed38d46f7a443647979d0c0d1bd6eed11c57fea402b1
MD5 32b1801e2855614024411dc95959bc85
BLAKE2b-256 e8dca20f84c56c04150c1b8b74e49ca359a557bfa44555f0c1fee38f4cdbf866

See more details on using hashes here.

File details

Details for the file bitfinex_tencars-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: bitfinex_tencars-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/27.2.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.4.5

File hashes

Hashes for bitfinex_tencars-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f84342967a84f763adb22178bde341d450568737f7da07e931a99bfbf96b2667
MD5 7acf57329c04cb5af9e62b3446fc123a
BLAKE2b-256 1ea3319c3b268bf5672ff0a6655359418ea8a00037323dd4258aa8bd2123aabd

See more details on using hashes here.

Supported by

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