Git Product home page Git Product logo

degiro_api's Introduction

License: MIT

A Dart wrapper to use the Degiro APIs in a simple way.

Since it is just a wrapper, consider these APIs unofficial.

NOTE: this package doesn't allow to perform any type of order creation in your account due to Degiro's current restrictions about their API usage.

Usage

// Create the DegiroApi instance
final degiro = DegiroApi.fromCredentials('username', 'password');

try {
    // Gets the current instance and know if we are logged
    print(DegiroApi.instance.isLoggedIn ? 'yes' : 'no');

    // Logins with credentials provided and creates the session
    await degiro.login();

    // Gets the account info (login method returns this property)
    final accountInfo = degiro.accountInfo;

    // Gets the account current portfolio positions
    final List<PortfolioPosition> positions = await degiro.portfolioPositions();

    // Show the positions name list
    for (var p in positions) {
      print(p.productInfo?.name);
    }

    // Logout from the session
    await degiro.logout();
} on DegiroApiError catch (e) {
    print(e.message);
}

Available methods

Constructors

  • DegiroApi.fromCredentials(String username, String password)

    creates the degiro instance based on the username & password. NOTE: 2FA is in roadmap

  • DegiroApi.fromSession(String sessionId)

    creates the degiro instance based on the jsessionid. It can be taken from the browser dev tool accessing network request. Every request to a Degiro API must contain a sessionId to be perfomed.

Methods

  • login
  • logout
  • portfolioPositions
  • productInfo
  • productInfos
  • transactions
  • searchProducts
  • cashMovements

Contributing

Since this package is maintained by one person, help is appreciated so feel free to open issues & pull requests on GitHub repository.

Freezed code generation

Run this command to auto-generate the models if you add new fields to them

dart run build_runner build --delete-conflicting-outputs 

degiro_api's People

Contributors

marcoredz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

olaturmo

degiro_api's Issues

Prices not up-to-date

Hello,

Thanks a lot for your plugin.
May I ask if is it normal that API only takes close price and not in real time ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.