This is a lot of work just to access an API.
Set the secret into your Cloudflare account. I've been using the Cloudflare Dashboard, but it looks easier to do via command line.
Write and host a cloudflare worker to get the key from Cloudflare and give it to the static page.
The page also needs some .js to connect with the worker and use the data.