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
Crypto starts with Bitvavo. You use Bitvavo API for Python to buy, sell and store over 200 digital assets on Bitvavo from inside your own app.
19
+
Crypto starts with Bitvavo. You use Bitvavo SDK for Python to buy, sell, and store over 200 digital assets on Bitvavo from inside your own app.
20
20
21
-
To trade and execute your advanced trading strategies, Bitvavo API for Python is a wrapper that enables you to easily call every endpoint in [Bitvavo API](https://docs.bitvavo.com/)
21
+
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/)
22
22
23
23
## Prerequisites
24
24
25
-
To start programming with Bitvavo API for Python you need:
25
+
To start programming with Bitvavo SDK for Python you need:
26
26
27
27
-[Python3](https://www.python.org/downloads/) installed on your development environment
28
28
@@ -31,6 +31,7 @@ To start programming with Bitvavo API for Python you need:
31
31
open /Applications/Python\ 3.12/Install\ Certificates.command
32
32
open /Applications/Python\ 3.12/Update\ Shell\ Profile.command
33
33
```
34
+
- A Python app. Use your favorite IDE, or run from the command line.
34
35
- An [API key and secret](https://support.bitvavo.com/hc/en-us/articles/4405059841809) associated with your Bitvavo account
35
36
36
37
You control the actions your app can do using the rights you assign to the API key. Possible rights are:
@@ -42,12 +43,83 @@ To start programming with Bitvavo API for Python you need:
42
43
43
44
## Get started
44
45
45
-
1. Download this python repository
46
+
1. **Install Bitvavo SDK for Python**
47
+
48
+
In your Python app, add [Bitvavo SDK for Python](https://github.com/bitvavo/python-bitvavo-api) from [pypi.org](https://pypi.org/project/python-bitvavo-api/):
49
+
```terminal
50
+
python -m pip install python_bitvavo_api
51
+
```
52
+
1. **Create a simple Bitvavo implementation**
53
+
54
+
Add the following code in a new file in your app:
55
+
56
+
```python
57
+
# Import Bitvavo SDK for Python
58
+
from python_bitvavo_api.bitvavo import Bitvavo
59
+
import json
60
+
import time
61
+
62
+
# Use this class to connect to Bitvavo and make your first calls
63
+
# Add workflows to implement your business logic.
64
+
class bitvavo_implementation:
65
+
api_key = "<Replace with your your API key from Bitvavo Dashboard>"
66
+
api_secret = "<Replace with your API secrete from Bitvavo Dashboard>"
67
+
bitvavo_engine = None
68
+
bitvavo_socket = None
69
+
70
+
# Connect securely to Bitvavo, create the websocket and error callbacks
# Sockets are fast, but asynchronous. Keep the socket open while you are
96
+
# trading.
97
+
def wait_and_close(self):
98
+
limit = self.bitvavo_engine.getRemainingLimit()
99
+
try:
100
+
while (limit > 0):
101
+
time.sleep(0.5)
102
+
limit = self.bitvavo_engine.getRemainingLimit()
103
+
except KeyboardInterrupt:
104
+
self.bitvavo_socket.closeSocket()
105
+
106
+
# Shall I re-explain main? Naaaaaaaaaa.
107
+
if __name__ == '__main__':
108
+
bvavo = bitvavo_implementation()
109
+
bvavo.a_workflow()
110
+
bvavo.wait_and_close()
46
111
47
-
1. In your development environment, install the Bitvavo API for Python package from pip:
48
-
```terminal
49
-
python -m pip install python_bitvavo_api
50
-
```
112
+
```
113
+
1. **Add security information**
114
+
115
+
Replace the values of `api_key` and `api_secret` with your credentials from [Bitvavo Dashboard](https://account.bitvavo.com/user/api).
116
+
117
+
1. **Run your app**
118
+
119
+
- Command line warriors: `python3 <filename>`.
120
+
- IDE heroes: press the big green button.
121
+
122
+
Your app connects to Bitvavo and returns a list of the current market prices.
51
123
52
124
# Python Bitvavo Api
53
125
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/)
0 commit comments