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.