tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.33k stars 744 forks source link

Initial symbol API call parameter addition #296

Open jerokpradeep opened 2 years ago

jerokpradeep commented 2 years ago

Hi All,

I'm integrating tradingview in my product. While calling the initial https://demo-feed-data.tradingview.com/symbols?symbol=AMZN, I want to all two more parameters. Obviously, I have added my own symbol API, but not sure where to add the params from teh charting library.

Please help

romfrancois commented 2 years ago

Hi @jerokpradeep !

I want to all two more parameters

What do you want to do exactly, Im not sure I understand what you mean by that

jerokpradeep commented 2 years ago

Oh sorry, it didn't come out properly. Actually, when loading the tradingview chart, the below API call is made to backend API to fetch details about the Symbol as below. Request - https://mydomain.in/APIService/ chart/symbols?symbol= AKSHAR In Demo this goes like - https://demo-feed-data.tradingview.com/symbols?symbol=AMZN Response -

description: "AKSHAR SPINTEX LIMITED" exchange-listed: "NSE" exchange-traded: "NSE" has_intraday: true has_no_volume: false minmov: 1 minmov2: 0 name: "AKSHAR::NSE" pointvalue: 1 pricescale: 100 session: "0915-1530" supported_resolutions: ["1", "5", "10", "15", "30", "60", "D", "1W", "1M"] ticker: "9558" timezone: "Asia/Kolkata" type: "0"

In this, is it possible to add two more parameters as shown below?

https://api.zebull.in/rest/V2MobullService/chart/symbols?symbol=AKSHAR::NSE &exch=NSE&token=2345

The problem is, I have same symbol listed across exchanges and they have different data sets. Sending exchange and token information along in this url will help getting the right data set

romfrancois commented 2 years ago

Gotcha!

Usually the way to go is to format/prefix your symbol with the exchange like NSE:AKSHAR or NYSE:AAPL, NASDAQ:AAPL etc without having to specify an extra url parameter.

As for the token you should still be able to pass it to the server and get it from the URL. Since everything goes to your server that's something you could control.

jerokpradeep commented 2 years ago

Gotcha!

Usually the way to go is to format/prefix your symbol with the exchange like NSE:AKSHAR or NYSE:AAPL, NASDAQ:AAPL etc without having to specify an extra url parameter.

As for the token you should still be able to pass it to the server and get it from the URL. Since everything goes to your server that's something you could control.

Hi @romfrancois Thanks for the clarification. As far as the Exchange is concerned, i got it. However, may you please help as where should I change the code to send this token to backend?

romfrancois commented 2 years ago

I dont think the token is changing over time, is it? In that case your backend should already be aware of that token independently of the search.