You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-34Lines changed: 25 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@ Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and sto
16
16
17
17
To trade and execute your advanced trading strategies, Bitvavo SDK for Python is a wrapper that enables you to easily call every endpoint in [Bitvavo API](https://docs.bitvavo.com/)
18
18
19
+
-[Prerequisites](#prerequisites) - what you need to start developing with Bitvavo SDK for Python.
20
+
-[Get started](#get-started) - rapidy create an app and start trading with Bitvavo.
21
+
-[API reference](#api-reference) - in-depth information about Bitvavo SDK for Python
22
+
19
23
## Prerequisites
20
24
21
25
To start programming with Bitvavo SDK for Python you need:
@@ -37,7 +41,7 @@ To start programming with Bitvavo SDK for Python you need:
37
41
38
42
Best practice is to not grant his privilage, withdrawals using the API do not require 2FA and e-mail confirmation.
39
43
40
-
## Get started
44
+
## Get started
41
45
42
46
Want to quickly make a first app? Here we go:
43
47
@@ -143,22 +147,24 @@ Want to quickly make a first app? Here we go:
143
147
Your app connects to Bitvavo and returns a list the latest trade price for each market. The callback cycles through the
144
148
market data so you can implement your trading logic.
145
149
146
-
# Python Bitvavo Api
150
+
## API reference
151
+
147
152
This is the python wrapper for the Bitvavo API. This project can be used to build your own projects which interact with the Bitvavo platform. Every function available on the API can be called through a REST request or over websockets. For info on the specifics of every parameter consult the [Bitvavo API documentation](https://docs.bitvavo.com/)
148
153
149
-
* Getting started [REST](https://github.com/bitvavo/python-bitvavo-api#getting-started) [Websocket](https://github.com/bitvavo/python-bitvavo-api#getting-started-1)
150
-
* General
154
+
* [General](#general)
155
+
* Rate limiting [x-platform](#rate-limiting)
156
+
* REST requests [x-platform](#rest-requests)
151
157
* Time [REST](https://github.com/bitvavo/python-bitvavo-api#get-time) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-time-1)
* Book [REST](https://github.com/bitvavo/python-bitvavo-api#get-book-per-market) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-book-per-market-1)
156
162
* Public Trades [REST](https://github.com/bitvavo/python-bitvavo-api#get-trades-per-market) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-trades-per-market-1)
* Book Ticker [REST](https://github.com/bitvavo/python-bitvavo-api#get-book-ticker) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-book-ticker-1)
* Place Order [REST](https://github.com/bitvavo/python-bitvavo-api#place-order) [Websocket](https://github.com/bitvavo/python-bitvavo-api#place-order-1)
163
169
* Update Order [REST](https://github.com/bitvavo/python-bitvavo-api#update-order) [Websocket](https://github.com/bitvavo/python-bitvavo-api#update-order-1)
164
170
* Get Order [REST](https://github.com/bitvavo/python-bitvavo-api#get-order) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-order-1)
@@ -173,7 +179,7 @@ This is the python wrapper for the Bitvavo API. This project can be used to buil
* Deposit History [REST](https://github.com/bitvavo/python-bitvavo-api#get-deposit-history) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-deposit-history-1)
175
181
* Withdrawal History [REST](https://github.com/bitvavo/python-bitvavo-api#get-withdrawal-history) [Websocket](https://github.com/bitvavo/python-bitvavo-api#get-withdrawal-history-1)
* [Book subscription with local copy](https://github.com/bitvavo/python-bitvavo-api#book-subscription-with-local-copy)
184
190
191
+
### General
185
192
186
-
## Installation
187
-
```
188
-
pip install python-bitvavo-api
189
-
```
193
+
#### Rate limiting
190
194
191
-
## Rate Limiting
195
+
Bitvavo uses a weight based rate limiting system. Your app is limited to 1000 weight points per IP or API key per
196
+
minute. When you make a call to Bitvavo API, your remaining weight points are returned in the header of each REST request.
192
197
193
-
Bitvavo uses a weight based rate limiting system, with an allowed limit of 1000 per IP or API key each minute. Please inspect each endpoint in the [Bitvavo API documentation](https://docs.bitvavo.com/) to see the weight. Failure to respect the rate limit will result in an IP or API key ban.
194
-
Since the remaining limit is returned in the header on each REST request, the remaining limit is tracked locally and can be requested through:
198
+
Websocket functions do not return your returning weight points, you track your remaining weight points with a call to:
195
199
```
196
200
limit = bitvavo.getRemainingLimit()
197
201
```
198
-
The websocket functions however do not return a remaining limit, therefore the limit is only updated locally once a ban has been issued.
199
202
200
-
## REST requests
203
+
If you make more requests than permitted by the weight limit, your IP or API key is banned.
201
204
202
-
The general convention used in all functions (both REST and websockets), is that all optional parameters are passed as an dictionary, while required parameters are passed as separate values. Only when [placing orders](https://github.com/bitvavo/python-bitvavo-api#place-order) some of the optional parameters are required, since a limit order requires more information than a market order. The returned responses are all converted to a dictionary as well, such that `response['<key>'] = '<value>'`.
205
+
The rate weighting for each endpoint is supplied in the [Bitvavo API documentation](https://docs.bitvavo.com/).
203
206
204
-
### Getting started
207
+
#### REST requests
205
208
206
-
The API key and secret are required for private calls and optional for public calls. The access window and debugging parameter are optional for all calls. The access window is used to determine whether the request arrived within time, the value is specified in milliseconds. You can use the [time](https://github.com/bitvavo/python-bitvavo-api#get-time) function to synchronize your time to our server time if errors arise. REST url and WS url can be used to set a different endpoint (for testing purposes). Debugging should be set to true when you want to log additional information and full responses. Any parameter can be omitted, private functions will return an error when the api key and secret have not been set.
207
-
```python
208
-
from python_bitvavo_api.bitvavo import Bitvavo
209
-
bitvavo = Bitvavo({
210
-
'APIKEY': '<APIKEY>',
211
-
'APISECRET': '<APISECRET>',
212
-
'RESTURL': 'https://api.bitvavo.com/v2',
213
-
'WSURL': 'wss://ws.bitvavo.com/v2/',
214
-
'ACCESSWINDOW': 10000,
215
-
'DEBUGGING': False
216
-
})
217
-
```
218
-
219
-
### General
209
+
For all functions, required parameters are passed as separate values, optional parameters are passed as a dictionary;
210
+
return parameters are in dictionary format such that `response['<key>'] = '<value>'`. Only when [placing orders](https://github.com/bitvavo/python-bitvavo-api#place-order) some of the optional parameters are required, since a limit order requires more information than a market order.
220
211
221
212
#### Get time
222
213
```python
@@ -698,7 +689,7 @@ print(response)
698
689
```
699
690
</details>
700
691
701
-
### Private
692
+
### Private trading data
702
693
703
694
#### Place order
704
695
When placing an order, make sure that the correct optional parameters are set. For a limit order it is required to set both the amount and price. A market order is valid if either amount or amountQuote is set.
@@ -1271,7 +1262,7 @@ except KeyboardInterrupt:
1271
1262
1272
1263
The api key and secret are copied from the bitvavo object. Therefore if you want to use the private portion of the websockets API, you should set both the key and secret as specified in [REST requests](https://github.com/bitvavo/python-bitvavo-api#rest-requests).
0 commit comments