Deriv API
Documentation
Options Setup

WebSocket Demo Endpoint

GetAuth required

Upgrades the connection to a WebSocket scoped to a demo Options Trading account. Requires a valid one-time password (OTP) from the OTP endpoint, passed as the otp query parameter. Use this channel to subscribe to market data, send trading instructions, and receive order and position updates for the demo account.

Endpoint

Get/trading/v1/options/ws/demo

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

Status Codes

101Switching Protocols - WebSocket connection established
400Bad request
401Unauthorized - Invalid or missing OTP

Error Responses

400Bad request
{
  "errors": [
    {
      "status": 400,
      "code": "ValidationError",
      "message": "Invalid request"
    }
  ],
  "meta": {
    "endpoint": "/trading/v1/options/ws/demo",
    "method": "GET",
    "timing": 10
  }
}
401Unauthorized
{
  "errors": [
    {
      "status": 401,
      "code": "Unauthorized",
      "message": "Invalid or missing OTP"
    }
  ],
  "meta": {
    "endpoint": "/trading/v1/options/ws/demo",
    "method": "GET",
    "timing": 8
  }
}

About ws_demo

The ws_demo endpoint: Upgrades the connection to a WebSocket scoped to a demo Options Trading account. Requires a valid one-time password (OTP) from the OTP endpoint, passed as the otp query parameter. Use this channel to subscribe to market data, send trading instructions, and receive order and position updates for the demo account.

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