Jump to content
KQ Markets

REST API - Singe / Multiple Users

Recommended Posts

Hi API Team,

We have received from you a REST API connection via an Appkey.

We want to display real-time pricing from Gain Capital into a charting library of a third-party provider (Tradingview). The idea is that the live charts will be displayed on our own website for anyone to view who visits our website (or potentially behind our own login area). However after reviewing your Rest API documentation our developer has pointed out that your Rest API seems to be only for single users rather than multiple users? This would mean that each user would need to login with his credentials to view the pricing?

Could you please confirm if it is possible to use your Rest API for displaying real-time prices to be viewed by multiple visitors on our website? Or is there any other solution you would suggest?

Many thanks in advance,

Fraz

PS: We will not be placing any trades via the REST API. 

Share this post


Link to post

Hi Fraz,

For clarification purposes, to receive streaming / live market prices you'll need to use the streaming Lightstreamer API rather than the (static) REST API. 

In answer to your question, you can use a single test account for the login credentials to obtain and display the live streaming prices in a chart on your website, and display that to all users. You can speak with your account manager / usual contact to obtain a test account for this purpose.

Kind Regards, PM

Share this post


Link to post

Hi Physicsman,

Thank you for your response and clarification.

We already have the following test account: <redacted>. However this was not specifically set up to obtain and display live streaming prices.

Also, in connection with the Rest API set up, we were given an Appkey which is linked to the live account: <redacted>.

Can any of these accounts be for this purpose? Or do we have to specifically ask for a lightstreamer API test account from the partners team?

Best Regards,

Fraz

Edited by Physicsman
Redacted confidential information.

Share this post


Link to post

Hi Fraz,

Yes, either of those accounts will work and can be used. 

No need to request separate account for the Lightstreamer part of the API - the login credentials for streaming are obtained from logging into the REST API with any of your accounts. Specifically:

Quote

The credentials are your account user name and the password is the Session ID received when logging into the REST part of the API.

See the Streaming API section of the page: http://docs.labs.gaincapital.com/#Getting Started/CIAPI Arky.htm%3FTocPath%3DGetting%20Started|_____1

Essentially, you establish a HTTPS connection to the streaming URL: https://push.cityindex.com/ and then subscribe to the markets of interest using those markets MarketIDs. 

Kind Regards, PM

Share this post


Link to post

Hi,

From the questions in the document, there are some fundamentals that should be clarified to remove confusion.

  • Live streaming prices are delivered via the 3rd party Lightstreamer API, which is the streaming part of the API described in our API documentation. 
  • The REST part of the API is purely for static data and does NOT provide live streaming prices. Essentially, you are connecting TradingView charts to the Lightstreamer API and NOT the REST API. You'll need to consult the TradingView and Lightstreamer documentation to find out how to feed the prices from Lightstreamer into the chart.  
  • To subscribe to real-time data streams in Lightstreamer, authentication is required. The credentials are your account user name and the password is the Session ID received when logging into the REST part of the API.
  • Subscribe to markets in Lightstreamer using MarketIDs. To find a MarketID, follow the instructions described in the following link: http://docs.labs.gaincapital.com/#How%20Do%20I/Find%20Market%20ID.htm%3FTocPath%3DHow%2520Do%2520I...%253F%7C_____1

  
Kind Regards, PM

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×