Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which parameters should we pass for authenticated user session? #10

Open
hakangs opened this issue Jun 2, 2020 · 2 comments
Open

Which parameters should we pass for authenticated user session? #10

hakangs opened this issue Jun 2, 2020 · 2 comments

Comments

@hakangs
Copy link

hakangs commented Jun 2, 2020

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).

@MrPowerGamerBR
Copy link

MrPowerGamerBR commented Jul 28, 2020

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.

  1. Do a POST request to https://br.tradingview.com/quote_token/ with a sessionid Cookie, you can get your Session ID by looking at any connection that you do to TradingView
  2. Get the string from the request (but don't forget to remove the "!), that's the WebSocket token
  3. Use the token on the set_auth_token packet
  4. Have fun!

@MrPowerGamerBR
Copy link

Update: The https://br.tradingview.com/quote_token/ endpoint was removed, so here's what you need to do:

  1. Do a GET request to https://br.tradingview.com/chart/ with a sessionid Cookie, you can get your Session ID by looking at any connection that you do to TradingView
  2. Get the JSON in the var user = JsonPayloadHere; JavaScript variable
  3. Within the JSON, there's a auth_token field, that's the WebSocket token
  4. Use the token on the set_auth_token packet
  5. Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants