API version: 1.0
For REST API, see APIDOC
Endpoints:
See description of authorization procedure in APIDOC document
Communication is performed by sending text frames forth an back. Encoding is json.
Subscrption request looks like this:
{
"action": "SubAdd",
"subs": ["0~coinbase~BTC~USD"]
}
subs is an array of channel masks in format {channel}-{exchange}-{base_curr}-{quote_curr}-
channel:
Channel 0 : trades
Channel 2: quotes
Channel 8: orderbook L2
Channel 11: global instrument volume
Channel 24: ohlc candles
Channel 30: orderbook top only
etc.
exchange:
Exchange name, e.g. coinbase, or * (all exchanges). Partial wildcards are not supported.
base currency / quote currency
Codes of currency, e.g. BTC, USD, or * (all currencies)
Also, wildcards are supported, e.g. USD* will match USD, USDT, USDC etc. Only asterisk (*) is properly supported, not any other wildcard character.
Use channel 0
Use channel 8.
{
"action": "SubAdd",
"subs": ["8~coinbase~BTC~USD*~50"]
}
Note the final depth
argument in channel mask. Maximum depth is 50. It will send updates only in specified number of orderbook positions from the top.
Use channel 30.
{
"action": "SubAdd",
"subs": ["30~coinbase~BTC~USD*"]
}
Use channel 24.
{
"action": "SubAdd",
"subs": ["24~coinbase~BTC~USD*~m"]
}
Note the last parameter in channel name is bar size. Available bar sizes:
Use channel 11. Wildcards are not supported.
{
"action": "SubAdd",
"subs": ["11~BTC"]
}
Use channel 2. Wildcards are supported for multiple instruments. Ticker updates each second.
{
"action": "SubAdd",
"subs": ["2~coinbase~BTC~USD*"]
}