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:
- Channel info:
telegram.channels.detailwithchannel(public username) returns title, description, and subscriber count. - Incremental polling: save the newest message ID per channel, then call
telegram.channel_posts.listwithchannelandafter(orbeforeto backfill history). - Search & discovery:
telegram.channel_posts.search(channel,keyword),telegram.posts.detail, andtelegram.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.
- Telegram channel messages API$0.002 a callMessages posted in a public Telegram channel.
- Telegram channel info API$0.002 a callOne public Telegram channel: title, description, subscribers.
- Telegram channel message search API$0.002 a callSearch the messages of one public Telegram channel.
- Telegram message details API$0.002 a callOne message from a public Telegram channel.
- Telegram similar channels API$0.002 a callChannels Telegram suggests as similar to one channel.
Sources
What this page says about other products comes from their own pages and docs, read on 2026-11-25.
- Telegram API: error handling (FLOOD_WAIT_X)
- Telethon issue #494 (FloodWaitError on get_entity)
- Telethon issue #824 (account banned)
- Telethon issue #4084 (cannot obtain Channel via get_entity by ID)
- Telethon issue #4345 (NewMessage not triggered for certain channels)
- Telethon issue #4730 (no login code anymore)
- Telegram support
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