Authentication
Learn how to authenticate your requests to Bitvavo WS Market Data Pro API. For the API reference, see WS Market Data Pro API. WS Market Data Pro API requires authentication for all actions and subscription channels.
Authentication
For messages that require authentication, you must first send a message to authenticate your WebSocket connection. After the connection is authenticated, you can start sending messages to the WebSocket API.
To do this, you need to:
- Create a signature.
- Send an action to authenticate your connection.
Step 1: Create a signature
You first need to create an HMAC-SHA256 hex-encoded signature:
- Prepare the parameter values:
timestamp: 1548175200641method: GETpath: /v2/websocketbody: do not include a body.
- Concatenate the values without a delimiter:
Concatenated string
1548175200641GET/v2/websocket - Prepare the API
secretfor yourBitvavo-Access-Key. For example:API secretbitvavo - Encode the concatenated string to HMAC-SHA256 using the API
secretfor your APIkey. You get:Signature0F3ZsjokueFAcg8S04+yX35z6Rm9Xg1IkqdHYKhswP4=
Step 2: Send an action to authenticate
Now that you have created a signature, to authenticate your connection to the WebSocket API:
- Connect to
wss://ws-mdpro.bitvavo.com/v2/ - Create a JSON object with:
action: authenticatekey: YOUR_API_KEYsignature: the signature you created.timestamp: the Unix timestamp in milliseconds of the time you make the request.window(optional): the time in milliseconds in which your request is allowed to execute. The default value is 10000, and the maximum value is 60000.
- Send the message to the WebSocket API:
Authenticate message
{
"action": "authenticate",
"key": "YOUR_API_KEY",
"signature": "0F3ZsjokueFAcg8S04+yX35z6Rm9Xg1IkqdHYKhswP4=",
"timestamp": 1548175200641
}
- Your connection is now authenticated, and you can start sending messages to the WebSocket API.
Permissions
To use the WS Market Data Pro API from your app, make sure to add at least the following permission to your API key in your Bitvavo dashboard:
- Read-only: retrieve information about your account and transfers. To retrieve order and trade information, your API key must also have the Trade digital currencies permission.