Forums

Telegram API connection fails with 503 proxy error

Hello PythonAnywhere Support,

My Telegram bot cannot connect to api.telegram.org from my free account.

The domain is on the allowed sites list, but the proxy returns:

503 Service Unavailable X-Squid-Error: ERR_CONNECT_FAIL 101

Could you please check the proxy connection to Telegram's API?

Thank you.

We don't guarantee Telegram working on a free account.

Hello! My Telegram bot was working on PythonAnywhere Free for about a week, but it has stopped connecting to the Telegram API.

Command: curl -i --max-time 20 https://api.telegram.org

Result: HTTP/1.1 503 Service Unavailable Server: squid/5.9 X-Squid-Error: ERR_CONNECT_FAIL 101

Google works through the proxy and returns HTTP 200, but requests to api.telegram.org consistently fail.

Could you please check whether the PythonAnywhere proxy can connect to the Telegram API?

Thank you.

We don't guarantee Telegram working on a free account.

Subject: Unable to connect to Telegram API from PythonAnywhere

Hello PythonAnywhere Support,

I'm running a Python Telegram bot on a free account, but I'm unable to establish an HTTPS connection to api.telegram.org.

Other HTTPS websites, including www.python.org and www.google.com, work correctly.

However, requests to Telegram return:

HTTP/1.1 503 Service Unavailable X-Squid-Error: ERR_CONNECT_FAIL 101

DNS resolution works correctly, but the proxy fails during the HTTPS CONNECT request.

Could you please confirm whether access to api.telegram.org is supported on free accounts and whether this connection issue can be resolved?

Thank you!

We don't guarantee Telegram working on a free account.

Hello,

My Telegram bot on PythonAnywhere stopped connecting to the Telegram Bot API.

My proxy environment variables are configured as http://proxy.server:3128.

The following tests produce these results: - https://www.google.com/ — HTTP 200 - https://core.telegram.org/ — HTTP 200 - https://api.telegram.org/ — 503 Service Unavailable from the proxy after CONNECT

My Python traceback shows httpx.ProxyError: 503 Service Unavailable.

The domain api.telegram.org is present on the free-account allowlist. Could you please check whether there is a proxy connectivity issue affecting connections to api.telegram.org:443 for my account?

Thank you.

It looks like Telegram is blocking requests from our proxy. We don't guarantee externall connections to work on a free account.