grindsa / dkb-robo

library to access the internet banking area of "Deutsche Kreditbank" to get account information and transactions
GNU General Public License v3.0
148 stars 29 forks source link

Why get transactions only for the last year? #48

Closed kaztechSolutions closed 2 months ago

kaztechSolutions commented 1 year ago

Hi,

in dkb_robo.py, inside the get_transactions function you call validate_dates and pass the value 3 in case of legacy_login, and value 1 in case of new login to the min_year parameter. Can you explain why?

if self.legacy_login:
    (date_from, date_to) = validate_dates(self.logger, date_from, date_to, 3, self.legacy_login)
    transaction_list = self._legacy_get_transactions(transaction_url, atype, date_from, date_to, transaction_type)
else:
    (date_from, date_to) = validate_dates(self.logger, date_from, date_to, 1, self.legacy_login)
    transaction_list = self._get_transactions(transaction_url, atype, date_from, date_to, transaction_type)

I need to retrieve more than just one year, and if I change that parameter to a higher value, more that just one year is retrieved, meaning the API is supporting that. So, why do you limit that in the first place?

Regards

grindsa commented 1 year ago

Hi,

the limitation does also exist in the new DKB-API (see below screenshot from the bottom of the transaction list) Capture

The corresponding rest call 'https://banking.dkb.de/api/accounts/accounts/<uid>/transactions does always fetch the full transactions list of the last 360days and I use the date_from / date_to values for filtering only .

So the value 1 is mainly there for compatibility reasons and to auto-adjust date_from in case its are outside of the 1Y range.

If you need to retrieve more than just one year you have to use the legacy mode.

HTH G.

BroderPeters commented 4 months ago

The one-year limitation seems to be gone on the new UI. You can see the transactions until e.g. 2022 in the UI now as well. I was able to fetch the full year of 2023 by adjusting the code locally. image

As the code change looks rather simple, I'm happy to open a PR for this.

angelo-peronio commented 2 months ago

@BroderPeters are you still interested in submitting the PR you mentioned?

Now that the old UI is gone (see #58), there is no way to fetch more than 1 year in the past with the current dkb-robo version 0.26.

Let me know if I can help in any way.

grindsa commented 2 months ago

I can look into it but not before the weekend.

Sorry /G

grindsa commented 2 months ago

as @BroderPeters indicated the code changes are rather simple and much easier than I thought. I pushed a couple of changes into the devel branch and got it working on my side. Feel free to try and let me know if it works for you.

angelo-peronio commented 2 months ago

I will take a look. Thank you!

angelo-peronio commented 2 months ago

It works!

BroderPeters commented 2 months ago

Sorry for not getting back to it by the time, but great efforts from your side!

grindsa commented 2 months ago

extension got included in v0.27. Hence i am closing the issue.