PythonAnywhere Forums

Access to Telegram API

Hello! Sorry for my Russian English. I'm using a free account. I've tried to access to https://api.telegram.org

>>> requests.get('https://api.telegram.org')

and got this

requests.exceptions.ProxyError: HTTPSConnectionPool(host='core.telegram.org', port=443): Max retries exceeded with url: /bots (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

It shouldn't happen, because api.telegram.org is contained in whitelist. Probably the reason is the redirection to core.telegram.org. Or maybe I'm doing something wrong?

That looks like it's not a valid API request so Telegram is redirecting you to the API documentation.

Yeah, you're right. Thank you!