Skip to main content

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:

  1. Create a signature.
  2. Send an action to authenticate your connection.

Step 1: Create a signature

You first need to create an HMAC-SHA256 hex-encoded signature:

  1. Prepare the parameter values:
  • timestamp: 1548175200641
  • method: GET
  • path: /v2/websocket
  • body: do not include a body.
  1. Concatenate the values without a delimiter:
    Concatenated string
    1548175200641GET/v2/websocket
  2. Prepare the API secret for your Bitvavo-Access-Key. For example:
    API secret
    bitvavo
  3. Encode the concatenated string to HMAC-SHA256 using the API secret for your API key. You get:
    Signature
    0F3ZsjokueFAcg8S04+yX35z6Rm9Xg1IkqdHYKhswP4=

Step 2: Send an action to authenticate

Now that you have created a signature, to authenticate your connection to the WebSocket API:

  1. Connect to wss://ws-mdpro.bitvavo.com/v2/
  2. Create a JSON object with:
    • action: authenticate
    • key: YOUR_API_KEY
    • signature: 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.
  3. Send the message to the WebSocket API:
Authenticate message
{
"action": "authenticate",
"key": "YOUR_API_KEY",
"signature": "0F3ZsjokueFAcg8S04+yX35z6Rm9Xg1IkqdHYKhswP4=",
"timestamp": 1548175200641
}
  1. 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.

See also