If you're based in Europe or UK, Nordigen has a completely free API do exactly what you described (I'm one of the cofounders).
We're connected to 1,500 EU/UK banks and you can connect your bank account to your script/app without any license, certificates or any fees. We don't charge for accessing banking data, we only charge for complimentary data enrichment services like transaction categorisation.