Is there an open database which lists FDA or EMA approvals of drugs for the treatment of specific illnesses?
Not sure exactly what the question is here.. Yes, openFDA is a database that is free to use, has it's source code on github, and can be queried to find drugs for specific treatments. Part of the api query has a field called "purpose" that should be what you are looking for.
You can use Drugs@FDA database: https://www.accessdata.fda.gov/scripts/cder/drugsatfda/index.cfm.
I'm posting extremely late here, mainly because I have a follow-up question. You could potentially use the NIH RxNorm and related tools to help you link an FDA registered therapy with its purpose. For instance, ATC classification is a mechanism for classifying the therapeutic purpose of a medicine.
My follow-up question is whether any of the Drugs@FDA / OpenFDA datasets address products that were declined. My question relates to trying to find both approved and declined therapeutic products, and whether there is a way to do this without having to scrape press releases or committee documents etc., which would also probably not be very accurate.