GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
Resources
  • Changelog

© 2026 Gemini Space Station, Inc.

Gemini Crypto Exchange LogoGemini Crypto Exchange Logo
IntroductionAuthenticationMessage Format
Streams
    OverviewBook TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance Updates
Utility
    timeconninfoping
Subscriptions
    unsubscribelist_subscriptionssubscribe
L2 Data
    depth
Trading
    order.placeorder.cancelorder.cancel_allorder.cancel_session

Stream Reference

Our WebSocket API provides multiple data streams for various exchange data:

  • L2 Order Book Data
  • Trade Events
  • Per Account Order Events

Book Ticker

SchemaFrequencyDescription
{symbol}@bookTickerReal-timeReal time updates to the best bid/ask price for an order book.
Try Itbtcusd@bookTicker
disconnected
Code
{ "u": 1751505576085, "E": 1751508438600117161, "s": "btcusd", "b": "45000.50", "B": "1.25000000", "a": "45001.00", "A": "0.75000000" }
FieldTypeDescription
unumberUpdate ID
EnumberEvent time (nanoseconds)
sstringSymbol
bstringBest bid price
BstringBest bid quantity
astringBest ask price
AstringBest ask quantity

L2 Partial Depth Streams

SchemaFrequencyDescription
{symbol}@depth5Periodic (1s)Periodic snapshot of the top 5 levels once per second
{symbol}@depth10Periodic (1s)Top 10 levels
{symbol}@depth20Periodic (1s)Top 20 levels
{symbol}@depth5@100msPeriodic (100ms)Top 5 levels every 100 milliseconds
{symbol}@depth10@100msPeriodic (100ms)Top 10 levels
{symbol}@depth20@100msPeriodic (100ms)Top 20 levels
Try Itbtcusd@depth10@100ms
disconnected
Code
{ "lastUpdateId": 12345678, "bids": [ ["45000.50", "1.25000000"], ["45000.25", "0.50000000"] ], "asks": [ ["45001.00", "0.75000000"], ["45001.25", "2.00000000"] ] }
FieldTypeDescription
lastUpdateIdnumberLast update ID
bidsarrayArray of [price, quantity]
asksarrayArray of [price, quantity]

L2 Differential Depth Streams

SchemaFrequencyDescription
{symbol}@depthPeriodic (1s)List of all changed price levels in the last second
{symbol}@depth@100msPeriodic (100ms)In the last 100 milliseconds
Try Itbtcusd@depth@100ms
disconnected

Initial Snapshot

Use the snapshot connection parameter to receive an initial orderbook snapshot when subscribing. Connect with wss://ws.gemini.com?snapshot=-1 for a full snapshot, or specify a positive number for top N levels.

Quantity zero indicates price level removal.

Code
{ "e": "depthUpdate", "E": 1751508260659505382, "s": "btcusd", "U": 12345677, "u": 12345678, "b": [ ["45000.50", "1.25000000"], ["45000.25", "0.00000000"] ], "a": [ ["45001.00", "0.75000000"] ] }
FieldTypeDescription
estringEvent type ("depthUpdate")
EnumberEvent time (nanoseconds)
sstringSymbol
UnumberFirst update ID in this event
unumberLast update ID in this event
barrayBid updates [price, quantity]
aarrayAsk updates [price, quantity]

Trade Stream

SchemaFrequencyDescription
{symbol}@tradeReal-timeReal time trade executions
Try Itbtcusd@trade
disconnected
Code
{ "E": 1759873803503023900, "s": "btcusd", "t": 2840140956529623, "p": "120649.97000", "q": "0.0046190900", "m": true }
FieldTypeDescription
EnumberEvent time (nanoseconds)
sstringSymbol
tnumberTrade ID
pstringPrice
qstringQuantity
mbooleanIs buyer the maker

Order Events

Requires an authenticated session

SchemaFrequencyDescription
orders@accountReal-timeReal time order activity for the account associated with the authenticated API key
orders@sessionReal-timeReal time order activity for the authenticated API key
Code
# Order Event - New { "E":1759291847686856569, "s":"BTCUSD", "i":73797746498585286, "c":"my-order-1759291847503", "S":"BUY", "o":"LIMIT", "X":"NEW", "p":"1.00000", "q":"0.0000100000", "z":"0.0000100000", "T":1759291847686856569 } # Order Event - Canceled { "E":1759291847731455006, "s":"BTCUSD", "i":73797746498585286, "c":"my-order-1759291847503", "X":"CANCELED", "T":1759291847731455006 }
FieldTypeDescription
EnumberEvent time (nanoseconds)
sstringSymbol
inumberOrder ID
cstringClient Order ID
SstringSide, BUY / SELL
ostringType, LIMIT / MARKET
XstringStatus, NEW / OPEN / FILLED / PARTIALLY_FILLED / CANCELED / REJECTED / MODIFIED
pstringOrder price
PstringStop price
qstringOriginal quantity
zstringRemaining quantity
ZstringExecuted quantity. For FILLED / PARTIALLY_FILLED events, this is the quantity filled in the last execution. For CANCELED and other events, this is the cumulative quantity filled over the lifetime of the order.
LstringLast execution price
tnumberTrade ID
rstringRejection reason
TnumberUpdate time (nanoseconds)
OstringEvent outcome for event contracts, YES / NO

Fields with empty or zero values may be omitted from the event.

Rejection Reasons

When an order is REJECTED, the r field contains one of:

ReasonDescription
MarketNotOpenMarket is closed or paused
InsufficientFundsAccount lacks sufficient balance
InvalidPricePrice violates constraints
LimitPriceOffTickPrice does not align with tick size
InvalidQuantityQuantity below minimum or off increment
InvalidStopPriceStop price violates constraints
InvalidTotalSpendTotal spend calculation error
DuplicateOrderDuplicate client order ID
InsufficientLiquidityNot enough liquidity at price
UnknownInstrumentTrading pair does not exist

Cancellation Reasons

When an order is CANCELED by the system, the r field contains one of:

ReasonDescription
SelfCrossPreventedSelf-trade prevention triggered
FillOrKillWouldNotFillFOK order could not fill completely
ImmediateOrCancelWouldPostIOC order would post to book
MakerOrCancelWouldTakeMOC order would take liquidity
AuctionCancelledAuction-related cancellation
ExceedsPriceLimitsPrice moved beyond limits

Balance Updates

Requires an authenticated session

SchemaFrequencyDescription
balances@accountReal-timeReal time balance updates for the account associated with the authenticated API key
balances@account@1sPeriodic (1s)Periodic snapshot of all balances every second for the account associated with the authenticated API key

The balances@account stream pushes updates in real time whenever a balance change occurs, and only includes the assets that changed. The balances@account@1s stream sends a complete snapshot of all account balances every second, regardless of whether they changed. On subscribe, balances@account@1s will immediately send the current balances if available.

Code
# Balance Update { "e": "balanceUpdate", "E": 1768250434780, "u": 1768250421600, "B": [ { "a": "USD", "f": "207.39" } ] }
FieldTypeDescription
estringEvent type ("balanceUpdate")
EnumberEvent time (nanoseconds)
unumberTime of the last account update (nanoseconds)
BarrayBalance updates
astringAsset code
fstringAsset balance
Last modified on April 17, 2026
On this page
  • Book Ticker
  • L2 Partial Depth Streams
  • L2 Differential Depth Streams
  • Trade Stream
  • Order Events
    • Rejection Reasons
    • Cancellation Reasons
  • Balance Updates
JSON
JSON
JSON
JSON
JSON
JSON