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
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,15 @@ This is the python wrapper for the Bitvavo API. This project can be used to buil
45
45
pip install python-bitvavo-api
46
46
```
47
47
48
+
## Rate Limiting
49
+
50
+
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 [documentation](https://docs.bitvavo.com/) to see the weight. Failure to respect the rate limit will result in an IP or API key ban.
51
+
Since the remaining limit is returned in the header on each REST request, the remaining limit is tracked locally and can be requested through:
52
+
```
53
+
limit = bitvavo.getRemainingLimit()
54
+
```
55
+
The websocket functions however do not return a remaining limit, therefore the limit is only updated locally once a ban has been issued.
56
+
48
57
## REST requests
49
58
50
59
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>'`.
@@ -1060,7 +1069,7 @@ All requests which can be done through REST requests can also be performed over
1060
1069
1061
1070
### Getting started
1062
1071
1063
-
The websocket object should be intialised through the `newWebsocket()` function. After which a callback for the errors should be set. After this any desired function can be called. Finally the main thread should be kept alive for as long as you want the socket to stay open. This can be achieved through a simple `while(True)` loop.
1072
+
The websocket object should be intialised through the `newWebsocket()` function. After which a callback for the errors should be set. After this any desired function can be called. Finally the main thread should be kept alive for as long as you want the socket to stay open. This can be achieved through a simple `while()` loop, where the remaining limit is checked. This is in case a ban has been issued, otherwise the websocket object will keep trying to reconnect, while our servers keep closing the connection.
0 commit comments