Nordigen Python
This is official Python client library for GoCardless Bank Account Data API
For a full list of endpoints and arguments, see the docs.
Before starting to use API you will need to create a new secret and get your SECRET_ID
and SECRET_KEY
from the GoCardless Bank Account Data Portal.
Requirements
Installation
Install library via pip package manager:
pip install nordigen
Example application
Example code can be found in main.py
file and Flask application can be found in the example
directory
Quickstart
from uuid import uuid4
from nordigen import NordigenClient
client = NordigenClient(
secret_id="SECRET_ID",
secret_key="SECRET_KEY"
)
token_data = client.generate_token()
client.token = "YOUR_TOKEN"
new_token = client.exchange_token(token_data["refresh"])
institution_id = client.institution.get_institution_id_by_name(
country="LV",
institution="Revolut"
)
institutions = client.institution.get_institutions("LV")
init = client.initialize_session(
institution_id=institution_id,
redirect_uri="https://gocardless.com",
reference_id=str(uuid4())
)
link = init.link
requisition_id = init.requisition_id
After successful authorization with a bank you can fetch your data (details, balances, transactions)
Fetching account metadata, balances, details and transactions
accounts = client.requisition.get_requisition_by_id(
requisition_id=init.requisition_id
)
account_id = accounts["accounts"][0]
account = client.account_api(id=account_id)
meta_data = account.get_metadata()
details = account.get_details()
balances = account.get_balances()
transactions = account.get_transactions()
transactions = account.get_transactions(date_from="2021-12-01", date_to="2022-01-21")
Premium endpoints
premium_transactions = account.get_premium_transactions(
country="LV",
date_from="2021-12-01",
date_to="2022-01-21"
)
premium_details = account.get_premium_details()
Support
For any inquiries please contact support at bank-account-data-support@gocardless.com or create an issue in repository.