-
Notifications
You must be signed in to change notification settings - Fork 49
/
latest_news.py
29 lines (24 loc) · 883 Bytes
/
latest_news.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import logging
from degiro_connector.trading.api import API as TradingAPI
from degiro_connector.trading.models.credentials import build_credentials
from degiro_connector.trading.models.news import LatestRequest
logging.basicConfig(level=logging.DEBUG)
credentials = build_credentials(
location="config/config.json",
# override={
# "username": "TEXT_PLACEHOLDER",
# "password": "TEXT_PLACEHOLDER",
# "int_account": NUMBER_PLACEHOLDER, # From `get_client_details`
# # "totp_secret_key": "TEXT_PLACEHOLDER", # For 2FA
# },
)
trading_api = TradingAPI(credentials=credentials)
trading_api.connect()
# FETCH LATEST NEWS
latest_request = LatestRequest(
offset=0,
languages="en,fr",
limit=20,
)
latest_news = trading_api.get_latest_news(latest_request=latest_request, raw=False)
print("Here are the latest news :", latest_news)