In my browser extension, there is currently a hard coded list of url prefixes for sitelinks wikidata can have:
https://github.com/fuddl/wikibase-for-web/blob/main/wikidataSites.mjs
it is used to match e.g. this url https://de.wikipedia.org/wiki/Maori to this wikidata item: https://www.wikidata.org/entity/Q6122670 because it has dewiki→Maori
Since I'd like the extension to be agnostic to which wikibase it is talking to I am looking for a way to aquire it from the wikibase itself.
At first I thought I could get it from https://www.wikidata.org/w/api.php?action=query&format=json&meta=siteinfo&siprop=interwikimap
But that's apparently not meant for it (aa turns into aawiki for instance) so I thought it should actually be the job of the wikibase manifest, would it?
unless you have a different idea how to get this mapping