tradingview-scraper
tradingview-scraper copied to clipboard
Which parameters should we pass for authenticated user session?
Which parameters should we update/pass for using the application as a signed-in user? So that we can get real-time data for some symbols (instead of delayed_streaming_900, I have subscribed to necessary data feeds for them).
It looks like the library doesn't support this, but I was working on something similar for my own lib (Kotlin) and I found out how you can connect as authenticated user and it shouldn't be that hard to implement that in this lib.
- Do a POST request to
https://br.tradingview.com/quote_token/with asessionidCookie, you can get your Session ID by looking at any connection that you do to TradingView - Get the string from the request (but don't forget to remove the
"!), that's the WebSocket token - Use the token on the
set_auth_tokenpacket - Have fun!
Update: The https://br.tradingview.com/quote_token/ endpoint was removed, so here's what you need to do:
- Do a GET request to
https://br.tradingview.com/chart/with asessionidCookie, you can get your Session ID by looking at any connection that you do to TradingView - Get the JSON in the
var user = JsonPayloadHere;JavaScript variable - Within the JSON, there's a
auth_tokenfield, that's the WebSocket token - Use the token on the
set_auth_tokenpacket - Have fun!