Quotes

WS
loading...

Stream real-time Best Bid and Offer (BBO) quote data for specified Forex currency pairs via WebSocket. Each message provides the current bid/ask prices, sizes, and associated metadata as they update, enabling users to monitor evolving market conditions, guide trading decisions, and power responsive, data-driven applications.

Use Cases: Live monitoring, market analysis, trading decision support, dynamic interface updates.

Plan AccessIncluded in select Currencies plans
Not included
Real-time
Plan RecencyReal-time
Plan HistoryNot applicable to websockets
Parameters
ticker
string
required
Specify a forex pair in the format {from}-{to} or use * to subscribe to all forex pairs. You can also use a comma separated list to subscribe to multiple forex pairs. You can retrieve active forex tickers from our Forex Tickers API.
Response Attributes
ev
enum (C)
The event type.
p
string
The current pair.
x
integer
The exchange ID. See Exchanges for Massive's mapping of exchange IDs.
a
number
The ask price.
b
number
The bid price.
t
integer
The Timestamp in Unix MS.
Code Examples
# Connect to the websocket
npx wscat -c wss://socket.massive.com/forex

# Authenticate
{"action":"auth","params":"YOUR_API_KEY"}

# Subscribe to the topic
{"action":"subscribe", "params":"C.TOKEN_TICKER"}
Subscription Request
WS
loading...
Sign in or Create account to Massive to customize the websocket code examples. It's free.
Response Object
{
  "ev": "C",
  "p": "USD/CNH",
  "x": "44",
  "a": 6.83366,
  "b": 6.83363,
  "t": 1536036818784
}
Did you find this page helpful?
Do you still need help with something?