Telethon errors (FloodWaitError, account banned, get_entity, NewMessage, no login code): how do I fix them?

Most Telethon issues in production come from Telegram's account-level defenses and client cache rules: repeated get_entity calls trigger hours-long FloodWaitError, VoIP/brand-new numbers get banned on authorization, bare numeric channel IDs without -100 fail in get_entity, and events.NewMessage silently skips some large public channels or stalls after 10–20 hours. Cache entity IDs/hashes, reuse your .session file, and poll critical channels—or read public channels without any Telegram account via XTikAPI at $0.002 a call.

Updated 2026-11-25

Five common Telethon failures and fixes

FloodWaitError (up to 24 hours)

Cause in Telethon issues: Calling get_entity('username') (ResolveUsernameRequest) repeatedly or polling tightly (issues #494, #3107)

Practical fix: Resolve each channel once, persist (id, access_hash) and reuse; use larger limit and keep .session

Account banned on or after login

Cause in Telethon issues: Virtual/VoIP numbers, brand-new accounts authorizing immediately, or flagged region/IP (issue #824, 212 comments)

Practical fix: Use an aged non-VoIP number and stable IP; appeal at login@stel.com, recover@telegram.org, or telegram.org/support

get_entity(channel_id) fails or returns InputPeerUser

Cause in Telethon issues: Passing an unmarked numeric ID without -100, or entity missing from session cache after upgrade (issue #4084)

Practical fix: Always pass marked -100<id> or @username, and warm the cache via get_dialogs()

events.NewMessage silent on some public channels or stops after 10–20h

Cause in Telethon issues: Telegram delivers public-channel updates best-effort to user clients (issues #4345, #4521; also seen in Pyrogram)

Practical fix: Reconnect periodically (e.g. every 24h) or poll by last seen message ID for guaranteed delivery

No in-app login code arrives

Cause in Telethon issues: Transient Telegram-side block on third-party logins even when @SpamBot shows clean (issue #4730, Jan 2026)

Practical fix: Stop retrying rapidly, wait 24–48h, and always preserve the .session file once logged in

Monitoring public Telegram channels without a Telegram account

Private groups and DMs still require your own Telegram account. For **public channels**, polling an HTTP API eliminates bans, login codes, entity caches, and missed NewMessage events:

  1. Channel info: telegram.channels.detail with channel (public username) returns title, description, and subscriber count.
  2. Incremental polling: save the newest message ID per channel, then call telegram.channel_posts.list with channel and after (or before to backfill history).
  3. Search & discovery: telegram.channel_posts.search (channel, keyword), telegram.posts.detail, and telegram.channels.similar.

Cost check: 50 channels checked every 6 hours for 30 days = 6,000 calls × $0.002 = $12; daily checks for 20 channels = $1.20/month.

Why XTikAPI

  • XTikAPI reads Telegram with 5 endpoints from $0.002 a call, and a failed call is not charged.
  • Fewer tokens for AI: across 5 recorded live Telegram calls (2026-11-18), raw platform JSON is ~16k tokens vs ~7k via XTikAPI REST (56.1% fewer) and ~7k via MCP (53.7% fewer).
  • See before you pay: 192 of 229 endpoints show a recorded real response on their page (5 of 5 for Telegram).
  • Made for AI: hosted OAuth MCP server (/v1/mcp), Markdown twin per page, llms.txt and OpenAPI for ChatGPT, Claude and Cursor.
  • Free trial: a verified account gets $0.50, no card.

Endpoints

Each with its price; the endpoint page has parameters, fields and a recorded response.

Sources

What this page says about other products comes from their own pages and docs, read on 2026-11-25.

More about Telegram

Questions

What is the `-100` prefix in Telethon channel IDs?

It is Telegram's marked ID format for channels/supergroups; passing the bare number without `-100` can resolve as a user ID (`InputPeerUser`) or fail.

Should I just catch `FloodWaitError` and sleep?

Short waits can be slept, but multi-hour waits mean you are calling an expensive method like `ResolveUsernameRequest` too often—cache IDs and hashes instead.

One key. Start now.

19 platforms, 229 endpoints, from $0.002 a call. Errors and timeouts are free.

Start free