avanza icon indicating copy to clipboard operation
avanza copied to clipboard

Placing an alert

Open ridulfo opened this issue 3 years ago ā€¢ 8 comments

Hi! First of, great repository

It would be very convenient if the library had a function for placing an alert on a stock at a specific price and expiration. I could not find this in the source code. The app supports it, which means that there must be an end-point for it(?).

ridulfo avatar Jul 14 '21 20:07 ridulfo

Yeah, that's a feature I've been wanting to have as well. Should definitely be possible to add - it's just a matter of setting up the proxy and seeing what API calls the app makes.

fhqvst avatar Jul 14 '21 21:07 fhqvst

It would be very useful! I have always wondered how you were able to get the end-points (not an app reverse-engineer myself šŸ˜„)!

ridulfo avatar Jul 15 '21 06:07 ridulfo

I tried the proxy approach. Got pretty far, but got stuck with a certificate error after certificate error. Perhaps someone else has better luck.

ridulfo avatar Jul 16 '21 05:07 ridulfo

Hey, couldn't agree more! Very useful repo šŸ‘ This would be very useful!! Anyone that wants to collaborate around this?

Is it possible to use the web-endpoints somehow? E.g.: https://www.avanza.se/_cqbe/marketing/service/alert/<stock_id> with payload: {"price":"87","validUntil":"2022-08-30","notification":true}

asifma avatar Aug 28 '21 22:08 asifma

IIRC, there are also a couple other routes under /_cqbe that might be useful, such as fetching "inspiration lists" and more.

fhqvst avatar Aug 29 '21 08:08 fhqvst

@fhqvst : Vill du kika pƄ det ihop med mig? Om du har tid och lust :)

asifma avatar Aug 29 '21 14:08 asifma

@fhqvst : Okey, I solved it. Will create a PR!

image

asifma avatar Aug 29 '21 14:08 asifma

PR Created, please review when you have time :) -> #68

asifma avatar Aug 29 '21 16:08 asifma