If you just want correct metadata (no own adjustments), then getting it from the MusicBrainz database is probably easiest. You can use MusicBrainz Picard for that: https://picard.musicbrainz.org
It does also seem to have a scripting API. No idea how well that works, though.
Completely unrelated story: I bought a red cabbage last week and was so glad to have found a relatively small one in the shop.
…I have been eating red cabbage for the past three days and still have enough left for another two days. Just why is it so damn compressed? I can cut off the tiniest slice from that cabbage and it still fills a whole plate.