Is there a freely usable database that details the voice actors starring in each show?
Usagi Doi would be a good starting point. All though they no longer maintain a complete database, they have several database files publicly available which can be used for this purpose.
Myanimelist People could also be used. All though there is no api/database publicly available to my knowledge.
Behind the voice actors this site covers more than only anime Seiyuu, and to my knowledge has no public api/database available.
For the later 2 sites scraping may be a possibility, all though you would have to take a look at their respective policies.