Zarathustra2 / TradeRepublicApi

Unofficial trade republic API
MIT License
277 stars 68 forks source link

web-app #13

Open step21 opened 2 years ago

step21 commented 2 years ago

As they have a web app now, it should be easier, no?

Jolg42 commented 2 years ago

From what I see the web app only shows the current status, no history. Communication happens through subscribing through ids via WebSockets. So probably not easier I would say.

Zarathustra2 commented 2 years ago

I am not sure what the question is? Re their API: It is all based on websocket pub & sub

step21 commented 2 years ago

Sorry for this less than perfectly worded issue. What I meant was not related to usage, but authentication - as far as I understood, before you had to basically reset your app, to authenticate for the API. As with the web app this is not necessary, I would expect that this is not necessary anymore, but I can call the login function, get a code via sms and go (and then use websockets etc). I was just not sure as I think in this repo at least the 'reset' part is still reflected somewhat. (https://github.com/Zarathustra2/TradeRepublicApi/blob/7112566ff45257fec65d2fbf9cd36729a6b6f8b8/trapi/api.py#L41) So I just wanted to ask if this is still necessary, sorry for the question with not enough info.

Zarathustra2 commented 2 years ago

Probably there is now a better/different mechanism for that but as I don't use TradeRepublic as my broker I am not sure whether I find the time to try out the new web app and check the new login mechanism

step21 commented 2 years ago

Ok sure no worries. Maybe I'll get to it myself at some point.

kosimst commented 2 years ago

@step21 I wrote a quick and dirty script to subscribe to your portfolio using the TR Web API Authentication. The only problem with this approach is that the session only lasts a certain amount of time. Thus, you need to re-enter the 2FA token every time you restart or as mentioned after some time. I tried to automate the 2FA process using tasker, but was not successful. My idea would be to set up a notification trigger in tasker, extract the token from the notification and then send it to a custom webhook, where it can be used to (re-)authenticate the script.

Here is my script: https://gist.github.com/kosimst/30be00741674d262886065a5cb3a0295

Would be awesome if someone could solve the tasker part.

step21 commented 2 years ago

@kosimst Awesome, thanks. I don't think I can develop the tasker part, as this seems to be Android only and atm I only have an iOS device.