As Hetzner and most of other cool providers do not provide an API to check the payments status, this script can help you to check it regularly, if you have a lot of accounts to check. Both providers and consumers (us) are interesed to pay in time, but for some reason they just don't. I even created a ticket to Hetzner to ask them to provide an API to check the payments status, they received it, but no updates yet.
So one can set up this script, check alerts in telegram chat, pay in time, and avoid suspensions.
The script uses playwright framework (headless browser).
Providers supported:
- Hetzner
- RedSwitches -
⚠️ currently blocked by Cloudflare Turnstile, no billing API, see Known issues - Virtual Systems
- Scaleway - they do provide API for billing ❤️
- KnownSRV
- PraHost
- OVH - they do provide API for billing ❤️
- Worldstream - they do provide API for billing, but no due dates, days remaining is always N/A
- Bunny CDN - API billing ❤️, prepaid/credit-based; alerts on low balance or low projected days remaining
Requirements:
- A working directory to put screenshots to (helps to debug).
- Google Service Account to access Google Sheets API and a Sheet to put checked payments.
- Telegram Bot API token to send messages to Telegram and a chat ID to send messages to.
- Docker.
Since November 2026 the RedSwitches check does not work.
- RedSwitches put a Cloudflare challenge ("Performing security verification", Turnstile) in front of the client area login page
https://dedicated.redswitches.com/index.php?rp=/login. - The headless browser never passes it, so the login form is never shown and every attempt fails with
Page.type: Timeout 30000ms exceededwhilewaiting for locator("input#inputEmail"). - The challenge is not tied to the server IP: a plain request to the login URL gets
403with thecf-mitigated: challengeheader from any address. - RedSwitches does not provide a billing API, and there is no public documentation page for any API at all, so there is no alternative way to get invoices automatically.
Until RedSwitches provides an API or removes the challenge, RedSwitches accounts have to be checked manually.
- Create
secret.jsonwith Google Service Account to access Google Sheets API to put checked payments in a Google Sheet. - Create
config.yaml, put working directory, google sheets, telegram setings there. - Define a list of provider accounts to check in
config.yaml. - Build and run the docker container:
docker build -t payment-checker . docker run -it --rm \ -v /home/user/payment-checker/secret.json:/app/secret.json \ -v /home/user/payment-checker/config.yaml:/app/config.yaml \ -v /home/user/payment-checker/screenshots:/app/screenshots payment-checker - Create a cron job like this to check the payments daily in the morning:
15 9 * * * docker run --rm -v /home/user/payment-checker/secret.json:/app/secret.json -v /home/user/payment-checker/config.yaml:/app/config.yaml -v /home/user/payment-checker/screenshots:/app/screenshots payment-checker > /home/user/payment-checker/cron.log 2>&1