Available operations

The WebSocket server supports only 4 basic operations (op):

Ping

Check if the connection is still alive.

Request parameters: None

Response: Only success/error.

Request example:

{
	"op": "ping",
	"id": 1
}
Response example:
{
	"class": "resp",
	"id": 1,
	"success": true
}

Auth

Log in to be able to subscribe to private streams.

Request parameters:

Parameter Type Description
api_key string Required. Account API key.

Response: Only success/error.

Request example:

{
	"op": "auth",
	"api_key": "00000000000000000000000000000",
	"id": 2
}
Response example:
{
	"class": "resp",
	"id": 2,
	"success": true
}

Subscribe

Subscribe to the stream or many streams.

Request parameters:

Parameter Type Description
streams string/array<string> Required. Stream names.

Response: Only success/error.

Request example:

{
	"op": "sub",
	"streams": [
		"BPX/USDT@tickerEx",
		"BTC/USDT@ticker"
	],
	"id": 3
}
Response example:
{
	"class": "resp",
	"id": 3,
	"success": true
}

Unsubscribe

Unsubscribe from the stream or many streams.

Request parameters:

Parameter Type Description
streams string/array<string> Required. Stream names.

Response: Only success/error.

Request example:

{
	"op": "unsub",
	"streams": "BPX/USDT@tickerEx",
	"id": 4
}
Response example:
{
	"class": "resp",
	"id": 4,
	"success": true
}

Revision #2
Created 31 October 2023 11:07:16 by Admin
Updated 31 October 2023 11:08:49 by Admin