Open FilterUnfiltered opened 3 years ago
Only if similar functionality already exists on the website or app today.
This library's purpose is to only expose the existing functionality, not create anything new.
After a quick search I found this: https://www.avanza.se/aktier/lista.html
I am assuming this is the list of things you can buy on avanza.
I use that in conjunction with get_certificate_info to get hold of specific certificates.
@robiwano: Right, but that gets you information about a single instrument, with a known ID, rather than returns a list of all instruments, which is what is requested here. Doesn't it?
It's, by the way, strange that Avanza doesn't have an API call for this, if that is actually the case.
I use the following to extract all ids from https://www.avanza.se/aktier/lista.html:
curl https://www.avanza.se/frontend/template.html/marketing/advanced-filter/advanced-filter-template\?1623583358324\¶meters.startIndex\=0\¶meters.maxResults\=100000\¶meters.selectedFields%5B0%5D\=LIST | grep "kop/[0-9]*" | grep -oh "[0-9]*" | sort | uniq > all.txt
Gives about 10k ids right now
@faddi: Thanks! I was not aware of that URL. What else can you do with it? Is there a way to list instruments other than stocks, or find out what other parameters are available?
@JonasOlson I found it by inspecting calls going out while doing filter changes at https://www.avanza.se/aktier/lista.html. You'll have to check the calls made on the other instrument listing pages.
So I haven't actually used this yet but I went through the documentation and I see that it does not seem to have a function to get s list of available stocks.
I want to be able to detect whenever a new stock is released to the market (for a stupid experiment of mine which will most likely cost me dearly lol) but I don't see that option anywhere...
Would it be possible to add a function to get all the stocks on the market? At least this way I can just make something that checks every once in a while if there is something new.