Financial data is more accessible and easy to understand via Finage. In this post, we will talk about how we can use or test the WebSockets on the terminal.

Let's start with installing the WSCAT. You need to NodeJS on your computer to install the WSCAT. You can install NodeJS with the given link below.

https://nodejs.org/en/

After the installation, it's easy to install the WSCAT. Run the command given below and it will install the WSCAT globally. 

npm install -g wscat

That's all, now we have WSCAT on our computer. You can check it with wscat -V command on your terminal. Finage will provide you a VPS for accessing the data with the highest performance possible. You'll get the details via E-Mail and Finage will give you a unique address like 

wss://abc123456.finage.ws:6000/?token=YOUR_SOCKET_KEY

You can connect to your virtual private server with this address. If you want to test your VPS or if you want to get the latest price with minimum effort on your computer via your unique address, open your terminal and run the command given below;

 

wscat -n -c "wss://abc123456.finage.ws:6000/?token=YOUR_SOCKET_KEY"  

You can get more details about the parameters by running the wscat -h command. 

WSCat terminal

After the connection, you will get a message from the server. We are using the Cryptocurrency server in this tutorial so, the server responded as "Connected to the Cryptocurrency Market". It's ready to get the data in Real-Time.

Send the command given below to the server;

{ "action": "subscribe", "symbols": "BTCUSD" }

WSCat response

The data will flow really fast after the command. You can stop it by pressing the CTRL + C keys. In this response, we are getting symbol name, price, quantity, and timestamp. Finage offers you a customizable server. It means you can edit the responses. For example, you can add "ask" and "bid" prices to the response, and more, of course.

 

Contact with the Finage team to get your Real-Time data in minutes. 

You can contact to Finage consultants to get more informaions about Finage