Skip to content

Oracle WebSocket API ​

This reference is generated from the Oracle AsyncAPI 3.0 contract. Prices and volumes are decimal strings; event timestamps are Unix milliseconds.

Download AsyncAPI JSON

Explore live data in Oracle Market View.

Subscriptions ​

Connection & authentication ​

WSwss://api.coinpost.ai/oracle/v2/ws

When CP Auth is enabled, send Authorization: Bearer <token> with the oracle scope in the upgrade request. Browser clients may use ?token=<token> or ?access_token=<token> on this endpoint.

Market subscriptions stream new events; they do not send an initial market snapshot. Fetch initial data through the REST API if needed. After reconnecting, send your subscriptions again. Market events do not include a subscription ID; overlapping subscriptions receive each matching event once.

Authentication methods ​

MethodLocationName
bearerheaderAuthorization
httpApiKeyquerytoken
httpApiKeyqueryaccess_token

Subscribe (type: subscribe) ​

Use type: "subscribe" to create or replace a subscription. Choose the data feed with channels: klines, tickers, sourceTickers, or status. Each subscription reference page describes one feed and lists only its applicable fields. To select only that feed, explicitly provide the shown channels value.

Subscription limits ​

A connection supports up to 100 subscriptions and 100 unique symbols.

A market subscription that omits both symbol and symbols uses the connection's entire symbol budget. A connection can have only one such subscription, and it cannot coexist with subscriptions naming individual symbols or another all-asset subscription, even for a different quote. Additional market subscriptions require a separate connection. A subscription containing only the status channel and no symbols can coexist with it. Violating this limit returns an error with code: "symbol_limit"; the existing subscriptions stay active. Reusing the same subscription id replaces that subscription.

Combined subscriptions and defaults ​

SENDsubscribe

Client → server

To receive multiple feeds with one ID, list them together in channels. intervals applies only to klines; sources applies only to sourceTickers. If channels is omitted or empty, the defaults are klines, tickers, and sourceTickers; status must be added explicitly. Reusing an ID replaces its full subscription, so send all desired fields again. Distinct subscriptions on one connection need distinct IDs; omitting id always uses default.

Reply: subscribed

Unsubscribe (type: unsubscribe) ​

SENDunsubscribe

Client → server

Remove the entire subscription identified by the request id, including all its channels. Omit or leave id blank to remove default. The server confirms using subscription_id, including when the ID does not exist.

Reply: unsubscribed

Message fields ​

FieldTypeRequiredDescription
typestringYesAlways unsubscribe.
Allowed: "unsubscribe"
idstringNoSubscription to remove. Default: default.
Default: "default"

Subscription removed (type: unsubscribed) ​

RECEIVEunsubscribed

Server → client

Acknowledges the removed ID, including an ID that did not exist.

Message fields ​

FieldTypeRequiredDescription
typestringYesAllowed: "unsubscribed"
subscription_idstringYesThe accepted request id, or default if the request id was omitted or blank.