# Telegram Channel Search Scraper: Posts by Keyword (`avakode/telegram-channel-search`) Actor

Find posts that contain your words inside the public Telegram channels you name: text, date, views, reactions, media and links, from the open web preview. A mode returns only new posts.

- **URL**: https://apify.com/avakode/telegram-channel-search.md
- **Developed by:** [Tigran Avakov](https://apify.com/avakode) (community)
- **Categories:** Social media, MCP servers
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.69 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Telegram Channel Search Scraper: Posts by Keyword

Finds posts that contain given words inside the public Telegram channels you name, and returns them as clean records: text, date, views, reactions, media addresses and links. It uses the search box of the open web preview that Telegram publishes for channels; no account or API key is needed.

### What it does

For every channel and every word on your lists the tool asks the channel's own search (`t.me/s/<channel>?q=<word>`), reads the matching posts newest first and goes back page by page (about 20 posts per request) until it reaches your limit, your age limit or the last match. A post found by several words is written once, with the first word in `matched_keyword`. The search runs inside the channels you name only: there is no search across all of Telegram. Plain HTTP requests, no browser, at most one request per second to the site.

### Use cases

- Track mentions of a brand, product or topic in a set of channels you follow, on a schedule (`onlyNew`).
- See how often and how well a word performs: views and reactions of every match.
- Collect the links that channels publish about a subject.

### Input

| Field | Type | Description |
|---|---|---|
| `channels` | array | Channel names (`telegram`), `@name` or links (`https://t.me/telegram`). The search runs inside each. |
| `keywords` | array | Words or phrases to search for, one per line. |
| `maxAgeDays` | integer | Only posts from the last N days; 0 = no age limit. |
| `postedSince`, `postedUntil` | string | Optional ISO dates (`2026-11-01` or `2026-11-01T12:00:00Z`); a plain date is a whole day, UTC. With the age limit the later start applies. The tool reads from the newest post backwards, so a window far in the past costs more requests. |
| `excludeKeywords` | array | Skip posts whose text contains any of these words (any letter case). |
| `maxPostsPerChannel` | integer | Newest matches first; 0 = no per-channel limit. Default 100. |
| `onlyNew` | boolean | Return only posts not returned by earlier runs for the same channels and words. |
| `maxResults` | integer | Total limit across all channels. Default 100. |

Example:

```json
{ "channels": ["telegram", "durov"], "keywords": ["update", "privacy"], "maxAgeDays": 365, "maxPostsPerChannel": 50, "maxResults": 100 }
```

### Output

One record per post. Missing values are `null`, dates are ISO 8601 (UTC), `url` is the post on t.me.

| Field | Description |
|---|---|
| `channel`, `channel_title`, `channel_subscribers` | Channel name, display name, subscriber count from the page header. |
| `post_id`, `source_id`, `url` | Post number, `channel/post_id`, post address. |
| `matched_keyword` | The search word that found the post. |
| `text` | Post text as plain text. |
| `posted_at` | Publication time. |
| `is_edited` | True when the preview marks the post as edited (English preview text "edited"). |
| `views` | View count. |
| `reactions_total`, `reactions` | Sum of reaction counts and the list (emoji or custom emoji id, paid Stars flag, count), when the channel shows reactions. |
| `is_forwarded`, `forwarded_from` | Whether the post is forwarded and the source name, when shown. |
| `post_author` | Signature that the channel prints under its posts, as text. |
| `media` | Photos, videos, round videos and voice messages: `type`, `url`, `thumbnail`. |
| `links`, `hashtags` | Web links and hashtags written in the text. |
| `reply_to_post_id` | Number of the post this one replies to (same channel), when it is a reply. |
| `link_preview` | Link card: `url`, `site_name`, `title`, `description`. |
| `poll_question` | Question of a poll post. |

Example record:

```json
{ "channel": "telegram", "channel_title": "Telegram News", "channel_subscribers": 9150000, "post_id": 445, "matched_keyword": "update",
  "text": "For all the features from this update…", "posted_at": "2026-05-14T16:09:50.000Z", "views": 3120000,
  "reactions_total": null, "reactions": null, "is_forwarded": false, "forwarded_from": null, "post_author": null,
  "media": null, "links": ["https://telegram.org/blog/…"], "hashtags": null, "reply_to_post_id": null, "link_preview": { "url": "https://telegram.org/blog/…", "site_name": "Telegram", "title": "…", "description": "…" },
  "poll_question": null, "url": "https://t.me/telegram/445", "source_id": "telegram/445" }
```

### Pricing

Pay per result: you pay for each post in the dataset, plus a tiny start fee per run. Set "Maximum cost per run" and the tool stops cleanly when it is reached.

### Errors

- **Invalid input** — the message names the field to fix, for example a date that is not a date. A channel name that is wrong, missing or closed does not fail the run: it is skipped (see below).
- **The site changed its format** — the tool needs an update; please open an issue.
- **The site blocked access or is unavailable** — Telegram refused anonymous access, asked to slow down or did not answer; the tool does not bypass protection. The address is closed for the rest of the run, so the run stops at that channel and does not try the others. If posts were already written, the run ends normally and the status line names the reason and the number of posts; if there are none, the run fails with that message.
- A channel without a public web preview (private, nonexistent or preview switched off) is skipped with a clear message; the other channels are still read. If no channel can be read, the run still ends as succeeded with 0 results, and the status line names the skipped channel and the reason.

### Limitations

- How words match is decided by Telegram's search, not by this tool: it works on whole words (a fragment of a word may not match), and results are only as complete as the preview search is. The tool does not filter the text again.
- Only public channels whose web preview is open. Groups, chats, members, commenters, private accounts and invite links are not supported, and no people profiles are collected.
- The preview shows what Telegram shows an anonymous visitor: posts of age-restricted or restricted channels may be missing, reactions appear only where the channel shows them, and view counts are rounded the way Telegram rounds them (for example 1.67M).
- `media` holds photos, videos, round videos and voice messages only. Documents, stickers and poll options are not included (a poll shows only its question in `poll_question`).
- Media fields hold addresses of files on Telegram servers; some video links are temporary. Files are not downloaded.
- Telegram may change the page markup or limit requests; the tool then fails with a clear message.
- At most one batch may be written again if a write was still on its way when the run was stopped.
- If a run is killed while it writes a batch and is not resurrected, the next "only new" run may skip that batch.
- Two "only new" runs with the same channels cannot work at the same time: the second one stops with a message before it reads anything.

### Support

Open an issue in the Issues tab with the run link.

# Actor input Schema

## `channels` (type: `array`):

One per line: a channel name (telegram), @name or a link (https://t.me/telegram). The search runs inside each of these channels only. Public channels with a web preview; groups, invite links and private channels cannot be read: they are skipped.

## `keywords` (type: `array`):

One word or phrase per line. A post is returned when Telegram search finds any of them inside the channel.

## `maxAgeDays` (type: `integer`):

Skip older posts. 0 = no age limit.

## `postedSince` (type: `string`):

Only posts from this date on, for example 2026-11-01 or 2026-11-01T12:00:00Z. A plain date counts from the start of that day (UTC). Used together with the age limit, the later of the two applies.

## `postedUntil` (type: `string`):

Only posts up to this date, for example 2026-11-05. A plain date counts to the end of that day (UTC). The tool still reads from the newest post backwards, so a window far in the past costs more requests.

## `maxPostsPerChannel` (type: `integer`):

Newest matches first. 0 = no per-channel limit (the total limit still applies).

## `onlyNew` (type: `boolean`):

Remembers the posts already returned for this list of channels and gives only new ones on the next run. Use it for scheduled runs.

## `maxResults` (type: `integer`):

Stop after this many posts across all channels.

## `excludeKeywords` (type: `array`):

Skip posts whose text contains any of these words (any letter case).

## Actor input object example

```json
{
  "channels": [
    "telegram",
    "https://t.me/durov"
  ],
  "keywords": [
    "update",
    "bot"
  ],
  "maxAgeDays": 0,
  "postedSince": "2026-11-01",
  "postedUntil": "2026-11-05",
  "maxPostsPerChannel": 100,
  "onlyNew": false,
  "maxResults": 100,
  "excludeKeywords": []
}
```

# Actor output Schema

## `results` (type: `string`):

All records written by the run (the default dataset).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "channels": [
        "telegram"
    ],
    "keywords": [
        "update"
    ],
    "maxAgeDays": 0,
    "maxPostsPerChannel": 100,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("avakode/telegram-channel-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "channels": ["telegram"],
    "keywords": ["update"],
    "maxAgeDays": 0,
    "maxPostsPerChannel": 100,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("avakode/telegram-channel-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "channels": [
    "telegram"
  ],
  "keywords": [
    "update"
  ],
  "maxAgeDays": 0,
  "maxPostsPerChannel": 100,
  "maxResults": 100
}' |
apify call avakode/telegram-channel-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,avakode/telegram-channel-search"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/haRgpfBA72Qeg3zoT/builds/jKGuySCQC1soYucSn/openapi.json
