GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

Overview
Spot
    OverviewGet started
    Orders API
    Market Data API
    Fund Management API
    Instant Orders API
    WebSocket API
      OverviewAuthenticationMessage FormatPublic & Private Streams
    FIX API
Margin
    Overview
    Margin REST API
      Get Margin Account SummaryGet Margin Interest RatesPreview Margin Order Impact
Staking
    Overview
    Staking REST API
      List Staking BalancesStake Crypto FundsUnstake Crypto FundsList Staking Event HistoryList Staking RatesList Staking Rewards
Clearing
    Clearing REST API
      Clearing Orders
      Broker & Trade Operations
AuthenticationMessage Format
Streams
    OverviewBook TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance Updates
Utility
    conninfopingsubscribelist_subscriptionsunsubscribetime
L2 Data
    depth
Trading
    order.cancelorder.cancel_allorder.cancel_sessionorder.placerfq.confirm_quoterfq.createrfq.submit_quoterfq.withdraw_quote
WebSocket API

Introduction

Core APIShared across supported Gemini trading products.

Version: 0.10.7 • Status: Production • Public URL: wss://ws.gemini.com

Our WebSocket API provides low latency access to real-time market data and order execution for professional traders and institutions. Built from the ground up for performance, our WebSocket API delivers fastest latency on AWS with enterprise-grade reliability.

🚀 Try It Now with our interactive documentation

Key Features

  • Low Latency - Sub-10ms market data updates for competitive advantage
  • Real-Time Trading - Place and cancel orders via WebSocket
  • Multiple Streams - Subscribe to multiple markets simultaneously

Performance Tiers

TierTargetDescription
Tier 2 (Public Internet)p99~15msPublic offering connecting to AWS us-east-1 over the public internet. Provides good baseline performance with minimal setup complexity.
Tier 1 (In Region)p99~10msDirect connection to us-east-1 feed. Provides improved performance a step above the public offering but requires onboarding to peer to our infrastructure.
Tier 0 (Local Zone)p99~5msBest performance outside of NY5, physically closest to our data center. Requires onboarding similar to us-east-1.

Please email api@gemini.com to onboard to our WebSocket high performance tiers.

Connection Parameters

Connection-level query parameters can be passed in the WebSocket URL to customize behavior:

ParameterTypeDefaultDescription
snapshotinteger0Controls initial orderbook snapshot delivery when subscribing to differential depth streams
cancelOnDisconnectbooleanfalseAutomatically cancel all open orders when the WebSocket session disconnects

Snapshot Parameter

The snapshot parameter controls whether an initial orderbook snapshot is sent when subscribing to differential depth streams ({symbol}@depth, {symbol}@depth@100ms).

Connection URL example:

Code
wss://ws.gemini.com?snapshot=-1
snapshot ValueBehavior
Not specified / 0No snapshot — only incremental updates (default)
-1 (or any negative)Full orderbook snapshot sent immediately on subscribe
Positive integer (e.g., 100)Top N levels snapshot sent on subscribe

Use snapshot=-1 to receive a full orderbook snapshot immediately when subscribing to differential depth streams. This is useful for initializing your local orderbook state without needing a separate REST API call.

Cancel On Disconnect Parameter

The cancelOnDisconnect parameter enables automatic cancellation of all your open orders when the WebSocket session disconnects. This is a safety feature that helps prevent unwanted exposure from stale orders if your connection drops unexpectedly.

Connection URL example:

Code
wss://ws.gemini.com?cancelOnDisconnect=true
cancelOnDisconnect ValueBehavior
Not specified / falseOrders remain active after disconnect (default)
trueAll open orders are automatically cancelled on disconnect

When cancelOnDisconnect=true is enabled, all open orders placed via the WebSocket session will be cancelled upon disconnection, including orders that may have been intentionally left open. Ensure your trading strategy accounts for this behavior.

Combine multiple connection parameters using &: wss://ws.gemini.com?snapshot=-1&cancelOnDisconnect=true

Authentication

Public market data streams are available without authentication. Authenticated streams (order events, trading) require either an HMAC-signed API key or an OAuth 2.0 bearer token passed on the WebSocket upgrade. See Authentication for details.

Execute Instant OrderOverview