Skip to content

fgehrlicher/dart-n26

Repository files navigation

Dart N26 Api Client

pub package Tests codecov
Unofficial dart client for the N26 api. The purpose of this client is only to retrieve data, not to send payments or change settings.

Authentication

To get a valid token from the API a 2-factor authentication is required. After calling the 'authorize' method, you will receive a pop-up message on your paired smartphone, which will ask you to tap to confirm that the sign in attempt is legitimate. confirm that and complete the completer passed to the authorize method.

Example Usage

import 'dart:async';
import 'package:http/http.dart';
import 'package:dart_n26/dart_n26.dart';

void main() async {
  // Replace these variables with your real credentials
  var email = 'YOUR N26 LOGIN EMAIL';
  var password = 'YOUR PASSWORD';

  var client = Client();
  var api = Api(client, Auth(client));

  var completer = Completer();
  completer.complete(Future.delayed(Duration(seconds: 20)));

  await api.authorize(email, password, completer);

  var transactions = await api.getTransactions(
    from: DateTime.now().subtract(Duration(days: 1)),
    to: DateTime.now(),
  );
  var profile = await api.getProfile();
  var accounts = await api.getAccounts();
  var statuses = await api.getStatuses();
  var addresses = await api.getAddresses();
  var cards = await api.getCards();
  var limits = await api.getLimits();
  var spaces = await api.getSpaces();
  var contacts = await api.getContacts();
  var statements = await api.getStatements();
  var statement = await api.getStatement(statements[0].id);
}

About

Unofficial Dart Client for the N26 Api

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages