Deriv API
K

WebSocket Demo Endpoint

GET
Auth required

WebSocket endpoint for Options trading demo account

Endpoint

GET
/trading/v1/options/ws/demo

Base URL: https://api.derivws.com

Request & Response
View Raw

Status Codes

101

Switching Protocols - WebSocket connection established

400

Bad request - Invalid or missing OTP parameter

401

Unauthorized - Invalid or missing OTP

Error Responses

The API returns structured error responses with detailed information about what went wrong.

400
Bad request
{
  "errors": [
    {
      "status": 400,
      "code": "ValidationError",
      "message": "OTP parameter is required"
    }
  ],
  "meta": {
    "endpoint": "/trading/v1/options/ws/demo",
    "method": "GET",
    "timing": 15
  }
}
401
Unauthorized - Invalid or missing OTP
{
  "errors": [
    {
      "status": 401,
      "code": "Unauthorized",
      "message": "Invalid or expired OTP token"
    }
  ],
  "meta": {
    "endpoint": "/trading/v1/options/ws/demo",
    "method": "GET",
    "timing": 28
  }
}

About ws_demo

The ws_demo endpoint websocket endpoint for options trading demo account

WebSocket Connection

This endpoint establishes a WebSocket connection for real-time trading operations. You must first obtain an OTP token using the get_otp endpoint.

After Connection

Once connected, you can send trading commands and receive real-time updates through this WebSocket connection. Refer to the Trading Operations documentation for available commands.

Click to open live chat support. Get instant help from our support team.