diff --git a/avanza/avanza.py b/avanza/avanza.py index e66362a..5a771a6 100644 --- a/avanza/avanza.py +++ b/avanza/avanza.py @@ -267,6 +267,15 @@ def get_index_info(self, index_id: str) -> IndexInfo: # Works when sending InstrumentType.STOCK, but not InstrumentType.INDEX return self.get_instrument(InstrumentType.STOCK, index_id) + def get_analysis(self,instrument_id: str ): + """Returns analysis data for an instrument """ + return self.__call( + HttpMethod.GET, + Route.ANALYSIS_PATH.value.format( + instrument_id + ) + ) + def get_instrument(self, instrument_type: InstrumentType, instrument_id: str): """ Get instrument info diff --git a/avanza/constants.py b/avanza/constants.py index 157b316..f91fcf9 100644 --- a/avanza/constants.py +++ b/avanza/constants.py @@ -126,6 +126,7 @@ class Route(enum.Enum): ACCOUNT_PERFORMANCE_CHART_PATH = ( "/_api/account-performance/overview/chart/accounts/timeperiod" ) + ANALYSIS_PATH = '/_api/market-guide/stock/{}/analysis' AUTHENTICATION_PATH = "/_api/authentication/sessions/usercredentials" CATEGORIZED_ACCOUNTS = "/_api/account-overview/overview/categorizedAccounts" CHARTDATA_PATH = "/_api/price-chart/stock/{}"