Skip to main content

dkb-robo

GitHub release GitHub last commit (branch) GitHub last commit (branch) PyPI - Downloads

Codecov main Codecov devel

Security Rating Maintainability Rating Reliability Rating Quality Gate Status

dkb-robo is a python library to access the internet banking area of "Deutsche Kreditbank" to fetch

  • account information and current balances
  • transactions from creditcards and checking accounts (Girokonten)
  • query the content of "DKB Postbox"
  • get standing orders (Dauerauftrag)
  • get information about credit limits and exemption orders (Freistellungsauftrag)

Starting from version 0.9 dkb-robo can handle the 2nd factor DKB introduced to fulfill the PSD2 obligations. Starting from September 2019 logins must be confirmed by either

The introduction of a 2nd factor does limit the usage of dkb-robo for automation purposes. DKB is unfortunately not willing/ not able not allowed to open their PSD2-API for non-Fintechs. I discussed this with them for weeks at some point they stopped responding to my emails so I gave up.

DKB introduced a new web-frontend in July 2023 which is using a REST-API as backend. The migration to the new REST endpoints started with v0.22 and has been completed with v0.27. An unofficial OpenAPI description of the endpoints used by dkb-robo is available in doc/openapi.yaml.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

To run dkb-robo on your system you need

Please make sure python and all the above modules had been installed successfully before you start any kind of testing.

Installing

via Pypi

> pip install dkb_robo

manually for all users

  1. download the archive and unpack it
  2. enter the directory and run the setup script
> python setup.py install

manually for a single user

  1. download the archive and unpack it
  2. move the "dkb_robo" subfolder into the directory your script is located

SBOM

A bill of material of the packages coming along wiht dkb-robo will be automatically created during build process and stored in my SBOM respository

Usage

you need to import dkb-robo into your script

> from dkb_robo import DKBRobo

create a new DKBRobo context handler and login to DKB portal

with DKBRobo(
    dkb_user=<login username>,
    dkb_password=<password>,
    chip_tan=True|False|qr,
    mfa_device=<m|int>,
    debug=True|False,
    unfiltered=True|False,
    headless=True|False,
    xvfb=True|False,
    session_backend=requests|curl-cffi,
    http1_only=True|False,
    proxies={"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"},
) as dkb:
  • dbk_user: username to access the dkb portal
  • dkb_password: corresponding login password
  • chip_tan: (True/False/qr) TAN usage - when not "False" dbk-robo will ask for a TAN during login. So far this library only supports "chipTAN manuell" and "chipTAN QR. "qr" foces the usage of "chipTAN QR" all other values will trigger the usage of "chipTAN Manuell"
  • mfa_device: ('m'/Integer) optional - preselect MFA device to be used for 2nd factor - 'm' - main device, otherwise number from device-list
  • debug: (True/False) Debug mode
  • unfiltered: (True/False) Unfiltered mode
  • headless: (True/False) Run the captcha browser in headless mode
  • xvfb: (True/False) Use Xvfb virtual display during captcha solving (useful on headless Linux servers)
  • session_backend: ("requests"/"curl-cffi") HTTP backend used to create the login session. Default is "requests". When set to "curl-cffi", install the optional curl-cffi package first.
  • http1_only: (True/False) Force HTTP/1.1 when using session_backend="curl-cffi". Default is False.
  • proxies: (dict/None) Optional proxy mapping for requests. Example: {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}

After login you can return a dictionary containing a list of your accounts, the actual balance and a link to fetch the transactions

from pprint import pprint
pprint(dkb.account_dic)
{0: {
     'amount': '1458.00',
     'currencycode': 'EUR',
     'date': '22.01.2023',
     'holdername': 'Firstname Lastname',
     'iban': 'DEXXXXXXXXXXXXXXXXXXXXX',
     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
     'limit': '2500.00',
     'name': 'Girokonto',
     'productgroup': 'Meine Konten',
     'transactions': 'https://banking.dkb.de/api/accounts/accounts/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',
     'type': 'account'},
 1: {
     'amount': -1000.23,
     'currencycode': 'EUR',
     'date': '22.01.2023',
     'holdername': 'Firstname Lastname',
     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
     'limit': '2000.00',
     'maskedpan': '1234XXXXXXXX5678',
     'name': 'Visa CC',
     'productgroup': 'Meine Konten',
     'transactions': 'https://banking.dkb.de/api/credit-card/cards/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',
     'type': 'creditcard'},
 2: {
     'amount': 100000.23,
     'currencycode': 'EUR',
     'date': '22.01.2023',
     'holdername': 'Firstname lastname',
     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
     'limit': '0.00',
     'maskedpan': '5678XXXXXXXX1234',
     'name': 'Another Visa',
     'productgroup': 'Meine Konten',
     'transactions': 'https://banking.dkb.de/api/credit-card/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',
     'type': 'creditcard'},
 3: {
     'amount': '123456,79',
     'currencycode': 'EUR',
     'holdername': 'Firstname Lastname',
     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
     'name': 'Mein Depot',
     'productgroup': 'Meine Konten',
     'transactions': 'https://banking.dkb.de/api/broker/brokerage-accounts/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx(positions?include=instrument%2Cquote',
     'type': 'depot'}}

