degiroasync.webapi’s documentation
A Python API close to Webtrader HTTP API
Async API for Degiro. This module is close to Degiro Web API structure: responses are provided (almost) as-is with minimum abstraction and verification.
For a higher level api, see api module.
Users should only import directly from degiroasync.webapi, its submodules should be considered implementation details.
- async degiroasync.webapi.check_order(session: SessionCore, *, product_id: str, buy_sell: str, time_type: TIME, order_type: TYPE, size: int, price: float | None = None) Dict[str, Any]
Start the placing order process. This is used to retrieve order cost for instance and is mandatory to actually place an order with confirm_order.
- buy_sell:
One of (‘BUY’, ‘SELL’).
- price:
Price in currency of the product.
- product_id:
Product on which to place the order.
- order_type:
Specify if we want a STOP_LIMITED, MARKET_ORDER, STOP_LOSS, STOP_LIMITED.
- time_type:
Specify if we want a DAY or PERMANENT order.
Check degiroasync.core.ORDER for details.
Example data with request: ``` {
“buySell”: “BUY”, “orderType”: 0, “price”: 10, “productId”: “96008”, “size”: 1, “timeType”: 1
}
Example JSON response: ``` {
- “data”: {
“confirmationId”: “c64332f0-a800-4f04-bc29-12a2b7efa20b”, “freeSpaceNew”: 2282.0, “showExAnteReportLink”: true, “transactionFee”: 0.5
}
}
- async degiroasync.webapi.confirm_order(session: SessionCore, *, confirmation_id: str, product_id: str, buy_sell: str, time_type: TIME, order_type: TYPE, size: int, price: float | None = None)
Close the placing order process. This is used after check_order to confirm placing an order. It must be called with the same paramaters and the confirmation_id obtained with check_order.
- buy_sell:
One of (‘BUY’, ‘SELL’).
- price:
Price in currency of the product.
- product_id:
Product on which to place the order.
- order_type:
Specify if we want a STOP_LIMITED, MARKET_ORDER, STOP_LOSS, STOP_LIMITED.
- time_type:
Specify if we want a DAY or PERMANENT order.
Check degiroasync.core.ORDER for details.
Example data with request:
Example JSON response:
{ 'data': { 'confirmationId': 'a8e49a7e-4d79-4f21-961b-988dc0806d09', 'freeSpaceNew': 55395, 'transactionFee': 0.5, 'showExAnteReportLink': True } }
- async degiroasync.webapi.get_account_info(session: SessionCore) SessionCore
- async degiroasync.webapi.get_client_info(session: SessionCore) SessionCore
Get client information.
- async degiroasync.webapi.get_company_profile(session: SessionCore, isin: str) Dict[str, Any]
Get company profile.
- async degiroasync.webapi.get_config(session: SessionCore) SessionCore
Populate session with configuration
- async degiroasync.webapi.get_news_by_company(session: SessionCore, isin: str, limit: int = 10, languages: List[str] = ['en'], offset: int = 0) Dict[str, Any]
Get news for a company.
- async degiroasync.webapi.get_orders(session: SessionCore) Dict[str, Any]
Get current and historical orders.
Example response:
- {‘orders’: [
{ ‘id’: ‘52401b7d-00ed-4aed-979d-a2476e331b26’, ‘date’: ‘2022-05-12T15:08:33’, ‘productId’: 255931, ‘product’: ‘Veolia Environnement’, ‘contractType’: 1, ‘contractSize’: 1.0, ‘currency’: ‘EUR’, ‘buysell’: ‘B’, ‘size’: 100.0, ‘quantity’: 100.0, ‘price’: 24.7, ‘stopPrice’: 0.0, ‘totalOrderValue’: 2470.0, ‘orderTypeId’: 0, ‘orderTimeTypeId’: 1, ‘orderType’: ‘LIMIT’, ‘orderTimeType’: ‘DAY’, ‘isModifiable’: True, ‘isDeletable’: True }]
}
- async degiroasync.webapi.get_orders_history(session: SessionCore, from_date: str, to_date: str) Dict[str, Any]
Get historical orders for session.
- from_date:
Date in format DD/MM/YYYY. Raise ValueError if incorrect format.
- to_date:
Date in format DD/MM/YYYY. Raise ValueError if incorrect format.
Example return in json(): ``` {
- ‘data’: {
- [
- {
‘created’: ‘2021-11-05T11:56:33+01:00’, ‘orderId’: ‘asdfjkhrewqrkljh’, ‘productId’: 12341234, ‘size’: 100, ‘price’: 390, ‘buysell’: ‘B’, ‘orderTypeId’: 1, ‘stopPrice’: 0, ‘currentTradedSize’: 0, ‘totalTradedSize’: 0, ‘type’: ‘CREATE’, ‘status’: ‘CONFIRMED’, ‘last’: ‘2021-11-6T12:33:23+01:00’, ‘isActive’: True
}
]
}
}
- async degiroasync.webapi.get_portfolio(session: SessionCore) Dict[str, Any]
Get portfolio web call.
- Returns:
Example dictionary portfolio
.. code-block:: python –
- {‘portfolio’: {‘isAdded’: True,
’lastUpdated’: 1088, ‘name’: ‘portfolio’, ‘value’: [
- {‘id’: ‘8614787’,
’isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [
- {‘isAdded’: True,
’name’: ‘id’, ‘value’: ‘8614787’},
- {‘isAdded’: True,
’name’: ‘positionType’, ‘value’: ‘PRODUCT’},
- {‘isAdded’: True,
’name’: ‘size’, ‘value’: 100},
- {‘isAdded’: True,
’name’: ‘price’, ‘value’: 73.0},
- {‘isAdded’: True,
’name’: ‘value’, ‘value’: 7300.0},
- {‘isAdded’: True,
’name’: ‘accruedInterest’},
- {‘isAdded’: True,
’name’: ‘plBase’, ‘value’: {‘EUR’: -6716.901595272}},
- {‘isAdded’: True,
’name’: ‘todayPlBase’, ‘value’: {‘EUR’: -7300.0}},
- {‘isAdded’: True,
’name’: ‘portfolioValueCorrection’, ‘value’: 0},
- {‘isAdded’: True,
’name’: ‘breakEvenPrice’, ‘value’: 68.15},
- {‘isAdded’: True,
’name’: ‘averageFxRate’, ‘value’: 1},
- {‘isAdded’: True,
’name’: ‘realizedProductPl’, ‘value’: 98.098404728},
- {‘isAdded’: True,
’name’: ‘realizedFxPl’, ‘value’: 0},
- {‘isAdded’: True,
’name’: ‘todayRealizedProductPl’, ‘value’: 0.0},
- {‘isAdded’: True,
’name’: ‘todayRealizedFxPl’, ‘value’: 0} ]
- },
…
- },
- {‘id’: ‘EUR’,
’isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [
{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘EUR’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: -53676.25}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: -53676.25}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 53676.2467863145}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 53676.2467863145}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]
}, {‘id’: ‘USD’,
’isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘USD’},
- {‘isAdded’: True,
’name’: ‘positionType’, ‘value’: ‘CASH’},
- {‘isAdded’: True,
’name’: ‘size’, ‘value’: 0.0},
{‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: -4.216892111}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘PLN’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘PLN’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 1.8128205}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘GBP’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘GBP’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘FLATEX_EUR’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘FLATEX_EUR’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0.0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘FLATEX_USD’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘FLATEX_USD’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘FLATEX_PLN’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘FLATEX_PLN’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}, {‘id’: ‘FLATEX_GBP’, ‘isAdded’: True, ‘name’: ‘positionrow’, ‘value’: [{‘isAdded’: True, ‘name’: ‘id’, ‘value’: ‘FLATEX_GBP’}, {‘isAdded’: True, ‘name’: ‘positionType’, ‘value’: ‘CASH’}, {‘isAdded’: True, ‘name’: ‘size’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘price’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘value’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘accruedInterest’}, {‘isAdded’: True, ‘name’: ‘plBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘todayPlBase’, ‘value’: {‘EUR’: 0}}, {‘isAdded’: True, ‘name’: ‘portfolioValueCorrection’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘breakEvenPrice’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘averageFxRate’, ‘value’: 1}, {‘isAdded’: True, ‘name’: ‘realizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘realizedFxPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedProductPl’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayRealizedFxPl’, ‘value’: 0}]}]}, ‘totalPortfolio’: {‘isAdded’: True, ‘lastUpdated’: 22, ‘name’: ‘totalPortfolio’, ‘value’: [{‘isAdded’: True, ‘name’: ‘degiroCash’, ‘value’: -53676.25}, {‘isAdded’: True, ‘name’: ‘flatexCash’, ‘value’: 0.0}, {‘isAdded’: True, ‘name’: ‘totalCash’, ‘value’: -53676.25}, {‘isAdded’: True, ‘name’: ‘totalDepositWithdrawal’, ‘value’: 63950.27}, {‘isAdded’: True, ‘name’: ‘todayDepositWithdrawal’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘cashFundCompensationCurrency’, ‘value’: ‘EUR’}, {‘isAdded’: True, ‘name’: ‘cashFundCompensation’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘cashFundCompensationWithdrawn’, ‘value’: 28.79}, {‘isAdded’: True, ‘name’: ‘cashFundCompensationPending’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘todayNonProductFees’, ‘value’: 0}, {‘isAdded’: True, ‘name’: ‘totalNonProductFees’, ‘value’: -657.242202735}, {‘isAdded’: True, ‘name’: ‘freeSpaceNew’, ‘value’: {‘EUR’: 35136.647442}}, {‘isAdded’: True, ‘name’: ‘reportMargin’, ‘value’: 35136.647442}, {‘isAdded’: True, ‘name’: ‘reportCreationTime’, ‘value’: ‘12:48:31’}, {‘isAdded’: True, ‘name’: ‘reportPortfValue’, ‘value’: 149223.516559}, {‘isAdded’: True, ‘name’: ‘reportCashBal’, ‘value’: -53676.2465}, {‘isAdded’: True, ‘name’: ‘reportNetliq’, ‘value’: 95547.270059}, {‘isAdded’: True, ‘name’: ‘reportOverallMargin’, ‘value’: 60410.622617}, {‘isAdded’: True, ‘name’: ‘reportTotalLongVal’, ‘value’: 104456.461592}, {‘isAdded’: True, ‘name’: ‘reportDeficit’, ‘value’: 50780.215092}, {‘isAdded’: True, ‘name’: ‘marginCallStatus’, ‘value’: ‘NO_MARGIN_CALL’}, {‘isAdded’: True, ‘name’: ‘marginCallDeadline’}]}
}
- async degiroasync.webapi.get_price_data(*args, **kwargs)
DEPRECATED: Please use get_price_series instead
- async degiroasync.webapi.get_price_series(session: SessionCore, vwdId: str, vwdIdentifierType: str, resolution: RESOLUTION = RESOLUTION.PT1D, period: PERIOD = PERIOD.P1MONTH, timezone: str = 'Europe/Paris', culture: str = 'fr-FR', data_type: TYPE = TYPE.PRICE) Dict[str, Any]
Get price data for a company.
- Parameters:
'Open' (data_type = 'ohlc' provides access to) –
'High' –
'Low' –
in ('Close') –
period (that order for each) –
data. (instead of price) –
'vwdkey' (vwdIdentifierType can be 'issueid' or) –
- Returns:
Example returned JSON
.. code-block:: json –
- {
“requestid”: “1”, “start”: “2022-01-20T00:00:00”, “end”: “2022-01-20T14:12:24”, “resolution”: “PT1M”, “series”: [
- {
“expires”: “2022-01-20T10:12:56+01:00”, “data”: {
”issueId”: 360114899, “companyId”: 1001, “name”: “AIRBUS”, “identifier”: “issueid:360114899”, “isin”: “NL0000235190”, “alfa”: “AIR15598”, “market”: “XPAR”, “currency”: “EUR”, “type”: “AAN”, “quality”: “REALTIME”, “lastPrice”: 113.1, “lastTime”: “2022-01-21T14:12:24”, “absDiff”: -2.62, “relDiff”: -0.02264, “highPrice”: 114.46, “highTime”: “2022-01-21T10:31:14”, “lowPrice”: 112.78, “lowTime”: “2022-01-21T13:56:36”, “openPrice”: 114.0, “openTime”: “2022-01-21T09:00:19”, “closePrice”: 114.0, “closeTime”: “2022-01-21T09:00:19”, “cumulativeVolume”: 857092.0, “previousClosePrice”: 115.72, “previousCloseTime”: “2022-01-20T17:35:03”, “tradingStartTime”: “09:00:00”, “tradingEndTime”: “17:40:00”, “tradingAddedTime”: “00:10:00”, “lowPriceP1Y”: 81.84, “highPriceP1Y”: 121.1, “windowStart”: “2022-01-20T00:00:00”, “windowEnd”: “2022-01-20T10:11:22”, “windowFirst”: “2022-01-20T09:00:00”, “windowLast”: “2022-01-20T10:11:00”, “windowHighTime”: “2022-01-20T10:11:00”, “windowHighPrice”: 114.46, “windowLowTime”: “2022-01-20T10:16:00”, “windowLowPrice”: 112.78, “windowOpenTime”: “2022-01-20T09:00:19”, “windowOpenPrice”: 114.0, “windowPreviousCloseTime”: “2022-01-19T17:35:03”, “windowPreviousClosePrice”: 115.72, “windowTrend”: -0.02264
}, “id”: “issueid:360114899”, “type”: “object” “times”: “2022-01-20T00:00:00”, “expires”: “2022-01-20T10:12:56+01:00”, “data”: [
[ 540, 114.0 ], [ 541, 114.08 ], [ 542, 113.62 ], [ 543, 113.8 ], … [ 552, 113.7 ]],
”id”:”price:issueid:360114899”, “type”:”time”}]
}
- async degiroasync.webapi.get_product_dictionary(session: SessionCore) Dict[str, Any]
Get product dictionary information from server.
This is needed to provide human-redeable product data for products:
Bonds, CFD Exchange places.
ETF fees types.
Countries.
- Returns:
Example JSON below, most rows were removed to keepsome structure
readibility. Example from 2023.07.
``` JSON
{‘bondExchanges’ ([{‘country’: 905, ‘exchange’: 5001, ‘id’: 5001},) –
- {‘country’: 846,
’exchange’: 676, ‘id’: 676, ‘postfix’: ‘NYSE’},
{‘country’: 957, ‘exchange’: 999, ‘id’: 999}, {‘country’: 846,
’exchange’: 663, ‘id’: 663, ‘postfix’: ‘NASDAQ’},
{‘country’: 915, ‘exchange’: 608, ‘id’: 608}],
- ’bondIssuerTypes’: [{‘id’: 0,
’name’: ‘all’, ‘translation’: ‘Koersen.step1.530’},
- {‘id’: 2,
’name’: ‘company’, ‘translation’: ‘Koersen.step1.544’}],
- ’bondSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}],
- ’cfdExchanges’: [{‘country’: 906, ‘exchange’: 194, ‘id’: 194},
{‘country’: 975, ‘exchange’: 508, ‘id’: 508}, {‘country’: 915, ‘exchange’: 608, ‘id’: 608}],
- ’cfdSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}],
- ’combinationExchanges’: [{‘id’: 1, ‘name’: ‘Euronext Amsterdam’},
{‘id’: 2, ‘name’: ‘Euronext Brussels’}, {‘id’: 3, ‘name’: ‘Euronext Paris’}],
- ’countries’: [{‘id’: 908,
’name’: ‘FI’, ‘region’: 1, ‘translation’: ‘list.country.908’},
- {‘id’: 906,
’name’: ‘DE’, ‘region’: 1, ‘translation’: ‘list.country.906’}],
- ’etfAggregateTypes’: [{‘id’: ‘quoteCurrency’,
’name’: ‘quoteCurrency’},
- {‘id’: ‘totalExpenseRatioInterval’,
’name’: ‘totalExpenseRatioInterval’},
- {‘id’: ‘administrator’,
’name’: ‘administrator’},
{‘id’: ‘etpType’, ‘name’: ‘etpType’}, {‘id’: ‘exchange’, ‘name’: ‘exchange’}, {‘id’: ‘region’, ‘name’: ‘region’}, {‘id’: ‘assetAllocation’,
’name’: ‘assetAllocation’},
{‘id’: ‘issuer’, ‘name’: ‘issuer’}, {‘id’: ‘benchmark’, ‘name’: ‘benchmark’}],
- ’etfFeeTypes’: [{‘id’: 1,
’name’: ‘Trackers’, ‘translation’: ‘contract.type.131’},
- {‘id’: 2,
’name’: ‘Free’, ‘translation’: ‘translation.label.388’}],
- ’etfSortColumns’: [{‘id’: ‘quoteCurrency’},
{‘id’: ‘administrator’}, {‘id’: ‘etpType’}, {‘id’: ‘exchangeHiqAbbr’}, {‘id’: ‘name’}, {‘id’: ‘exchangeName’}, {‘id’: ‘region’}, {‘id’: ‘assetAllocation’}, {‘id’: ‘benchmark’}],
- ’eurexCountries’: [{‘exchanges’: [{‘city’: ‘Helsinki’,
’code’: ‘HE’, ‘country’: ‘FI’, ‘hiqAbbr’: ‘HSE’, ‘id’: 1001, ‘micCode’: ‘XHEL’, ‘name’: ‘OMX Helsinki’}],
’id’: 908, ‘name’: ‘FI’, ‘underlyingExchangeIds’: [1001]},
- {‘exchanges’: [{‘city’: ‘Frankfurt’,
’code’: ‘XETR’, ‘country’: ‘DE’, ‘hiqAbbr’: ‘XET’, ‘id’: 194, ‘micCode’: ‘XETR’, ‘name’: ‘Xetra’}],
’id’: 906, ‘name’: ‘DE’, ‘underlyingExchangeIds’: [194]}],
- ’exchanges’: [{‘city’: ‘Frankfurt’,
’code’: ‘CATS’, ‘country’: ‘DE’, ‘hiqAbbr’: ‘CAT’, ‘id’: 190, ‘micCode’: ‘CATS’, ‘name’: ‘CATS’},
- {‘city’: ‘Amsterdam’,
’country’: ‘XX’, ‘hiqAbbr’: ‘FSM’, ‘id’: 10000, ‘name’: ‘FundShare Matching’},
- {‘city’: ‘Copenhagen’,
’code’: ‘CO’, ‘country’: ‘DK’, ‘hiqAbbr’: ‘OMK’, ‘id’: 508, ‘micCode’: ‘XCSE’, ‘name’: ‘OMX Copenhagen’}],
- ’futureExchanges’: [{‘id’: 1, ‘name’: ‘Euronext Liffe’},
- {‘eurexCountries’: [908,
915, 906],
’id’: 2, ‘name’: ‘Eurex’},
{‘id’: 9, ‘name’: ‘COMEX’}],
- ’futureSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}, {‘id’: ‘expirationDate’}],
- ’indices’: [{‘id’: 106002, ‘name’: ‘SDAX’},
{‘id’: 106001, ‘name’: ‘MDAX’}, {‘id’: 121003, ‘name’: ‘SMIM’, ‘productId’: 11875105}, {‘id’: 114003, ‘name’: ‘ISEQ Overall’}, {‘id’: 121002, ‘name’: ‘SLI’, ‘productId’: 11875104}],
’investmentFundAggregateTypes’: [{‘id’: ‘issuer’, ‘name’: ‘issuer’}], ‘investmentFundFeeTypes’: [{‘id’: 0,
’name’: ‘Rebate-free’, ‘translation’: ‘translation.label.387’},
- {‘id’: 3,
’name’: ‘Rebate-free FREE’, ‘translation’: ‘translation.label.386’}],
- ’investmentFundSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}],
- ’leveragedAggregateTypes’: [{‘id’: ‘shortLong’, ‘name’: ‘shortLong’},
- {‘id’: ‘underlyingProductId’,
’name’: ‘underlyingProductId’},
{‘id’: ‘exchange’, ‘name’: ‘exchange’}, {
’id’: ‘underlying’, ‘name’: ‘underlying’
}, {‘id’: ‘issuer’, ‘name’: ‘issuer’}, {‘id’: ‘expirationDateRange’,
’name’: ‘expirationDateRange’}],
- ’leveragedSortColumns’: [{‘id’: ‘leverage’},
{‘id’: ‘financingLevel’}, {‘id’: ‘stoploss’}, {‘id’: ‘exchangeHiqAbbr’}, {‘id’: ‘name’}, {‘id’: ‘exchangeName’}, {‘id’: ‘expirationDate’}],
- ’lookupSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}, {‘id’: ‘productType’}],
- ’optionAggregateTypes’: [{‘id’: ‘month’, ‘name’: ‘month’},
- {‘id’: ‘derivativeExchange’,
’name’: ‘derivativeExchange’},
{‘id’: ‘year’, ‘name’: ‘year’}, {‘id’: ‘strike’, ‘name’: ‘strike’}],
- ’optionExchanges’: [{‘exchangeId’: 365, ‘id’: 11, ‘name’: ‘NYMEX’},
- {‘exchangeId’: 1006,
’id’: 1, ‘name’: ‘Euronext Amsterdam’, ‘underlyingExchangeIds’: [200, 212, 3001]},
- {‘eurexCountries’: [908,
982, 906],
’exchangeId’: 185, ‘id’: 5, ‘name’: ‘Eurex’, ‘underlyingExchangeIds’: [1001,
320, 608, 194]},
{‘exchangeId’: 359, ‘id’: 9, ‘name’: ‘CME’}],
’optionSortColumns’: [{‘id’: ‘strike’}, {‘id’: ‘expirationDate’}], ‘productTypes’: [{‘briefTranslation’: ‘contract.type.brief.13’,
’contractType’: ‘FND’, ‘id’: 13, ‘name’: ‘fund’, ‘translation’: ‘contract.type.13’},
- {‘briefTranslation’: ‘contract.type.brief.8’,
’contractType’: ‘OPT’, ‘id’: 8, ‘name’: ‘option’, ‘translation’: ‘contract.type.8’}],
- ’regions’: [{‘id’: 1,
’name’: ‘Europe’, ‘translation’: ‘translation.label.117’},
- {‘id’: 2,
’name’: ‘America’, ‘translation’: ‘translation.label.118’},
- {‘id’: 3,
’name’: ‘Other’, ‘translation’: ‘translation.label.121’}],
- ’stockCountries’: [{‘country’: 908,
’id’: 908, ‘indices’: [112002, 16, 112001, 120005]},
{‘country’: 849, ‘id’: 849, ‘indices’: [124001]}, {‘country’: 905, ‘id’: 905, ‘indices’: [123001]}, {‘country’: 906,
’id’: 906, ‘indices’: [6, 106002, 106003, 106001]}],
- ’stockSortColumns’: [{‘id’: ‘exchangeHiqAbbr’},
{‘id’: ‘name’}, {‘id’: ‘exchangeName’}]}
- async degiroasync.webapi.get_products_info(session: SessionCore, products_ids: List[str]) Dict[str, Any]
Get Product info Web API call.
- async degiroasync.webapi.get_transactions(session: SessionCore, from_date: str, to_date: str) Dict[str, Any]
Get transactions for session.
- from_date:
Date in format DD/MM/YYYY. Raise ValueError if incorrect format.
- to_date:
Date in format DD/MM/YYYY. Raise ValueError if incorrect format.
Example return in json(): ``` {
- ‘data’: {
- [
- {
‘id’: 123123, ‘productId’: 12341234, ‘date’: ‘2021-11-05T11:56:33+01:00’, ‘buysell’: ‘B’, ‘price’: 39, ‘quantity’: 100, ‘total’: -3900, ‘orderTypeId’: 1, ‘counterParty’: 1, ‘transfered’: False, ‘fxRate’: 0, ‘totalInBaseCurrency’: -3900, ‘feeInBaseCurrency’: -12, ‘totalPlusFeeInBaseCurrency’: -3912, ‘transactionTypeId’: -3912, ‘tradingVenue’: -3912,
}
]
}
}
- async degiroasync.webapi.login(credentials: Credentials, session: SessionCore | None = None) SessionCore
Authentify with Degiro API. session will be updated with required data for further connections. If no session is provided, create one.
- async degiroasync.webapi.search_product(session: SessionCore, search_txt: str | None = None, *, product_type_id: TYPEID | None = None, country_id: str | None = None, index_id: str | None = None, limit: int = 50, offset: int = 0) Dict[str, Any]
Access product_search endpoint.
- Returns:
Example JSON response below, will be returned as a Python dict.
.. code-block:: JSON –
- {
“offset”: 0, “products”: [
- {
“active”: true, “buyOrderTypes”: [
”LIMIT”, “MARKET”, “STOPLOSS”, “STOPLIMIT”
], “category”: “B”, “closePrice”: 113.3, “closePriceDate”: “2022-02-02”, “contractSize”: 1.0, “currency”: “EUR”, “exchangeId”: “710”, “feedQuality”: “R”, “feedQualitySecondary”: “CX”, “id”: “96008”, “isin”: “NL0000235190”, “name”: “AIRBUS”, “onlyEodPrices”: false, “orderBookDepth”: 0, “orderBookDepthSecondary”: 0, “orderTimeTypes”: [
”DAY”, “GTC”
], “productBitTypes”: [], “productType”: “STOCK”, “productTypeId”: 1, “qualitySwitchFree”: false, “qualitySwitchFreeSecondary”: false, “qualitySwitchable”: false, “qualitySwitchableSecondary”: false, “sellOrderTypes”: [
”LIMIT”, “MARKET”, “STOPLOSS”, “STOPLIMIT”
], “strikePrice”: -0.0001, “symbol”: “AIR”, “tradable”: true, “vwdId”: “360114899”, “vwdIdSecondary”: “955000256”, “vwdIdentifierType”: “issueid”, “vwdIdentifierTypeSecondary”: “issueid”, “vwdModuleId”: 1, “vwdModuleIdSecondary”: 2
}
]
}