Real Time Quotes

It is possible to customize this service during the project without additional costs (ex. add websocket fallback protocols). Below you can find simple example that will allow you to quickly understand concept behind FXWebAPI.

For architecture overview check:

Oauth2 streaming workflow

Step 1: Connect to websocket

Websocket URL is different for each sandbox environment.

Please do not use below server for any other purpose than initial phase. Below service does not contain any security rules and is created just to the purpose of this web-page. Please request your own sandbox environment via email to: techsupport@fxwebapi.com

To connect client needs a Key from Auth Server. Before Real-time delivery of FX rates FXWebAPI will validate this key with Auth Server.

Key is passed inside of "key" parameter in websocket URL

var uri = 'wss://demo.fxcib.com/api/WebSocket/Getees?key=123123123';
websocket = new WebSocket(uri);

websocket.onopen = function () {
    console.log("Connected");
    event.preventDefault();
}

After successful Oauth2 authentication user can subscribe to receive real time FX rates

Step 2: Subscribe in Streaming mode

To subscribe for particular currency pair, please send following message:

{ 
   "messageType":2,
   "pair":"EUR/USD"
}

This service can also support streams based on amount (not presented in this documentation)

To fully understand this service your you can use our debugging console: http://websocket.fxcib.com/

You can also check our very simple HTML demo: http://webstream.fxcib.com/

We can provide custom look and feel development in Bootstrap, Angularjs, React and React Native based on you Mockups. Please send email to techsupport@fxwebapi.com with your requirements.

You can also check connect and subscribe workflow in JSFiddle.

Please Press "Result" below to see incoming messages in JSFiddle debugging console:

Step 3: Subscribe in Request For Stream mode

JSON Message example:

{ 
   "messageType":1, 
   "pair":"EUR/USD", 
   "side":1,
   "amount":"2",
   "action":"1",
   "SettlementDate":"0c5b6754-492b-443b-9c45-b294ae0f8850"
}

OPTIONS wss://demo.fxcib.com/api/WebSocket/Getees?key=123123123/

Request Body

Name
Type
Description

messageType

string

For RFS always 1

pair

string

Currency Pair

side

number

1 = Buy, 2 = Sell

amount

string

trade amount

action

string

For RFS always 1

SettlementDate

object

SettlementDate in ddmmyyyy format ex. 21072022 would be 21st of July 2022

Last updated