wss://ws-feed.prime.coinbase.com
ErrSlowConsume
).ErrSlowRead
).Message too big
)type
attribute that can be used to handle the message appropriately.
error
message—specifically, a message with the type
"error"
. This can be helpful when implementing a client or debugging issues.
subscribe
message to the server indicating which channels and products to receive. This message is mandatory—you are disconnected if no subscribe
has been received within 5 seconds.
subscribe
request must be signed. See Signing Messages below.subscribe
message is received the server responds with a subscriptions
message that lists all channels you are subscribed to. Subsequent subscribe messages add to the list of subscriptions.
unsubscribe
message. The structure is equivalent to subscribe
messages.
unsubscribe
message you will receive a subscriptions
message:
type
: “subscribe” or “unsubscribe”channel
: WebSocket channel to subscribe toaccess_key
: Public API keyapi_key_id
: Service account IDtimestamp
: ISO 8601 for requests (seconds since the epoch); or Epoch for creating signatures. Valid ISO 8601 format: %Y-%M-%DT%H:%M:%SZ
, for example, 2022-02-19T20:05:22Z
.passphrase
: Your API passphrasesignature
: SHA256 HMAC signature using the prehash string and API secret keyportfolio_id
/ order_id
: The portfolio or order ID (depending on which feed you’re subscribing to. portfolio_id
is required for orders
channel.)product_ids
: Comma-separated list of products to subscribe to (["BTC-USD"]
)signature
field is generated by creating a SHA256 HMAC by signing your API Secret key with a prehash string. The final prehash payload is generated by creating a concatenated string of channelName + accessKey + svcAccountId + timestamp + portfolioId + products
(where +
represents string concatenation).
Apply a SHA256 HMAC using your secret key on this prehash payload, and then base64-encode it as your final payload within your request. Pass the output of this SHA256 HMAC to the signature
field in each request message. See the examples of generating this signature
below.
product_ids: ["BTC-USD", "ETH-USD"]
), the product_ids
string in the prehash must be formatted as follows: BTC-USDETH-USD
.