Zarathustra2 / TradeRepublicApi

Unofficial trade republic API
MIT License
280 stars 69 forks source link

Issue to get isin company name ? #11

Open Gustry opened 3 years ago

Gustry commented 3 years ago

Hi,

I'm trying this library but I'm not able to download any company names.

(.venv) etienne@latitude:~/dev/python/TradeRepublicApi/examples (default_language)$ python3 isinDownloader.py -i US72919P2020
Processing US72919P2020
US72919P2020
{'isin': '', 'company': {'name': None, 'description': None, 'yearFounded': None, 'tickerSymbol': None, 'peRatioSnapshot': None, 'pbRatioSnapshot': None, 'dividendYieldSnapshot': None, 'earningsCall': None, 'marketCapSnapshot': None, 'dailyCloseYearSD': None, 'beta': None, 'countryCode': None, 'ceoName': None, 'cfoName': None, 'cooName': None, 'employeeCount': None}, 'similarStocks': [], 'expectedDividend': None, 'dividends': [], 'totalDivendendCount': 0, 'events': [], 'analystRating': {'targetPrice': None, 'recommendations': None}, 'hasKpis': False, 'key': 'stockDetails US72919P2020'}
Finished!

This example was given in the README.md. Same result if I give my own myPortfolio.json. It's all None.

I'm trying to translate the readme from german to english to see if there is some known issues.

Is-there a change on TR side ?

iamnazri commented 2 years ago

I am also getting empty json strings with the majority of the ISIN from my portfolio. I managed to get data from ISIN with the prefix "DE", while the ISIN that returned no information are ISIN's that is prefixed with "IE". Is this a general problem with ISIN that other than DE's ?

iamnazri commented 2 years ago

For context, I was playing around with isinDownloader.py and got the results that @Gustry posted. This has apparently to do with the typeId. Any items that does not have the typeId stock will return an empty response. I managed to get the details of all of the ISIN that is in my portfolio by using a query of type instrument. This is used in the function derivative_details in api.py.

This is the response that I got for an item that returned an empty response before.

Maybe, we could first query the instrument and check it's typeId before making a second query for it's stockDetails?