to get the list of transactions for a certain checking account or a credit card use the following method

tlist = dkb.get_transactions(link, type, date_from, date_to)
  • link - link to get transactions for a specific account - see former step if you do not know how to get it
  • type - account type (either "account" or "creditcard") - see former step if you do not know how to get it
  • date_from - start date in European notation (DD.MM.YYYY)
  • date_to - end date in European notation (DD.MM.YYYY)
  • transaction_type - optional: "booked" (default if not specified) or "pending" ("vorgemerkt")

this method returns a list of transactions.

A list of transactions for a regular checking account follows the below format.

from pprint import pprint
pprint(tlist)
[{'amount': -44.98,
  'bdate': '2023-01-22',
  'currencycode': 'EUR',
  'customerreferenz': 'XXXXXX',
  'peer': 'PayPal Europe S.a.r.l. et Cie S.C.A',
  'peeraccount': 'XXXXXXXXX',
  'peerbic': 'XXXXXXXXX',
  'peerid': 'XXXXXXXXXXX',
  'postingtext': 'FOLGELASTSCHRIFT',
  'reasonforpayment': 'XXXXXX PP.XXXXX.PP . Foo-bar AG, Ihr Einkauf bei '
                      'Foo-bar AG',
  'vdate': '2023-01-22'},
 {'amount': -70.05,
  'bdate': '2023-01-22',
  'currencycode': 'EUR',
  'customerreferenz': '68251782022947180823144926',
  'peer': 'FEFASE GmbH',
  'peeraccount': 'XXXXXXXXX',
  'peerbic': 'XXXXXXXXX',
  'peerid': 'XXXXXXXXX',
  'postingtext': 'SEPA-ELV-LASTSCHRIFT',
  'reasonforpayment': 'ELV68251782 18.08 14.49 MEFAS ',
  'vdate': '2023-01-22'},
 {'amount': -7.49,
  'bdate': '2023-01-22',
  'currencycode': 'EUR',
  'customerreferenz': '3REFeSERENC',
  'peer': 'PEER',
  'peeraccount': 'XXXXXXXXX',
  'peerbic': 'XXXXXXXXX',
  'peerid': 'XXXXXXXXX',
  'postingtext': 'FOLGELASTSCHRIFT',
  'reasonforpayment': 'VIELEN DANK VON BAR-FOO GMBH',
  'vdate': '2023-01-22'}]

The list of transactions from a creditcard will look as below:

[{'amount': 500.0,
  'bdate': '2023-08-18',
  'currencycode': 'EUR',
  'text': 'Berliner Sparkasse',
  'vdate': '2023-08-18'},
 {'amount': 125.95,
  'bdate': '2023-08-14',
  'currencycode': 'EUR',
  'text': 'Zara Deutschland 3742',
  'vdate': '2023-08-14'},
 {'amount': 500.0,
  'bdate': '2023-08-14',
  'currencycode': 'EUR',
  'text': 'Commerzbank Berlin',
  'vdate': '2023-08-14'}]

A brokerage account (depot) will not show the list of transactions but rather a list of positions:

[{'currencycode': 'EUR',
  'isin_wkn': 'DE0005140008',
  'lastorderdate': '2017-01-01',
  'market': 'Frankfurt',
  'price': 9.872,
  'price_euro': '39488.00',
  'quantity': 4000.0,
  'shares_unit': 'pieces',
  'text': 'DEUTSCHE BANK AG NA O.N.'},
 {'currencycode': 'EUR',
  'isin_wkn': 'DE0005557508',
  'lastorderdate': '2017-10-01',
  'market': 'Frankfurt',
  'price': 19.108,
  'price_euro': '28.662.00',
  'quantity': 1500.0,
  'shares_unit': 'pieces',
  'text': 'DT.TELEKOM AG NA'}]

