POST

API health

24h health
Normal
  • Healthy / normal
  • Available
Normal

Last 24 hours

Last 30 days

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.

Send POST https://api.everyinfra.com/api/v1/social with platform set to telegram and action set to search_in_channel. Price $0.56 per 1,000 requests ($0.000556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.

AI prompt

#
Please help me write a data collection script with the EveryInfra Telegram Search in channel endpoint (telegram/search_in_channel).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to telegram and action to search_in_channel, and put the parameters inside params.
- Required parameters:
  - username: 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: 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.
- Optional parameters:
  - page_token: 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.
  - limit: The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum. (default: 20)
- Returns a list of records. Main fields of each record: id, url, channel_username (Channel username (the public identifier…), channel_title (Channel name), text, view_count, posted_at, media_type (Media type (photo / video / file / voic…), media_url (Media file link), author (Message sender), is_forwarded (Whether the message is forwarded), forwarded_from (Forward source); 49 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=telegram.
- Example request body:
{
  "platform": "telegram",
  "action": "search_in_channel",
  "params": {
    "username": "durov",
    "keyword": "TON"
  }
}
- Price: $0.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYestelegramPlatform identifier, fixed value.
actionbodystringYessearch_in_channelCapability identifier, fixed value.
usernamebody.paramsstringYes-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.
keywordbody.paramsstringYes-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_tokenbody.paramsstringNo-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.
limitbody.paramsinteger (1–100)No20The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum.

Code samples

#
bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "telegram",
  "action": "search_in_channel",
  "params": {
    "username": "durov",
    "keyword": "TON"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "id": "req_…",  "platform": "telegram",  "action": "search_in_channel",  "results": [    {      "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": …    }  ],  "next_page_token": …,  "pagination": { … },  "count": …,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.

FieldMeaning
idThe record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms.
urlLink to the record on the platform.
channel_usernameChannel username (the public identifier starting with @).
channel_titleChannel name.
textBody text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so).
view_countViews or plays. null means not disclosed, not 0.
posted_atPublish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it.
media_typeMedia type (photo / video / file / voice); in post_comments and search_in_channel an album of several photos or videos is album, and text-only messages have no media_type.
media_urlMedia file link.
authorMessage sender.
is_forwardedWhether the message is forwarded.
forwarded_fromForward source. Used to trace how information spread.
reply_to_urlLink to the message being replied to.
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
link_preview_urlURL the post's link preview points to (channel_posts / post_detail); absent when the post has no link preview.
reactionsEmoji reactions with their counts; in post_comments and search_in_channel each is {emoji, emoji_id, count, is_paid}, and a custom emoji has emoji_id instead of emoji.
text_htmlThe text as HTML, keeping its links and formatting (post_comments, search_in_channel).
image_urlsArray of image links in the platform's display order; absent when there are no images.
video_urlLink to the video file (post_comments, search_in_channel); signed and expires, absent when there is no video.
mediaEach photo or video in the message (post_comments, search_in_channel): [{type, url, id, width, height, thumbnail_url, duration_sec}], each only when it has a value; links expire.
reaction_countTotal number of emoji reactions (post_comments, search_in_channel).
reaction_count_estimatedWhether reaction_count is a rounded figure: true when Telegram's page shows it in a form like 9.37K (post_comments, search_in_channel).
linksLinks in the text, in order of appearance (post_comments, search_in_channel); absent when there are none.
reply_to_idNumber of the message or comment being replied to (post_comments, search_in_channel); absent when Telegram does not give it.
reply_to_nameName of the person being replied to (post_comments, search_in_channel).
reply_to_textText of the message being replied to, as Telegram's page quotes it (post_comments, search_in_channel).
is_editedWhether the message was edited after it was posted (search_in_channel).
image_countNumber of photos in the message (search_in_channel).
video_urlsLink to each video in the message (search_in_channel); an album can have several; signed and expire.
thumbnail_urlThumbnail link, lower resolution than image_url.
duration_secVideo length in seconds (search_in_channel), the same value as duration_seconds.
duration_secondsDuration in seconds. null for content that is not video or audio.
widthWidth of the photo or video in pixels (search_in_channel).
heightHeight of the photo or video in pixels (search_in_channel).
hashtagsHashtags in the text, in order of appearance; absent when there are none.
mentionsUsernames mentioned with @ in the text (search_in_channel).
is_replyWhether the message replies to another message (search_in_channel).
view_count_estimatedWhether view_count is a rounded figure: true when Telegram's page shows it in a form like 2.57M (search_in_channel).
link_previewThe link preview card in the message (search_in_channel): {url, site_name, title, description, image_url}, each only when it has a value; url is the same as link_preview_url.
reposted_postDetails of where a forwarded message came from, as given (search_in_channel); present only on forwarded messages.
poll_questionThe poll question (search_in_channel); present only on poll messages.
poll_optionsThe poll's options, as given (search_in_channel).
poll_total_votesTotal votes in the poll (search_in_channel).
poll_total_votes_estimatedWhether poll_total_votes is a rounded figure (search_in_channel), by the same rule as view_count_estimated.
channel_idThe channel's numeric ID (search_in_channel).
channel_urlLink to the channel, https://t.me/<channel> (search_in_channel).
channel_avatar_urlLink to the channel's avatar image (search_in_channel).
channel_descriptionChannel description.
channel_subscriber_countNumber of channel subscribers.
channel_subscriber_count_estimatedWhether channel_subscriber_count is a rounded figure (in search_in_channel it is the rounded count Telegram's page shows, such as 9.83M stored as 9830000, and this is true).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

Google Analytics needs consent. Privacy