# Telegram API

Search Telegram public channels, groups and messages to retrieve post content, view counts and member samples.

Usernames can be plain or in URL form. Private invite links and complete member lists are not supported.

- Request: POST https://api.everyinfra.com/api/v1/social with `{"platform": "telegram", "action": "<action>", "params": {...}}`
- Canonical page: [https://everyinfra.com/en/telegram-api](https://everyinfra.com/en/telegram-api?utm_medium=ai_doc&utm_campaign=page_md)
- Each capability uses the price recorded in the public catalog. The response includes the amount charged. Authentication failures, invalid parameters, failed calls, and empty results are not charged.

## Actions

### channel_posts — Channel posts
Read the messages posted in a public Telegram channel. Each post has text, views, media, reactions and its forwarding source. Private invite links are not supported. The batch may not reach the full channel history.
- Sync delivery · Price: $0.56 per 1,000 requests (every 20 rows count as one call)
- Catalog values: defaultLimit=20, maxLimit=200. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `username` (required): Specifies the target public channel or group using formats such as name, @name, t.me/name, or t.me/s/name. Used by channel_posts and profile for public channels, group for public entity metadata, and members to retrieve visible group members; private invite links are not supported, and complete member lists are not guaranteed.
- Returns fields: id, url, channel_username, channel_title, text, view_count, posted_at, media_type, media_url, author, is_forwarded, forwarded_from, reply_to_url, platform, link_preview_url, reactions
- Capability page: [https://everyinfra.com/en/telegram-api/channel_posts](https://everyinfra.com/en/telegram-api/channel_posts?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/channel_posts.md)

### profile — Profiles
See how big a public Telegram channel is. Get subscriber count, photo, video and link counts, bio, avatar and verification status. It takes a name, @name, t.me/name or t.me/s/name. Private chats, phone numbers and member names stay out of reach.
- Sync delivery · Price: $0.56 per 1,000 requests
- Parameters:
  - `username` (required): Specifies the target public channel or group using formats such as name, @name, t.me/name, or t.me/s/name. Used by channel_posts and profile for public channels, group for public entity metadata, and members to retrieve visible group members; private invite links are not supported, and complete member lists are not guaranteed.
- Returns fields: username, name, bio, subscriber_count, photo_count, video_count, link_count, is_verified, avatar_url, url, platform
- Capability page: [https://everyinfra.com/en/telegram-api/profile](https://everyinfra.com/en/telegram-api/profile?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/profile.md)

### search — Search
Search messages across public Telegram channels by keyword. Each hit has channel name, type, subscriber count, views, reactions and media. Narrow the window with `since` and `until`. Private chats are never searched, and results do not represent all of Telegram.
- Sync delivery · Price: $0.56 per 1,000 requests (every 20 rows count as one call)
- Catalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `keyword` (required): Specifies the message search query for the search action in public channels. It does not search contact lists or private chats.
  - `since` (optional): Sets the lower message date bound for the search action. It does not filter by group creation date, and channel_posts has no date filter.
  - `until` (optional): Sets the upper message date bound (beforeDate) for the search action. Used alongside since to narrow public message results; it does not guarantee complete message coverage within the specified range.
- Returns fields: id, url, text, posted_at, view_count, media_url, reactions, channel_username, channel_title, channel_type, channel_subscriber_count, channel_description, platform
- Capability page: [https://everyinfra.com/en/telegram-api/search](https://everyinfra.com/en/telegram-api/search?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/search.md)

### group — Group
Look up the info card of a Telegram group or channel: title, description, member and online counts, creation date and scam, fake or verified flags. Private invite links are not supported, and the call never joins the group or opens restricted content.
- Sync delivery · Price: $0.56 per 1,000 requests
- Parameters:
  - `username` (required): Specifies the target public channel or group using formats such as name, @name, t.me/name, or t.me/s/name. Used by channel_posts and profile for public channels, group for public entity metadata, and members to retrieve visible group members; private invite links are not supported, and complete member lists are not guaranteed.
- Returns fields: id, type, username, url, title, name, description, member_count, online_count, created_at, is_verified, is_scam, is_fake, is_forum, is_restricted, admin_bots, platform
- Capability page: [https://everyinfra.com/en/telegram-api/group](https://everyinfra.com/en/telegram-api/group?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/group.md)

### members — Members
List the visible members of a public Telegram group, with username, name, account type, Premium, scam and fake flags and last-seen time. The list may be partial, and a phone number appears only when the member has made it public.
- Sync delivery · Price: $0.56 per 1,000 requests (every 100 rows count as one call)
- Catalog values: defaultLimit=100, maxLimit=5000. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count.
- Parameters:
  - `username` (required): Specifies the target public channel or group using formats such as name, @name, t.me/name, or t.me/s/name. Used by channel_posts and profile for public channels, group for public entity metadata, and members to retrieve visible group members; private invite links are not supported, and complete member lists are not guaranteed.
- Returns fields: id, username, url, name, type, is_verified, is_premium, is_scam, is_fake, last_seen_at, phone, platform
- Capability page: [https://everyinfra.com/en/telegram-api/members](https://everyinfra.com/en/telegram-api/members?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/members.md)

### post_detail — Post details
Read one message from a public Telegram channel by its link, such as https://t.me/durov/520. Get text, views, post time, media type and link, author signature, forward source, reply link, link preview and reactions with counts.
- Sync delivery · Price: $0.81 per 1,000 requests
- Parameters:
  - `url` (required): Link to one public channel message for `post_detail`, https://t.me/<channel>/<message ID>; t.me/s/ links work too.
- Returns fields: id, url, channel_username, text, view_count, posted_at, media_type, media_url, author, is_forwarded, forwarded_from, reply_to_url, platform, link_preview_url, reactions
- Capability page: [https://everyinfra.com/en/telegram-api/post_detail](https://everyinfra.com/en/telegram-api/post_detail?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/post_detail.md)

### post_comments — Post comments
Read the comments under one public Telegram channel message from its `url`, such as https://t.me/contest/198, newest first. Each comment has `text`, `text_html`, `posted_at`, the commenter's `author_name`, `author_username` and avatar, media, `reactions`, `links` and the comment it replied to; `post_comment_count` is the message's total. Up to 100 per page with `next_page_token`. Comments turned off returns comments_closed, not charged.
- Sync delivery · Price: $0.56 per 1,000 requests
- Catalog values: defaultLimit=50, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count. A larger limit is accepted and capped at 100. For the next page, pass next_page_token back as page_token with the other parameters unchanged; each page is one call.
- Parameters:
  - `url` (required): Link to one public channel message, https://t.me/<channel>/<message ID> (t.me/s/ links work too); the call returns the comments under it. Invite links (t.me/+…) are not accepted, and a value in the wrong form is rejected (422) before you are charged. A message whose comments are turned off or not public returns 200 with an empty result and `empty_reason` set to `comments_closed`; a channel or message that does not exist returns an empty result. Neither is charged.
  - `page_token` (optional): Page token. Leave it out for the first page, then pass back the previous response's `next_page_token` exactly as received, with the other parameters unchanged. Each page holds up to 100 comments (`limit`, default 50) and counts as one call; paging reaches all the way back to the first comment, and only a page without `next_page_token` is the last one.
- Returns fields: id, post_id, post_url, url, text, posted_at, author_username, author_name, author_url, author_avatar_url, text_html, media_type, image_urls, video_url, media, reactions, reaction_count, reaction_count_estimated, links, reply_to_id, reply_to_name, reply_to_text, post_comment_count, platform
- Capability page: [https://everyinfra.com/en/telegram-api/post_comments](https://everyinfra.com/en/telegram-api/post_comments?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/post_comments.md)

### search_in_channel — Search in channel
Search one public Telegram channel's messages by keyword: the channel goes in `username` and the word in `keyword`, up to 100 characters. Telegram's own in-channel search covers the whole history, newest first. Rows have the channel post fields plus `text_html`, `media`, `hashtags`, `links`, `link_preview`, poll fields and `channel_subscriber_count`. Up to 100 per page; no match is an empty list, not charged.
- Sync delivery · Price: $0.56 per 1,000 requests
- Catalog values: defaultLimit=20, maxLimit=100. For some actions a limit controls pages or per-parent expansion, so it is not always the final row count. A larger limit is accepted and capped at 100. For the next page, pass next_page_token back as page_token with the other parameters unchanged; each page is one call.
- Parameters:
  - `username` (required): The public channel to search in: name, @name, t.me/name or t.me/s/name. A channel that does not exist returns 200 with an empty result and `empty_reason` set to `account_not_found`, and the call is not charged.
  - `keyword` (required): The word or phrase to look for, up to 100 characters. Telegram's own in-channel search runs across the channel's whole history; no match returns an empty list and is not charged.
  - `page_token` (optional): Page token. Leave it out for the first page, then pass back the previous response's `next_page_token` exactly as received, with the other parameters unchanged. Each page holds up to 100 messages (`limit`, default 20) and counts as one call; only a page without `next_page_token` is the last one.
- Returns fields: id, url, channel_username, channel_title, text, view_count, posted_at, media_type, media_url, author, is_forwarded, forwarded_from, reply_to_url, platform, link_preview_url, reactions, text_html, image_urls, video_url, media, reaction_count, reaction_count_estimated, links, reply_to_id, reply_to_name, reply_to_text, is_edited, image_count, video_urls, thumbnail_url, duration_sec, duration_seconds, width, height, hashtags, mentions, is_reply, view_count_estimated, link_preview, reposted_post, poll_question, poll_options, poll_total_votes, poll_total_votes_estimated, channel_id, channel_url, channel_avatar_url, channel_description, channel_subscriber_count, channel_subscriber_count_estimated
- Capability page: [https://everyinfra.com/en/telegram-api/search_in_channel](https://everyinfra.com/en/telegram-api/search_in_channel?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/search_in_channel.md)

### channels_batch — Channels in bulk
Look up as many as 20 public Telegram channels in one call by passing their usernames in the `channels` array. Each channel is one row, in the order given, with `ok`, `name`, `bio`, `subscriber_count`, `avatar_url`, `is_verified`, `type` and `has_preview`; a channel that could not be read has `ok` false and an `error_code`. Each channel is billed as one call; channels that could not be read are refunded. No numeric IDs or media counts here.
- Sync delivery · Price: $0.56 per 1,000 requests (each element in channels counts as one call)
- Parameters:
  - `channels` (required): The public channels to look up with `channels_batch`, as an array of up to 20 usernames (name, @name or a t.me/name link), each at most once; a comma-separated string is not accepted. A value in the wrong form is rejected (422) before you are charged. Each channel is charged at the per-call price; channels that cannot be read are refunded and listed in `missed`, and when none of them can be read, the result is empty and not charged.
  - `limit` (optional): Positive integer (≥1): the maximum number of results to return; omit it to get every result from this call. Setting it only trims the response to at most this many and never fetches more; billing is the same with or without `limit`, whatever the value.
- Returns fields: username, url, type, name, bio, avatar_url, is_verified, bio_links, is_scam, is_fake, ok, error_code, error_retryable, subscriber_count, has_preview, platform
- Capability page: [https://everyinfra.com/en/telegram-api/channels_batch](https://everyinfra.com/en/telegram-api/channels_batch?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/channels_batch.md)

### user_profile — User profile
Read the public profile of a Telegram personal account or bot from its `username`, such as BotFather: `name`, `bio`, `avatar_url`, `is_verified`, `type` (user or bot), scam and fake flags, and `monthly_user_count` for bots. Telegram gives no numeric ID or follower count for these accounts. An unknown username returns account_not_found; a channel or group returns not_a_user. Neither is charged.
- Sync delivery · Price: $0.56 per 1,000 requests
- Parameters:
  - `username` (required): A personal account or bot username such as BotFather (a leading @ is removed), or a t.me/<username> link. A username that does not exist returns 200 with an empty result and `empty_reason` set to `account_not_found`; a channel or group username returns `empty_reason` set to `not_a_user` (use profile for a channel and group for a group). Neither is charged.
- Returns fields: username, url, type, name, bio, avatar_url, is_verified, bio_links, is_scam, is_fake, monthly_user_count, platform
- Capability page: [https://everyinfra.com/en/telegram-api/user_profile](https://everyinfra.com/en/telegram-api/user_profile?utm_medium=ai_doc&utm_campaign=page_md) (Markdown: https://everyinfra.com/en/telegram-api/user_profile.md)

## Telegram API questions

### What can I retrieve with the Telegram API?

Set `platform` to `telegram`. The current catalog lists channel posts, profiles, search, group, members, and more. These action names identify different Telegram objects or views; they are not interchangeable search modes.

### Which input starts the Telegram `channel_posts` request?

Specifies the target public channel or group using formats such as name, @name, t.me/name, or t.me/s/name. Used by channel_posts and profile for public channels, group for public entity metadata, and members to retrieve visible group members; private invite links are not supported, and complete member lists are not guaranteed. Send it as `username` inside `params`.

### Which fields can Telegram `channel_posts` return?

Its declared schema includes `channel_username`, `channel_title`, `text`, and `view_count`. A declared field can still be absent from an individual record, and every other action has its own field list.

### Does every Telegram action return immediately?

Actions labeled asynchronous return a job ID you poll. Every other action can also run asynchronously: add `"mode": "async"` to the request body to receive a job ID immediately, useful for slow tasks or large limits. The current catalog contains sync delivery.

## Also

- Machine catalog (no key): https://everyinfra.com/openapi.json · GET /api/v1/social/catalog?platform=telegram
- API guide for AI clients: https://everyinfra.com/llms.txt · agents guide: https://everyinfra.com/agents.md
