I use Nielsen's API, but the data is pretty rough, and you have to spend a lot of time cleaning it. Plus, the archaic industry standards around genre are hard to translate to what readers use - https://www.bisg.org/complete-bisac-subject-headings-list.
Ingrams and Bowker are the other big metadata providers. Ingram's is good but expensive, but the data faces the same issues.