From 41b0801e1cc650df44c673c9158abb4b97f7c6b6 Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 12 Aug 2020 13:41:57 +0200 Subject: [PATCH] get account overview --- degiroapi/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/degiroapi/__init__.py b/degiroapi/__init__.py index c26e1a1..15204eb 100644 --- a/degiroapi/__init__.py +++ b/degiroapi/__init__.py @@ -18,6 +18,7 @@ class DeGiro: __PRODUCT_INFO_URL = 'https://trader.degiro.nl/product_search/secure/v5/products/info' __TRANSACTIONS_URL = 'https://trader.degiro.nl/reporting/secure/v4/transactions' __ORDERS_URL = 'https://trader.degiro.nl/reporting/secure/v4/order-history' + __ACCOUNT_URL = 'https://trader.degiro.nl/reporting/secure/v6/accountoverview' __PLACE_ORDER_URL = 'https://trader.degiro.nl/trading/secure/v5/checkOrder' __ORDER_URL = 'https://trader.degiro.nl/trading/secure/v5/order/' @@ -127,6 +128,16 @@ def transactions(self, from_date, to_date, group_transactions=False): return self.__request(DeGiro.__TRANSACTIONS_URL, None, transactions_payload, error_message='Could not get transactions.')['data'] + def account_overview(self, from_date, to_date): + account_payload = { + 'fromDate': from_date.strftime('%d/%m/%Y'), + 'toDate': to_date.strftime('%d/%m/%Y'), + 'intAccount': self.client_info.account_id, + 'sessionId': self.session_id + } + return self.__request(DeGiro.__ACCOUNT_URL, None, account_payload, + error_message='Could not get account overview.')['data'] + def orders(self, from_date, to_date, not_executed=None): orders_payload = { 'fromDate': from_date.strftime('%d/%m/%Y'),