Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



8 Commits

Repository files navigation

FCSAPI - FX Price Feeds

Update: 2021-02-05

FCSAPI provides real time FX prices with socket and PHP connection, FCS use on the server-side and workerman framework for PHP client. These code files help you to get live feeds from servers. Prices update frequency are <1 second to 5 seconds or depends on the currency. Get live prices from

Live Example

On example page, click on "start button" to start socket connection. Working Example Here


  • start.php stablish a connection between your and FCS server.
  • receiver.php contain methods that received live prices and log messages.


  • Install composer if not installed in your machine:
  • Create your work directory.
  • Install require workerman dependency in your directory
composer require workerman/
  • To Start connection between FCS server and your machine run command
php start.php start

Basic Usage


use Workerman\Worker;
use Workerman\Connection\AsyncTcpConnection;
use Workerman\Timer;
require_once __DIR__ . '/vendor/autoload.php';

global $api_key,$currencyList;
$api_key = 'API_KEY'; // Enter your API KEY here,
$currencyList = '1,1984,80,81,7774,7778';  // currency ids

$worker = new Worker();
$worker->onWorkerStart = function() use ($api_key)

    $ws_connection = new AsyncTcpConnection("ws://");
    $ws_connection->onConnect = function($connection) use ($api_key){
        // Connect API KEY to verify subscription
        $con->send('42["heartbeat","'.$api_key.'"]'); //send api_key
        // connect your required Forex IDs with server
        global $currencyList;
        $con->send('42["real_time_join","'.$currencyList.'"]'); //currency list

    // received all response from socket, then direct to it right function.
    $ws_connection->onMessage = function($connection, $data){
        // Response from server received here

    // Start Connection

You can get your API Access Key here :

6 currency data is free even without signup. FCS Support 400 FX currency live feeds and 200 Crypto currency. List of Available currency ids :


Recommend you to download files and use it, It contain full code also if server discounnet for any reason, it will reconnect you with Backup server.


FCS Socket documentation :
Wokerman Framework : WorkerMan Github


Contact us through email or live chat at


No releases published


No packages published