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/demoBase 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
}
}Authentication Required
This endpoint requires the
Deriv-App-ID header to identify your application.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.
Any other questions? Get in touch