This exact topic came up in another thread here recently: Build / commandline tools?
Short answer: No, I don’t think that’s currently possible short of a system that automates opening the file, and moving the mouse to the correct place to export the HTML.
I was told in an email exchange with support in late 2021 that the RP10 API was coming in “early 2022” seeing as how it’s mid-2024, I’m wondering if it’s coming out at all. Not that I think it would help you much even if it was out, IIRC the RP9 API is read-only and I’d expect the RP10 version to be much the same.
I keep hoping someone smarter than me figures out how to do your exact idea and puts it on Github or something.