Skip to main content
During development, the developer endpoints work without an API key. Access to the quote stream in production is gated: request an API key with quote stream access, or have an existing key upgraded.
This recipe connects to the quote stream and reads live bid and ask updates for a single pair. See Market Data Streams for how the quotes are built.
1

Set up

Import a WebSocket client, read the endpoint from the environment, and pick the pair to watch.
2

Connect and subscribe

Open the connection to /quote-stream and send a subscribe op once it is open. The API key header is only needed in production.
3

Read updates

Each message is a batch covering one slot. Read the updates array, and handle the per-pair e field for pairs with no route.
Quotes are approximations and can briefly cross (bid above ask) between slots. Treat them as a live read on the market, not a guaranteed execution price.

Market Data Streams

How the streams work and when to use each.

Quote Stream API

Messages, fields, and the all-markets subscription.

Stream Order Book Depth

Read ten levels of depth per side.

Authenticate Requests

Authenticate requests for production rate limits.