to get the credit limits per account or credit-card the method get_credit_limits() must be used

> c_list = dkb.get_credit_limits()

This method returns a dictionary of all identified accounts including the credit limit per account

{u'XXXX********XXXX': 100.00,
 u'4748********XXXX': 10000.00,
 u'XXXX********XXXX': 10000.00,
 u'DEXX XXXX XXXX XXXX XXXX XX': 200.00,
 u'DEXX XXXX XXXX XXXX XXXX XX': 2000.00}

A list of standing orders (Daueraufträge) can be obtained by calling get_standing_orders() method

> so = dkb.get_standing_orders(account_id)
  • account_id - 'id' field from account dictionary (dkb.account_dic[x]['id'])

A list of standing orders will be returned containing a dictionary per standing order

> pprint(so)
[{'amount': 30.0,
  'creditoraccount': {'bic': 'BIC-1', 'iban': 'IBAN-1'},
  'currencycode': 'EUR',
  'interval': {'frequency': 'monthly',
               'from': '2019-01-05',
               'holidayExecutionStrategy': 'following',
               'nextExecutionAt': '2023-10-01',
               'until': '2025-12-01'},
  'purpose': 'Purpose-1',
  'recpipient': 'Recipient-1'},
 {'amount': 58.0,
  'creditoraccount': {'bic': 'BIC-2', 'iban': 'IBAN-2'},
  'currencycode': 'EUR',
  'interval': {'frequency': 'monthly',
               'from': '2022-12-30',
               'holidayExecutionStrategy': 'following',
               'nextExecutionAt': '2023-12-01'},
  'purpose': 'Purpose-2',
  'recpipient': 'Recipient-2'},]

The method get_exemption_order() can be used to get the exemption orders (Freistellungsaufträge)

> exo = dkb.get_exemption_order()

A dictionary similar to the one below will be returned

> pprint(exo)
[{'amount': 2000.0,
  'currencycode': 'EUR',
  'partner': {'dateofbirth': '1980-01-01',
              'firstname': 'Jane',
              'lastname': 'Doe',
              'salutation': 'Frau',
              'taxid': '1234567890'},
  'receivedat': '2017-01-01',
  'type': 'joint',
  'used': 567.89,
  'validfrom': '2020-01-01',
  'validto': '9999-12-31'}]

To get the amount of dkb points the below method can be used

> points_dic = dkb.get_points()

A dictionary similar to the below will be returned

> pprint(points_dic)
{u'DKB-Punkte': 99999,
 u'davon verfallen zum  31.12.2018': 999}

To scan the DKB postbox for documents the below method can be used

> document_dic = dkb.scan_postbox(path, download_all, archive, prepend_date)
  • path - optional argument. If specified, documents will be downloaded and stored
  • dowload_all (True/False) - optional argument. By default only unread documents from DKB postbox will get downloaded and marked as "read". By setting this parameter all documents will be downloaded
  • archive (True/False) - optional argument. When set to True the "Archiv" folder in the Postbox will be scanned and documents will be downloaded if a path variable is specificed. Handle this parameter with care as the amount of documents to be downloaded can be huge.
  • prepend_date (True/False) - optional argument. Prepend document date in YYYY-MM-DD_ format to each document to allow easy sorting of downloaded files

The method will return a dictionary containing the different postbox folders and links to download the corresponding documents

Check the scripts dkb_example.py and dkb_docdownload.py for further examples.

dkb_robo command line interface (CLI)

Starting with v0.20 dkb_robo comes with a CLI tool

$ dkb --help
Usage: dkb [OPTIONS] COMMAND [ARGS]...

Options:
  -d, --debug                     Show additional debugging
  --headless                      Run captcha browser in headless mode
  --xvfb                          Use Xvfb virtual display for captcha solving (for headless servers)
  -t, --chip-tan TEXT             use [ChipTan](https://www.dkb.de/fragen-antworten/was-ist-das-chiptan-verfahren) for login ("qr" for chipTan-QR "manual" for chipTan-manuell)
  -u, --username TEXT             username to access the dkb portal
                                  [required]
  -p, --password TEXT             corresponding login password
  --password-env-var TEXT         Environment variable name that contains the login password
                                  [default: DKB_PASSWORD]
  --format [pprint|table|csv|json]
                                  output format to use
  --http1-only                    Force HTTP/1.1 for curl-cffi sessions
  --proxy TEXT                    Proxy address used for both HTTP and HTTPS requests
  --help                          Show this message and exit.

Commands:
  accounts
  credit-limits
  download
  interactive
  scan-postbox
  last-login
  standing-orders
  transactions

--proxy and --http1-only are startup options. They must be passed before the subcommand.

Example command to fetch account list

dkb -u <user> -p <password> accounts

If the dkb command is not available in your shell, use module mode instead:

python3 -m dkb_robo -u <user> -p <password> accounts

Use environment variables for password

By default the CLI reads the login password from DKB_PASSWORD if -p/--password is not provided.

export DKB_USERNAME="<user>"
export DKB_PASSWORD="<password>"
dkb accounts

You can also configure a custom environment variable name:

export DKB_USERNAME="<user>"
export MY_DKB_PASSWORD="<password>"
dkb --password-env-var MY_DKB_PASSWORD accounts

Example commands to fetch transactions via CLI tool

dkb -u <user> -p <password> transactions --name Girokonto
dkb -u <user> -p <password> transactions --account "DE75xxxxxxxxxxxxxxxxxxx"
dkb -u <user> -p <password> transactions --account "DE75xxxxxxxxxxxxxxxxxxx" --date-from 2023-08-01  --date-to 2023-08-15"
dkb -u <user> -p <password> --proxy "http://127.0.0.1:8080" accounts
dkb -u <user> -p <password> --proxy "http://127.0.0.1:8080" --http1-only accounts

Example commands to download postbox documents via CLI tool

# download all documents into ./documents, one folder per account/depot
dkb -u <user> -p <password> download --all --path documents --use-account-folders --prepend-date
# only securities documents (e.g. for an import into Portfolio Performance), keep them unread in the postbox
dkb -u <user> -p <password> download --all --path documents --category Wertpapierdokumente --no-mark-read
  • --category/-c restricts the download to one or more categories (Wertpapierdokumente, Kontoauszüge, Kreditkartenabrechnungen, or the raw DKB document type). It can be given multiple times and is case-insensitive.
  • --no-mark-read keeps downloaded documents unread in the DKB postbox (default: --mark-read).

Interactive mode

Use interactive mode to login once, run multiple commands, and logout at the end.

dkb -u <user> -p <password> interactive

Interactive commands run in the same session, for example:

dkb> accounts
dkb> last-login
dkb> transactions --name Girokonto
dkb> download --list-only
dkb> logout

You can also start interactive mode with startup options:

dkb -u <user> -p <password> --proxy "http://127.0.0.1:8080" --http1-only interactive

On Windows, use either dkb ... or py -m dkb_robo ....

Further documentation

please check the doc folder of the project. You will find further documentation and an example scripts of all dkb-robo methods there.

Contributing

Please read CONTRIBUTING.md for details on my code of conduct, and the process for submitting pull requests. Please note that I have a life besides programming. Thus, expect a delay in answering.

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the GPLv3 - see the LICENSE.md file for details

Metadata

Release files for dkb-robo 0.32.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dkb-robo 0.32.1
File Size Uploaded Provenance Actions
dkb_robo-0.32.1.tar.gz 102.6 kB With provenance Details for dkb_robo-0.32.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dkb-robo 0.32.1
File Interpreter ABI Platform Actions
dkb_robo-0.32.1-py3-none-any.whl Python 3 none any Details for dkb_robo-0.32.1-py3-none-any.whl

Total release size: 167.1 kB

Release files / dkb_robo-0.32.1.tar.gz

Download URL dkb_robo-0.32.1.tar.gz
Size 102.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae589350baeeb2a8fa2e4c768d3d79179ab585789ddf8743c45aa19bbdcaf44
BLAKE2b-256 checksum
How to use checksums
905b9ea423ce6db7fff10b730e97485e820070dc5fa1084331c837275722f166
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / dkb_robo-0.32.1-py3-none-any.whl

Download URL dkb_robo-0.32.1-py3-none-any.whl
Size 64.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
304165b086cd27863a5259a6a2fc5aef3be9446abb7d8ca6842627f0992df97a
BLAKE2b-256 checksum
How to use checksums
b9e5f8105202b35afe620c9092bda05b31bb5cc6ecd2cad3fb95de33851223e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for dkb-robo 0.32.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dkb_robo-0.32.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.32.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page