WebSocket Demo Endpoint
WebSocket endpoint for Options trading demo account
Endpoint
/trading/v1/options/ws/demoBase URL: https://api.derivws.com
Status Codes
Switching Protocols - WebSocket connection established
Bad request - Invalid or missing OTP parameter
Unauthorized - Invalid or missing OTP
Error Responses
The API returns structured error responses with detailed information about what went wrong.
{
"errors": [
{
"status": 400,
"code": "ValidationError",
"message": "OTP parameter is required"
}
],
"meta": {
"endpoint": "/trading/v1/options/ws/demo",
"method": "GET",
"timing": 15
}
}{
"errors": [
{
"status": 401,
"code": "Unauthorized",
"message": "Invalid or expired OTP token"
}
],
"meta": {
"endpoint": "/trading/v1/options/ws/demo",
"method": "GET",
"timing": 28
}
}Authentication Required
This endpoint requires the Deriv-App-ID header to identify your application.
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.