The IANA language substrate registry page is certainly the right answer, but the list is a little tricky to parse.
I found this github repository that has several scripts for analyzing it and a set of ready-to-use JSON objects that you can use in your projects:
https://github.com/mattcg/language-subtag-registry
It seems like the author updates the repo every time the IANA list changes.
Pietro delsante
source share