Streaming Real-Time FX Data
Stream real-time FX quotes via WebSocket for live mid, bid, and ask prices across approximately 1000 currency pairs.
WebSocket Endpoint
wss://streaming.bluegamma.io/fx_streamQuick Start
import asyncio
import json
import websockets
async def stream_fx():
url = 'wss://streaming.bluegamma.io/fx_stream?s=EURUSD&s=GBPUSD&token=YOUR_API_KEY'
async with websockets.connect(url) as ws:
async for msg in ws:
data = json.loads(msg)
if data.get("type") == "quote":
print(f"{data['symbol']}: mid={data['mid']}, bid={data['bid']}, ask={data['ask']}")
asyncio.run(stream_fx())Query Parameters
Parameter
Required
Description
Server Messages
Connection Confirmation
Field
Description
Real-Time Quote
Field
Description
Subscription Confirmation
Unsubscription Confirmation
Heartbeat
Error
Client Commands
Subscribe to Additional Symbols
Unsubscribe from Symbols
Ping
Supported Currency Pairs
Use Cases
Use Case
Description
Complete Example with Reconnection
Limits and Best Practices
Limit
Value
Error Handling
Error
Cause
Solution
Related
PreviousValidating BlueGamma API Data Against Bloomberg or Other PlatformsNextRate Limits & Best Practices
Last updated
Was this helpful?

