Socket API Documentation

Goto old version 2
Please move your code to version 3, Version 2 will be deprecate soon

Whats New in Socket V3

Socket version 3 improve performance and prices accurace.
*) Support 270 Fx and 200 Crypto
*) Ask and Bid price added
*) Support 5 digitis price
*) Support Volume and Spread

Socket - Real Time Updates

Before Socket Api, all developers were sending request every second on our server to get latest price. But now we introduce Socket API, Socket.io Is a JS library that helps you to connect with our server on realtime connection, Socket connection will reduce latency 5 minutes to 1 seconds.

Real time prices support around ~400 Forex currency and 200+ Crypto currency. Download supported list in excel file Support List

If you have no idea about Socket.io Please read here. Documentaion

Get Started

To use socket.io you need a little knowledge about JS, We allow socket connection from Server to Server AND Client Browser to our Server.

Example: How Frequently prices update with socket connection

Note: Market closed on saturday and sunday, so you will not see any price changes

1) Client Browser To Server Connection

If you want to get all real time pricing on your browser to show to your visitors. No special installation you need.
All guide are mention in socket_browser.js file.
Download Simple Socket Code and run index.html file in browser

OR Check Example Here

Skills Required
HTML and Java Script

Quick Code Guide
<script src="socket.io.js"></script> 
<script>
var api_key = 'API_KEY'; // Enter Your API KEY
var currency_ids = '1,2,3'; // Your FX currency multiple IDs

// socket connection function
function socket_connection(){
// Connection
var socket = io.connect("wss://fcsapi.com",{transports: ['websocket']});

// Verify Your API key on server
socket.emit('heartbeat', api_key);

// Connect Ids on server
socket.emit('real_time_join', currency_ids);

socket.on('data_received',function(data){
  // always receive latest price here in "data" variable
  // data contain : Price, ASK price, BID price
  console.log(data);
});
} // function end


// Calling function
socket_connection();
</script>

2) Server To Server Connection

If you want to get all real-time pricing directly on your server you need little knowledge about "JS", "Nodejs" and "cmd in windows OR terminal in Linux".
You need to install Nodejs on your windows/Linux Server, Create empty project folder, and run our server.js file in CMD/terminal.
Download server.js File

If you have no idea about socket.io then we recommend you to learn "how to build simple Chat app with socket.io" After that, you will learn all skills that you need to run our code. Offical Documentation

Skills Required
Java Script (Required),
Socket.io (Good if you know)
NodeJS (Not required, just install in your machine),

Installation
  • Create your work directory
  • Run command > "npm install socket.io@2.4.1"
  • Run command to start socket connection > "node server.js"


If you are working on Java or C#, socket.io library easily available on internet, just find Socket.io library for your native language.
Check FCS socket+php code Github Here

Socket - Price Plan

Normal pricing plan on the pricing page does not include socket access, you need to contact us for socket connection access. Below are two plans for socket connection.

  • Plan 1: Client Browser To FCS server connection, $350/month
    Direct connection from browser/Apps to FCS server is allow. With plan 1 you don't need your own nodejs or socket port connection, We allow you to connect your visitors directly with FCS server, Or you can directly access currency updates from browsers.

  • Plan 2: Client Server To FCS Server connection, $100/month
    Direct connection from browser to FCS server or any Application to FCS server is NOT allow. Only 1 connection allow from your machine,terminal or CMD to FCS.
    If you have 1000 visitors and you want to connect your all visitors with Socket connection then you need to provide them service from your own socket connection.
    You need to create your own nodejs/socket connection and then connect your Visitors with your server.

No difference between Plan 1 and Plan 2 in Real-time updates except number of connection or restrictions limit.

Socket Data Example

Click below link to go to Example page, and press Start button to connect with socket.
> Live Prices

> Socket Html code

> Socket JS code

> Socket + PHP Github

Disclaimer

Prices, Market trends and signals are not designed for trading purpose, These signals are only for education or non-commercial purpose use. Data contained in this application/website is not necessarily real-time nor accurate and so prices may not be accurate and may differ from the actual market price, meaning prices are indicative and not appropriate for trading purposes. Therefore we doesn`t bear any responsibility for any trading losses you might incur as a result of using this data.
Latest price minimum refresh rate is 5 Seconds