Skip to main content
The quote WebSocket pushes the rate, or a full quote, every time it changes. It uses the same pricing rules as Get Quote, so a quote received through the socket can be used to create an operation. The server uses Socket.IO (protocol v4). Use an official Socket.IO client, such as socket.io-client for JavaScript or python-socketio for Python.

Connect

Authenticate with the same access token you use for the REST API (see Authentication). Send it in the auth payload as token, or in the Authorization: Bearer <token> header. Your IP allowlist also applies to the socket.
The token is validated once, when connecting. An open connection stays active after the token expires; only a reconnection needs a valid token.

Subscribe

Emit subscribe with the same body as Get Quote. Unlike the REST endpoint, amount is optional, and it selects what you receive:
The acknowledgement is {"status": "ok"}, or an error:
Each connection has one subscription: emitting subscribe again replaces it. Emit unsubscribe to stop receiving updates without disconnecting.

Updates

If a quote cannot be calculated, rate_update carries {"status": "error", "reason": "..."}. Validation problems show their message; other failures show Quote unavailable.

When updates are sent

  • Immediately after you subscribe.
  • Every time the market rate changes.
  • In addition, every 60 seconds between 8:00 and 22:00 (Bogotá time), so a firm quote always has a valid quoteId.

Use a firm quote

A quoteId is valid for 60 seconds and for the same amount and assets it was issued for. Send it in the quoteId field when you create a withdrawal or a deposit to apply that exact quote. Every new update replaces the previous quoteId, so always use the latest one.