A lightweight, production-ready Python CLI tool to connect to European banks (ABN AMRO, ING, Rabobank, Revolut, N26, Nordea, and 2,500+ others) to fetch account balances and transaction ledgers via the Enable Banking PSD2 Open Banking API.
Enable Banking provides free open-banking access for personal testing and developer integration under European PSD2 regulations.
-
Sign Up & Open the Control Panel:
- Go to Enable Banking Control Panel.
- Sign in or create an account.
-
Generate your RSA Key Pair: Run the following in your terminal to generate a 4096-bit private key and self-signed certificate:
openssl req -x509 -newkey rsa:4096 -keyout private.pem -out public.crt -days 365 -nodes -subj "/CN=enablebanking-client"Keep
private.pemsafe! Never commit it to GitHub. -
Register an Application:
- In the Applications Control Panel, click "Create application" (or use the API).
- Set Environment to
PRODUCTION. - Choose service:
Account Information (AIS). - Upload your
public.crtcertificate. - Set a Redirect URL (e.g.
https://localhost/callbackor your own domain). - Add your IBAN under Linked accounts (Enable Banking operates in restricted mode for sandbox/developer accounts until un-restriction is requested).
-
Note Your Application ID: Once created, you will receive an Application ID (
kid/ UUID, e.g.e82f6e88-f0e8-4634-be3d-136c93faae9d).
Ensure you have uv installed:
git clone https://github.com/<your-username>/enablebanking-client.git
cd enablebanking-client
# Setup the virtual environment and install dependencies:
uv sync(Note: In uv, uv sync manages the virtual environment and installs the dependencies declared in pyproject.toml).
Copy .env.example to .env:
cp .env.example .envEdit .env with your details:
ENABLE_BANKING_APP_ID="YOUR_APP_ID"
ENABLE_BANKING_REDIRECT_URL="https://yourdomain.com/callback"
ENABLE_BANKING_KEY_PATH="private.pem"You can run commands using uv run python enable_banking.py (or activate .venv and run python enable_banking.py):
Check available banks for your country (e.g. NL, DE, FR, FI, ES, etc.):
uv run python enable_banking.py banks --country NLPSD2 regulations require Strong Customer Authentication (SCA) with your bank once every ~180 days:
# Authorize default bank (configured in .env or defaults to ABN AMRO):
uv run python enable_banking.py auth
# Or specify a different bank / country explicitly:
uv run python enable_banking.py auth --bank "ING" --country "NL"
uv run python enable_banking.py auth --bank "Revolut" --country "NL"- Open the printed link in your web browser.
- Log into your bank and grant permission for your account.
- Paste the redirected callback URL directly into the interactive prompt (or press Enter to finish later).
Copy either the code or the full redirected URL and run:
uv run python enable_banking.py session --code "<PASTE_CODE_OR_URL_HERE>"This stores your active session ID and linked account UIDs in session.json.
Once authorized, no further browser interactions or phone approvals are needed until consent expires:
-
Check Current Balances:
uv run python enable_banking.py balances
-
Export Transactions to CSV:
uv run python enable_banking.py transactions --days 90 --csv transactions.csv
-
Check Active Session & Expiration Date:
uv run python enable_banking.py session
Inspects the active session and prints the session JSON (look at
access.valid_untilto see when consent expires). -
Output Consolidated JSON (Ideal for Scripts & AI Agents):
uv run python enable_banking.py json --days 30
Returns a single structured JSON payload combining account balances and transaction history in one call, designed for LLMs, personal dashboards, and automated tools.
Note
Consent Lifecycle (PSD2 180-Day Rule):
Under European PSD2 regulations, bank access consents expire periodically (typically every 180 days). You can check your remaining validity at any time via enable_banking.py session. When consent expires, re-run uv run python enable_banking.py auth to renew permissions with your bank and re-authorize the session.
Unit tests are implemented with pytest and responses to mock HTTP interactions and verify JWT signing, config loading, session persistence, pagination, and CSV exports:
# Run the test suite
uv run pytest -v- Never commit
.pem,.crt,.env,session.json, or exported.csvfiles to version control. - An inclusive
.gitignoreis provided to keep your personal banking data and private keys local. - For reference on the underlying protocol, see the official Enable Banking API Reference & Flow Diagrams.
- Official multi-language examples and Python sample code: enablebanking-api-samples.