Change A Records for all the Domains in my Account

I currently manage about 30 domains that I have in Cloudflare. Sometimes we need to switch the a record of all the domains in the account.

Would it be possible to use the API to search for all the domains using an IP as an a record and change it to a new one?

API calls are domain specific, so you cant search and replace it in one go but you can certainly fetch your domain, then the respective records, and make changes wherever necessary.