# Telegram Channel Monitor — Deltas, Views & Reactions (`genkenobi/telegram-channel-monitor`) Actor

Monitor public Telegram channels via the t.me preview (no login, no API key): export posts with text, views, reactions, media, links and channel stats. Delta mode returns only messages newer than the last run. Ideal for brand monitoring, news tracking and competitor research.

- **URL**: https://apify.com/genkenobi/telegram-channel-monitor.md
- **Developed by:** [Burhan Hayber](https://apify.com/genkenobi) (community)
- **Categories:** Social media, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0012 / message scraped

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Monitor — Deltas, Views & Reactions

Monitor **public Telegram channels** without a Telegram account, login or API key. This Actor reads the official guest preview pages (`t.me/s/<channel>`) and exports structured posts plus channel statistics.

Built for **monitoring workflows**: surveys, brand watching, news tracking, competitor research — for one channel or hundreds.

### What you get

**Message items** — one per post:

| Field | Example |
| --- | --- |
| `channel`, `channelTitle` | `durov`, `Pavel Durov` |
| `messageId`, `url`, `date` | `548`, `https://t.me/durov/548`, `2026-09-11T16:04:02+00:00` |
| `text` | full post text (line breaks preserved) |
| `views`, `viewsText` | `1840000`, `1.84M` |
| `reactions` | `[{"emojiId": "…", "count": 132000, "paid": false}]` |
| `media` | `{type: photo/video/voice/document/sticker/poll, url, …}` |
| `linkPreview` | `{url, siteName, title, description}` |
| `forwardedFrom`, `authorSignature`, `edited` | forwarding and edit info |

**Channel-info items** — one per channel: title, description, subscriber count, photo/video/link counters.

**Run summary** — counts, per-channel errors and duration, stored in the key-value store under `OUTPUT`.

### Delta mode (the monitoring feature)

Set `onlyNewMessages: true` and schedule the Actor (e.g. hourly or daily). Each run returns **only messages newer than the previous run** per channel. The first run establishes a baseline (latest messages). State is kept in the Actor's key-value store.

### Reliability built in

- Fetches **older messages via pagination** when you ask for more than the ~20 shown on the first page.
- Per-channel error reporting instead of a broken run: channels without public preview, private/nonexistent usernames, invite links and HTTP errors are reported in the dataset and the run summary, while every other channel still gets scraped.
- Retries with backoff on HTTP 429/5xx.

### Input example

```json
{
  "channels": ["durov", "@tagesschau", "https://t.me/heiseonline"],
  "maxMessagesPerChannel": 30,
  "onlyNewMessages": false,
  "keywords": [],
  "includeChannelInfo": true
}
```

### Output example (message item, trimmed)

```json
{
  "type": "message",
  "channel": "durov",
  "messageId": 548,
  "url": "https://t.me/durov/548",
  "date": "2026-09-11T16:04:02+00:00",
  "text": "The UK government wants to ban social media for children under 16…",
  "views": 1840000,
  "viewsText": "1.84M",
  "reactions": [{"emojiId": "5265077361648368841", "count": 132000, "paid": false}],
  "media": {"type": "video", "url": "https://cdn1.telesco.pe/…"}
}
```

### Pricing

Pay-per-event: per **delivered message** (see the Pricing tab). Channel-info items and error records cost nothing extra; empty runs only pay the start event.

### Notes & limits (honest ones)

- Only channels with a **public web preview** can be read. Some channels disable it — those are reported as `preview_unavailable`, not silently skipped.
- Private channels and invite links (`t.me/+…`) are not supported.
- View counts and subscriber numbers are the **approximated values Telegram shows** (`1.84M` → `1840000`).
- Reaction emojis are custom Telegram emojis; the preview page exposes their **IDs** (plus counts and whether they are paid), not the emoji character.
- Media URLs point to Telegram's CDN and can be **token-signed/expiring**; use them to embed or re-download soon after scraping.

***

## Interner Betrieb (nicht Store-Text)

- Quelle: `https://t.me/s/<channel>` (+ `?before=<id>` für Pagination). Kein Login, kein Key; UA = Chrome Desktop, `Accept-Language: en`.
- Fee: PPE `message-scraped` pro ausgelieferter Nachricht (Preis wird auf der Plattform gesetzt); `apify-actor-start` automatisch.
- Delta-State: KV-Store-Key `MONITOR_STATE` = `{ "<channel>": <letzte messageId> }` (lowercase, ohne @).
- Fehlerklassen: `preview_unavailable` (Vorschau deaktiviert), `not_a_public_channel` (User/Bot/privater Kanal), `invite_links_not_supported`, `invalid_username`, `http_<code>`, `request_error:*`.
- Bekannte Grenzen: >20 Nachrichten pro Seite nur per Pagination; sehr aktive Kanäle (mehr neue Nachrichten als `maxMessagesPerChannel` zwischen zwei Läufen) können Lücken haben — Cap erhöhen oder häufiger planen. Keyword-Filter werden vor der Auslieferung angewendet; gefilterte Nachrichten gelten als gesehen (Delta springt weiter).
- Test lokal: `storage/key_value_store/INPUT.json` + `.venv/bin/python -m src` aus dem Projekt-Root.

# Actor input Schema

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

Public channel usernames: '@name', 't.me/name' or full URLs. Examples: durov, @tagesschau, https://t.me/heiseonline.

## `maxMessagesPerChannel` (type: `integer`):

Upper bound per channel and run. The newest messages win; older ones are fetched via pagination.

## `onlyNewMessages` (type: `boolean`):

Return only messages newer than the previous run per channel (state kept in the key-value store). The first run returns the latest messages as a baseline.

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

Only deliver messages whose text contains at least one of these words (case-insensitive). Empty = deliver all.

## `sinceDate` (type: `string`):

Only messages published at or after this date. Format: YYYY-MM-DD or full ISO timestamp, e.g. 2026-09-01.

## `includeChannelInfo` (type: `boolean`):

Add one channel-info item per channel (title, description, subscriber count, media counters) to the dataset.

## `proxyConfiguration` (type: `object`):

Optional. Usually unnecessary — Telegram preview pages are publicly accessible.

## Actor input object example

```json
{
  "maxMessagesPerChannel": 30,
  "onlyNewMessages": false,
  "includeChannelInfo": true
}
```

# Actor output Schema

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

Channel-info items plus one item per scraped message (text, views, reactions, media, links).

## `runInfo` (type: `string`):

Counts, per-channel errors and duration of the run.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("genkenobi/telegram-channel-monitor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("genkenobi/telegram-channel-monitor").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 '{}' |
apify call genkenobi/telegram-channel-monitor --silent --output-dataset

```

## MCP server setup

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

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/XpgCxdtbxV0sfabvG/builds/8gazA1gyei5jLjh8K/openapi.json
