Overview
Introduction
Gemini offers two WebSocket APIs for streaming data:
- a private Order Events API
- a public Market Data API
Advantages
Using WebSockets provides several advantages:
- Receive notifications in real time
- Reduce the amount of data you have to transfer over the network
- Reduce latency introduced by polling interval
For example, to keep track of your orders, you might be requesting the Get Active Orders endpoint every five seconds:
- Request
/v1/orders
- Bring back HTTP header data and a response body
- Parse the JSON in the response body
- Compare the latest response against the previous response to see what has changed
Using the private Order Events API, you would subscribe once and receive real time notifications of all order activity.
WebSocket Protocol Resources
For general information about how the WebSocket protocol works, refer to: