{"id":13828676,"url":"https://github.com/femueller/python-n26","last_synced_at":"2025-07-09T06:32:36.824Z","repository":{"id":41247934,"uuid":"84929445","full_name":"femueller/python-n26","owner":"femueller","description":"💵 Unofficial Python client for n26 (Number 26) - https://n26.com/","archived":true,"fork":false,"pushed_at":"2023-10-29T09:17:00.000Z","size":404,"stargazers_count":195,"open_issues_count":13,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-05T13:56:03.154Z","etag":null,"topics":["api","bank","banking","cli","command-line-tool","n26","number26","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/femueller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["markusressel"]}},"created_at":"2017-03-14T09:20:20.000Z","updated_at":"2024-08-23T09:36:23.000Z","dependencies_parsed_at":"2023-02-18T23:01:45.148Z","dependency_job_id":"da516dbe-85dd-4df0-88a1-1c5e5066b343","html_url":"https://github.com/femueller/python-n26","commit_stats":{"total_commits":289,"total_committers":16,"mean_commits":18.0625,"dds":0.3771626297577855,"last_synced_commit":"b9aa086220dc14671ff35f26f92dc5b840ae66ef"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femueller%2Fpython-n26","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femueller%2Fpython-n26/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femueller%2Fpython-n26/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femueller%2Fpython-n26/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/femueller","download_url":"https://codeload.github.com/femueller/python-n26/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bank","banking","cli","command-line-tool","n26","number26","python"],"created_at":"2024-08-04T09:02:58.874Z","updated_at":"2024-11-20T08:30:57.827Z","avatar_url":"https://github.com/femueller.png","language":"Python","funding_links":["https://github.com/sponsors/markusressel"],"categories":["Python"],"sub_categories":[],"readme":"# N26 Python CLI/API\n\n## 2023-10-29 - Archiving the repository\n\nToday, I am marking this repository as archived, as I am not making use of the API itself anymore.  \nIf you'e interested in taking over the maintenance of the repository, please reach out to me.\n\n[![Build Status](https://github.com/femueller/python-n26/actions/workflows/python-app.yml/badge.svg)](https://github.com/femueller/python-n26/actions/workflows/python-app.yml)\n[![PyPI version](https://img.shields.io/github/pipenv/locked/python-version/femueller/python-n26)](https://img.shields.io/github/pipenv/locked/python-version/femueller/python-n26)\n[![PyPI version](https://badge.fury.io/py/n26.svg)](https://badge.fury.io/py/n26)\n[![Downloads](https://img.shields.io/pypi/dm/n26.svg)](https://img.shields.io/pypi/dm/n26.svg)\n\n[![asciicast](https://asciinema.org/a/260083.svg)](https://asciinema.org/a/260083)\n\n## About\n\n[python-n26](https://github.com/femueller/python-n26) is a Python library and Command Line Interface to request information from N26 bank accounts. You can use it to check your balance from the terminal or include it in your own Python projects.\n\n**Disclaimer:** This is an unofficial community project which is not affiliated with N26 GmbH/N26 Inc.\n\n## Install\n\n```shell\npip3 install n26\nwget https://raw.githubusercontent.com/femueller/python-n26/master/n26.yml.example -O ~/.config/n26.yml\n# configure username and password\nvim ~/.config/n26.yml\n```\n\n## Configuration\n\npython-n26 uses [container-app-conf](https://github.com/markusressel/container-app-conf) to provide different options for configuration.\nYou can place a YAML (`n26.yaml` or `n26.yml`) or TOML (`n26.toml` or `n26.tml`) configuration file in `./`, `~/` or `~/.config/`. Have a look at the [YAML example](n26.yml.example) and [TOML example](n26.tml.example).\nIf you want to use environment variables:\n\n-   `N26_USERNAME`: username\n-   `N26_PASSWORD`: password\n-   `N26_DEVICE_TOKEN`: random [uuid](https://de.wikipedia.org/wiki/Universally_Unique_Identifier) to identify the device\n-   `N26_LOGIN_DATA_STORE_PATH`: optional **file** path to store login data (recommended for cli usage)\n-   `N26_MFA_TYPE`: `app` will use the paired app as 2 factor authentication, `sms` will use SMS to the registered number.\n\nNote that **when specifying both** environment variables as well as a config file and a key is present in both locations the **enviroment variable values will be preferred**.\n\n## Authentication\n\n### Device Token\n\nSince 17th of June 2020 N26 requires a device_token to differentiate clients. This requires you to specify the `DEVICE_TOKEN`\nconfig option with a UUID of your choice. To generate a UUID you can use f.ex. one of the following options:\n\nUsing python:\n\n```python\npython -c 'import uuid; print(uuid.uuid4())'\n```\n\nUsing linux built-in tools:\n\n```shell\n\u003e uuidgen\n```\n\nUsing a website:\n[https://www.uuidgenerator.net/](https://www.uuidgenerator.net/)\n\n### 2FA\n\nSince 14th of September 2019 N26 requires a login confirmation (2 factor authentication).\n\nThere are two options here:\n\n1. Using the paired phone N26 app to approve login on devices that are not paired. This can be configured by setting `app` as the `mfa_type`. You will receive a notification on your phone when you start using this library to request data. python-n26 checks for your login confirmation every 5 seconds. If you fail to approve the login request within 60 seconds an exception is raised.\n2. Using a code delivered via SMS to your registered phone number as 2 factor authentication. This can be configured by setting `sms` as the `mfa_type`.\n\nIf you do not specify a `login_data_store_path` this login information is only stored in memory. In order to avoid that every CLI command requires a new confirmation, the login data retrieved in the above process can be stored on the file system. Please note that **this information must be protected** from the eyes of third parties **at all costs**. You can specify the location to store this data in the [Configuration](#Configuration).\n\n## Usage\n\n### CLI example\n\n```shell\n\u003e n26 balance\n123.45 EUR\n```\n\nOr if using environment variables:\n\n```bash\n\u003e N26_USER=user N26_PASSWORD=passwd N26_DEVICE_TOKEN=00000000-0000-0000-0000-000000000000 N26_MFA_TYPE=app n26 balance\n123.45 EUR\n```\n\n### JSON output\n\nIf you would like to work with the raw `JSON` rather than the pretty table\nlayout you can use the global `-json` parameter:\n\n```bash\n\u003e n26 -json balance\n{\n  \"id\": \"12345678-1234-1234-1234-123456789012\",\n  \"physicalBalance\": null,\n  \"availableBalance\": 123.45,\n  \"usableBalance\": 123.45,\n  \"bankBalance\": 123.45,\n  \"iban\": \"DE12345678901234567890\",\n  \"bic\": \"NTSBDEB1XXX\",\n  \"bankName\": \"N26 Bank\",\n  \"seized\": false,\n  \"currency\": \"EUR\",\n  \"legalEntity\": \"EU\",\n  \"users\": [\n    {\n      \"userId\": \"12345678-1234-1234-1234-123456789012\",\n      \"userRole\": \"OWNER\"\n    }\n  ],\n  \"externalId\": {\n    \"iban\": \"DE12345678901234567890\"\n  }\n}\n```\n\n### Docker\n\n```shell\n# ensure the n26 folder exists\nmkdir ~/.config/n26\n# mount the config and launch the command\nsudo docker run -it --rm \\\n  -v \"/home/markus/.config/n26.yaml:/app/n26.yaml\" \\\n  -v \"/home/markus/.config/n26:/.config/n26\" \\\n  -u 1000:1000 \\\n  femueller/python-n26\n```\n\n### API example\n\n```python\nfrom n26.api import Api\napi_client = Api()\nprint(api_client.get_balance())\n```\n\nThis is going to use the same mechanism to load configuration as the CLI tool, to specify your own configuration you can use it as:\n\n```python\nfrom n26.api import Api\nfrom n26.config import Config\n\nconf = Config(validate=False)\nconf.USERNAME.value = \"john.doe@example.com\"\nconf.PASSWORD.value = \"$upersecret\"\nconf.LOGIN_DATA_STORE_PATH.value = None\nconf.MFA_TYPE.value = \"app\"\nconf.validate()\n\napi_client = Api(conf)\nprint(api_client.get_balance())\n```\n\n## Contribute\n\nIf there are any issues, bugs or missing API endpoints, feel free to contribute by forking the project and creating a Pull-Request.\n\n### Run locally\n\nPrerequirements: [Pipenv](https://pipenv.readthedocs.io/)\n\n```shell\ngit clone git@github.com:femueller/python-n26.git\ncd python-n26\npipenv shell\npipenv install\npython3 -m n26 balance\n```\n\n### Creating a new release (only for maintainers)\n\n1. Increment version number in `n26/__init__.py` according to desired [SemVer](https://semver.org/#summary) release version\n2. Create a new release using the `Makefile`. This creates a new git tag, which triggers the \"Upload Python Package\" GitHub Action.\n    1. Run `make git-release`, this triggers: [https://github.com/femueller/python-n26/actions/workflows/python-publish.yml]()\n    2. New releases end up at: [https://pypi.org/project/n26/]()\n\n## Maintainers\n\n-   [Markus Ressel](https://github.com/markusressel)\n-   [Felix Mueller](https://github.com/femueller)\n\n## Credits\n\n-   [Nick Jüttner](https://github.com/njuettner) for providing [the API authentication flow](https://github.com/njuettner/alexa/blob/master/n26/app.py)\n-   [Pierrick Paul](https://github.com/PierrickP/) for providing [the API endpoints](https://github.com/PierrickP/n26/blob/develop/lib/api.js)\n\n## Similar projects\n\n-   Go: https://github.com/guitmz/n26 by [Guilherme Thomazi Bonicontro](https://github.com/guitmz)\n-   Go: https://github.com/njuettner/n26 by [Nick Jüttner](https://github.com/njuettner) (unmaintained)\n-   Node https://github.com/PierrickP/n26 by [Pierrick Paul](https://github.com/PierrickP/) (unmaintained)\n\n## Disclaimer\n\nThis project is not affiliated with N26 GmbH/N26 Inc. if you want to learn more about it, visit https://n26.com/.\n\nWe've been trying [hard to collaborate with N26](https://github.com/femueller/python-n26/issues/107#issuecomment-1008825746) however, it's been always really challenging.  \nThere is no guarantee that this project continues to work at any point, since none of the API endpoints are really documented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemueller%2Fpython-n26","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffemueller%2Fpython-n26","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemueller%2Fpython-n26/lists"}