You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the bug
Today I tried to fetch data from trade republic and it seems the app login is broken.
The initiate_device_reset method is not working.
From the error message it seems something is outdated on the client side.
What I tried already
I already tried to update all the python libraries (certifi, websockets, requests etc.).
I randomly tried different User-Agent headers. Nothing worked.
I tried to reverse engineer the User-Agent headers using by my phone through a http proxy, but it seems trade republic blocks the CA certificate.
To Reproduce
Minimum code example:
import hashlib
from ecdsa import NIST256p, SigningKey
import requests
_default_headers = {"User-Agent": "TradeRepublic/Android 30/App Version 1.1.5534"}
_host = "https://api.traderepublic.com"
sk = SigningKey.generate(curve=NIST256p, hashfunc=hashlib.sha512)
r = requests.post(
f"{_host}/api/v1/auth/account/reset/device",
json={"phoneNumber": phone_number, "pin": pin},
headers=_default_headers,
)
print(r.status_code)
print(r.json())
Expected behavior
This code should trigger a token to be send.
Error log
status code: 426
{'errors': [{'errorCode': 'CLIENT_VERSION_OUTDATED', 'errorMessage': None, 'meta': None}]}
That's really just a shot in the dark. But the current App version is 4.2546.1. Not sure if it is the same sent in the header, since it looks very different from the previous one 1.1.5534. But you might try with:
_default_headers = {"User-Agent": "TradeRepublic/Android 30/App Version 4.2546.1"}
That still results in an {'errors': [{'errorCode': 'CLIENT_VERSION_OUTDATED', 'errorMessage': None, 'meta': None}]}.
sadly i did also not find a way to spoof the android app, to check what its sending in such a case.
Tho its blocking any custom signed CAs (or i its above my knowledge how to fix that).
Might be an idea to drop the app login support if no one finds a solution.
That should then also "fix" #249 as ecdsa is pulled for the device login if i see it correctly
20:30:08 Logging in
Error logging in. Reset device? (y)
y
{'User-Agent': 'TradeRepublic/5834 CFNetwork/3826.600.41 Darwin/24.6.0'}
{"errors":[{"errorCode":"CLIENT_VERSION_OUTDATED","errorMessage":null,"meta":null}]}
Added the following output in the TradeRepublicAPI.initiate_device_reset
AFAIK it was the initial way of downloading documents when there was not (yet) the web-interface.
Nowerdays the "benefit" is, that you dont need the token from the web login.
I was just looking at the code because i wanted to check my code changes for the ecdsa dependency that i had prepared and noticed that the app login is broken (like mentioned in the issue by the issue author).
So for me personally i did/do just use the web login.
For me i can not confirm that its working.
I am at 5d6a19f (+ a flake config for development as i am running nixos) + a print(r.text) in pytr/api.py:136.
Running python3 pytr/main.py login -n +49<number> --applogin causes the following output.
20:38:13 Phone number provided as argument
20:38:13 Logging in
Error logging in. Reset device? (y)
y
{"errors":[{"errorCode":"CLIENT_VERSION_OUTDATED","errorMessage":null,"meta":null}]}
Traceback (most recent call last):
File "/home/shawn/dev/pytr/pytr/account.py", line 91, in login
tr.login()
File "/home/shawn/dev/pytr/pytr/api.py", line 157, in login
r = self._sign_request(
^^^^^^^^^^^^^^^^^^^
File "/home/shawn/dev/pytr/pytr/api.py", line 174, in _sign_request
signature = self.sk.sign(
^^^^^^^
File "/home/shawn/dev/pytr/pytr/api.py", line 772, in __getattr__
return object.__getattribute__(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TradeRepublicApi' object has no attribute 'sk'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/shawn/dev/pytr/pytr/main.py", line 560, in <module>
main()
File "/home/shawn/dev/pytr/pytr/main.py", line 424, in main
login(
File "/home/shawn/dev/pytr/pytr/account.py", line 97, in login
tr.initiate_device_reset()
File "/home/shawn/dev/pytr/pytr/api.py", line 137, in initiate_device_reset
self._process_id = r.json()["processId"]
~~~~~~~~^^^^^^^^^^^^^
KeyError: 'processId'
So for me the issue is still reproducible.
I mean i personally don't need AppLogin, i normally use the Web Login method, so its not important for me.
But does App login still work for one of the contributor/maintainer?
The device reset is now initiated with https://api.traderepublic.com/api/v2/auth/account/reset/device (obey the v2) and the body not only contains phoneNumber and pin but also a deviceKey
Activity
dapuzz commentedon Oct 25, 2025
Try with this useragent in api.py
_default_headers = {"User-Agent": "okhttp/4.12.0"}
ganzinotti commentedon Oct 27, 2025
That change returns status code: 403, with reason forbidden.
ExploracuriousAlex commentedon Nov 14, 2025
That's really just a shot in the dark. But the current App version is
4.2546.1. Not sure if it is the same sent in the header, since it looks very different from the previous one1.1.5534. But you might try with:_default_headers = {"User-Agent": "TradeRepublic/Android 30/App Version 4.2546.1"}Shawn8901 commentedon Nov 15, 2025
That still results in an
{'errors': [{'errorCode': 'CLIENT_VERSION_OUTDATED', 'errorMessage': None, 'meta': None}]}.sadly i did also not find a way to spoof the android app, to check what its sending in such a case.
Tho its blocking any custom signed CAs (or i its above my knowledge how to fix that).
Might be an idea to drop the app login support if no one finds a solution.
That should then also "fix" #249 as ecdsa is pulled for the device login if i see it correctly
ExploracuriousAlex commentedon Nov 15, 2025
@Shawn8901 Could you try
TradeRepublic/5834 CFNetwork/3826.600.41 Darwin/24.6.0as User-Agent?Shawn8901 commentedon Nov 15, 2025
Still gives a
CLIENT_VERSION_OUTDATED.Added the following output in the
TradeRepublicAPI.initiate_device_resetExploracuriousAlex commentedon Nov 15, 2025
There seems to be a V2. But this one gives a MISSING_REQUIRED_HEADER error.
What is the benefit of using the app login?
Shawn8901 commentedon Nov 15, 2025
AFAIK it was the initial way of downloading documents when there was not (yet) the web-interface.
Nowerdays the "benefit" is, that you dont need the token from the web login.
I was just looking at the code because i wanted to check my code changes for the ecdsa dependency that i had prepared and noticed that the app login is broken (like mentioned in the issue by the issue author).
So for me personally i did/do just use the web login.
ExploracuriousAlex commentedon Dec 2, 2025
@Shawn8901 Could you please try again? Maybe it was a temporary issue on TR side. User @richi1993 just reported, that app login still works.
Shawn8901 commentedon Dec 2, 2025
For me i can not confirm that its working.
I am at 5d6a19f (+ a flake config for development as i am running nixos) + a
print(r.text)inpytr/api.py:136.Running
python3 pytr/main.py login -n +49<number> --applogincauses the following output.So for me the issue is still reproducible.
I mean i personally don't need AppLogin, i normally use the Web Login method, so its not important for me.
But does App login still work for one of the contributor/maintainer?
ExploracuriousAlex commentedon Dec 5, 2025
I can confirm, that app login is broken for me, too. Also with the CLIENT_VERSION_OUTDATED error.
What I can tell ist, that the latest Android app uses e.g. this user-agent:
TradeRepublic/Android 35/App Version 4.2549.0Android 35ist the Android API level (see below) and4.2549.0is the Trade Republic App versionThe device reset is now initiated with
https://api.traderepublic.com/api/v2/auth/account/reset/device(obey the v2) and the body not only containsphoneNumberandpinbut also adeviceKeyRealCLanger commentedon Mar 28, 2026
As it seems the app login does not work and can't be resurrected, I'm proposing to remove the coding in #327
Allow overriding the TR app version and User-Agent from the environme…