# Telegram Channel Monitor - New Posts from Public Channels (`ivora/telegram-channel-monitor`) Actor

Monitor public Telegram channels for new posts using the public web preview (t.me/s/channel). No login, no MTProto, and no API key. Tracks seen posts per channel and outputs only new posts on later runs.

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

## Pricing

from $1.25 / 1,000 post rows

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: New Posts from Public Channels

Watch **public Telegram channels** and get **new posts** since your last run. It reads the public web preview at `https://t.me/s/<channel>` (plain HTML, no login). Older posts are loaded with `?before=<postId>`.

- **No Telegram account, no MTProto, no API key.** Only channels that Telegram already shows on the web.
- **Monitor mode** (default) compares each run with the last one. A schedule turns it into an alert feed.
- **Keyword, regex and exclude filters** pick out only the posts you care about (trading signals, airdrops, listings, brand mentions).
- **Optional webhook**: one JSON POST per run with the new posts, ready for n8n, Make, Zapier or your own server.
- A **free summary row per channel** gives the title, description, subscriber count, how many posts were read and how many were new.
- Channels that do not exist, are private, or have no web preview become **error rows**. The rest of the run still finishes.

### Sample output

Three post rows from a local prefill run of `@telegram` on 2026-11-13 (`newOnly`, `outputLatest`, `maxPostsPerChannel: 20`, no proxy). The run read 20 posts in 0.8 s and exited 0. CDN media URLs and some link lists are shortened here; the dataset row has the full values. These particular posts are not forwards or replies, so those fields are null. A forward, reply and document name are covered by the HTML fixtures in `tests/fixtures/`.

```json
[
  {
    "type": "post",
    "channel": "telegram",
    "channelTitle": "Telegram News",
    "postId": 460,
    "url": "https://t.me/telegram/460",
    "date": "2026-08-26T19:12:34Z",
    "text": "For all the info from today's update and a look back at 13 years of Telegram features — check out our blog:\nhttps://telegram.org/blog/welcome-messages-buttons-TG-13\n\nAugust Features\n1 • 2 • 3 • 4 • 5 • More",
    "views": 2510000,
    "forwardedFrom": null,
    "replyTo": null,
    "hasMedia": false,
    "media": [],
    "links": ["https://telegram.org/blog/welcome-messages-buttons-TG-13", "https://t.me/telegram/455"],
    "edited": false,
    "matchedKeywords": [],
    "matchedRegex": [],
    "isNew": true,
    "scrapedAt": "2026-11-13T15:55:49Z"
  },
  {
    "type": "post",
    "channel": "telegram",
    "channelTitle": "Telegram News",
    "postId": 455,
    "url": "https://t.me/telegram/455",
    "date": "2026-08-26T19:11:05Z",
    "text": "Welcome Messages. Group and channel owners can now add messages that appear when a new member joins.\n\nThese messages are only visible to the person who joins the chat.",
    "views": 1210000,
    "forwardedFrom": null,
    "replyTo": null,
    "hasMedia": true,
    "media": [{"type": "video", "thumbnailUrl": "https://cdn1.telesco.pe/file/…", "url": "https://cdn1.telesco.pe/file/….mp4", "duration": "0:10"}],
    "links": ["https://t.me/telegram/456", "https://t.me/telegram/460"],
    "edited": true,
    "matchedKeywords": [],
    "matchedRegex": [],
    "isNew": true,
    "scrapedAt": "2026-11-13T15:55:49Z"
  },
  {
    "type": "post",
    "channel": "telegram",
    "channelTitle": "Telegram News",
    "postId": 459,
    "url": "https://t.me/telegram/459",
    "date": "2026-08-26T19:12:24Z",
    "text": "Signed Gifts. You can now add your signature and a comment to gifts you buy via the gift marketplace.",
    "views": 2220000,
    "forwardedFrom": null,
    "replyTo": null,
    "hasMedia": true,
    "media": [{"type": "video", "thumbnailUrl": "https://cdn1.telesco.pe/file/…", "duration": "0:12"}],
    "links": ["https://t.me/telegram/382"],
    "edited": false,
    "matchedKeywords": [],
    "matchedRegex": [],
    "isNew": true,
    "scrapedAt": "2026-11-13T15:55:49Z"
  }
]
```

### How it works

1. Each channel link is normalized: `@name`, `https://t.me/name`, `t.me/s/name` and a link to a single post all become the public username.
2. The Actor requests `https://t.me/s/<channel>` and reads the server-rendered message widgets. If more posts are needed, it follows `?before=<oldestPostId>`.
3. Seen post IDs are stored **per channel** in a named key-value store (`stateKey`). The first successful read sets a baseline floor at the oldest post ID it scanned. Posts older than that floor are history from before monitoring and are not reported as new later.
4. `newOnly` outputs posts that are not in that memory. If a run stops at `maxPostsPerChannel` while newer posts remain, the next run continues where it left off instead of skipping the gap.
5. `all` outputs every post read this run (still newest first, still capped) and sets `isNew` from the previous memory.
6. Requests are paced (about 0.8 s per host, with jitter). HTTP 429, 403 and 5xx are retried with exponential backoff and `Retry-After`. One bad channel does not stop the others.

### Use cases

- **Trading signals**: posts with a ticker such as `$BTC` or a call to action.
  `"keywordRegex": "\\$[A-Z]{2,6}\\b|\\b(?:long|short|entry|take profit)\\b"`
- **Airdrops and listings**: new listing or airdrop announcements, without giveaways and promo posts.
  `"keywordRegex": "\\b(?:airdrop|listing|will list|new pair)\\b"` and `"excludeRegex": "giveaway|promo code"`
- **Brand and competitor mentions** across many public channels.
  `"keywords": ["Acme", "acme.com"]` or `"keywordRegex": "\\bacme(?:\\.com)?\\b"`
- **Release and outage alerts** from vendor channels.
  `"keywords": ["released", "outage", "incident"]`

Pair any of these with a schedule and a Slack, Sheets or n8n integration, or with the `webhookUrl` option below.

### Input example

```json
{
  "channels": ["telegram", "https://t.me/durov", "@bbcnews"],
  "mode": "newOnly",
  "firstRunBehavior": "baseline",
  "maxPostsPerChannel": 50,
  "lookbackDays": 7,
  "keywords": ["release"],
  "excludeKeywords": ["giveaway"],
  "keywordRegex": "\\$[A-Z]{2,6}\\b",
  "excludeRegex": "/sponsored/i",
  "webhookUrl": "https://example.com/hooks/telegram",
  "includeMedia": true,
  "stateKey": "telegram-competitors"
}
```

| Option | What it does |
|---|---|
| `mode` | `newOnly` (default) outputs only posts not seen before. `all` outputs the posts read this run |
| `firstRunBehavior` | `baseline` (default) stores the latest IDs and writes only the summary. `outputLatest` also writes those posts (charged per post). The input form prefills `outputLatest` so a first run returns posts |
| `maxPostsPerChannel` | Newest posts to read per channel. Prefill is 20 (about one preview page) so a test run stays short. Default when the field is omitted is 50 |
| `lookbackDays` | Optional. Stop once posts are older than this many days |
| `keywords` | Optional, case-insensitive, match **any**. Checked against text, document names and links |
| `excludeKeywords` | Optional. Any hit drops the post. Exclude wins over keywords |
| `keywordRegex` | Optional regular expression (Python / JavaScript-style syntax, case-insensitive by default). A post is kept when **any keyword OR this regex** matches its text, document names or links. Matching text is returned in `matchedRegex`. Use the literal form `/pattern/flags` (flags `i`, `m`, `s`) to choose flags, for example `/^BUY/m` is case-sensitive. An invalid regex stops the run with a clear message before anything is charged |
| `excludeRegex` | Optional. Same syntax. A post that matches is dropped. Exclude (words or regex) always wins |
| `webhookUrl` | Optional public `http(s)` URL. After the run, **one POST** with all post rows delivered in this run (see below). Stored as a secret input |
| `includeMedia` | Photo and video thumbnail URLs, direct video URLs and document names. `hasMedia` is always set |
| `stateKey` | Name of the key-value store that remembers seen post IDs. One record per channel. Use a different name for each independent monitor |

### Regex and keyword filters

- A post is kept when it matches **at least one keyword or the keyword regex**. With neither set, every post is kept.
- It is dropped when it matches **any exclude keyword or the exclude regex**. Exclude wins.
- Text searched: the post text, document names and link URLs (first 20,000 characters).
- Patterns are limited to 500 characters. Lookaheads, groups and `\b` work as in JavaScript. A badly written pattern with nested repeats can be slow on very long posts, which only affects your own run.
- Filters hide output, not memory: a post that was filtered out is still marked as seen and will not come back as new.

### Webhook

Set `webhookUrl` to get the new posts pushed to your tool right after the run, in addition to the dataset:

```json
{
  "actor": "ivora/telegram-channel-monitor",
  "runId": "AbCdEf123456",
  "sentAt": "2026-11-17T19:00:05Z",
  "count": 2,
  "posts": [
    {"type": "post", "channel": "durov", "postId": 564, "url": "https://t.me/durov/564", "text": "...", "matchedRegex": ["$TON"], "isNew": true}
  ]
}
```

- One request per run, only when at least one post row was delivered. No rows (or a baseline run) means no request.
- Each element of `posts` has the same fields as a dataset `post` row.
- Timeout 20 seconds, one retry on a timeout, HTTP 429 or 5xx. A failed webhook **never fails the run**. The error is written to the log and to `RUN_SUMMARY` in the run's key-value store, and the status message says `Webhook: FAILED`.
- Only public addresses are accepted. `localhost`, private networks and redirects are refused. The URL is never written to the log.
- The webhook is a convenience on top of the dataset: if your endpoint is down, the posts are still in the dataset.

### Output

- **`post` rows** (charged): `channel`, `channelTitle`, `postId`, `url` (`https://t.me/<channel>/<id>`), `date` (ISO, UTC), `text`, `views` (numbers; `1.2K` and `3.4M` are parsed), `forwardedFrom`, `replyTo` (`postId`, `url`, `author`, `text`) or null, `hasMedia`, `media`, `links`, `edited`, `matchedKeywords`, `matchedRegex`, `isNew`, `scrapedAt`.
- **`summary` rows** (free, one per channel that was read): title, description, subscribers, photo / video / link counters from the preview, `postsFound`, `newPosts`, `postsOutput`, whether this was the first run, pages read and notes.
- **`error` rows** (free) with a code and a hint:
  - `invalid` (not a username or link, including private invite links)
  - `not_found` (no such public channel, or the name is a user or a bot)
  - `private_or_no_preview` (private channel, or the web preview is closed)
  - `unavailable` (Telegram will not display the channel)
  - `blocked` (HTTP 403 / 429 after retries)
  - `unreachable`

A bad channel does not fail the run. The status message counts how many channels failed.

### Honest limits

- **Public web preview only.** Private channels, invite links (`t.me/+...`) and channels that disabled the preview cannot be read. There is no login and no MTProto.
- **Views and subscriber counts** are the rounded figures Telegram prints (`1.2K`, `3.4M`), not exact integers.
- **`edited`** is taken from the preview footer. The word "edited" inside the post text does not set the flag. A forward whose source name is hidden is `forwardedFrom: null`.
- **State keeps the newest 20,000 scanned post IDs per channel.** That is several years of a busy channel at a daily schedule. Posts older than the baseline floor are never treated as new.
- **Keyword and regex filters hide output, not memory.** A post skipped by `keywords`, `keywordRegex`, `excludeKeywords` or `excludeRegex` is still marked seen.
- Post text is capped at 20,000 characters. Media lists are capped at 20 items and link lists at 50.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Actor start | $0.003 per GB of run memory, minimum one event. At the default memory (1 GB or less) that is **$0.003 per run** |
| Channel checked (preview read and compared) | $0.004 per channel |
| Post row | $0.00125 per post |

Summary and error rows are free. Channels that cannot be read are not charged. A baseline first run pays the channel check only. Posts hidden by keyword, regex or exclude filters are not charged. The webhook is free.

Examples (default memory):

- 20 channels checked daily with about 5 new posts each: $0.003 + 20 × $0.004 + 100 × $0.00125 = **$0.208 per day**.
- First run of one channel with `outputLatest` and 20 posts: $0.003 + $0.004 + 20 × $0.00125 = **$0.032**.
- First run with the default `baseline`: $0.003 + $0.004 = **$0.007** for one channel, and you only get the summary row.
- Trading-signal filter on 10 busy channels, 3 matching posts per day: $0.003 + 10 × $0.004 + 3 × $0.00125 = **$0.047 per day**.

Set a maximum cost per run in the run options to cap spending.

### Daily alerts

1. Fill in the input and click **Save as a new task** (one task per channel list is a good pattern). Use a distinct `stateKey` per task if the lists overlap and should not share memory.
2. In **Schedules**, create a schedule and add the task.
3. On the task's **Integrations** tab, add Slack, email or an Apify webhook, or set `webhookUrl` in the input to push the posts to n8n, Make or Zapier. Monitor mode's dataset *is* the alert list. An empty posts view means nothing new was found. The summary row is still there.

### Related actors

This follows the same conventions as the other monitors in this set: pay per event, failed channels never charged, and a default mode that returns only what changed since the last run.

- [Shopify Store Monitor](https://apify.com/ivora/shopify-store-monitor): new products, price changes and stock.
- [Google Ads Transparency Scraper & New Ads Monitor](https://apify.com/ivora/google-ads-transparency-monitor): ads on Google Search, Display and YouTube.
- [LinkedIn Ad Library Scraper & New Ads Monitor](https://apify.com/ivora/linkedin-ad-library-monitor): LinkedIn ads without login.
- [Bing Ads Library Scraper - Microsoft Ads Monitor (EU)](https://apify.com/ivora/microsoft-ads-library-monitor): Bing ads from Microsoft's Ad Library.
- [App Store & Google Play Scraper](https://apify.com/ivora/app-store-monitor): ratings, versions and keyword ranks.
- [ATS Jobs Scraper & Hiring Monitor](https://apify.com/ivora/company-hiring-monitor): new and closed jobs from public job boards.

### FAQ

**Do I need a proxy?** Usually not. The preview is public HTML. If Telegram returns HTTP 429 or 403, turn on Apify Proxy in the input.

**Will this work for private groups?** No. If the channel has no `t.me/s/<name>` history, the run writes an error row and moves on.

**What does the first run do?** With the default `baseline`, it stores the latest post IDs and writes a summary only. The form prefills `outputLatest`, which also writes those posts so you can see data immediately. Later `newOnly` runs write posts that were not in that memory.

**Does the webhook cost extra?** No. Only the three events above are charged.

**Is it legal?** It reads the public web preview Telegram already publishes for channels that allow it. You are responsible for how you use the data and for complying with applicable law and Telegram's terms.

### Documentation and support

Full guide, example output and pricing: [Telegram Channel Monitor on ivora.life](https://ivora.life/products/telegram-channel-monitor).
Questions or feature requests: support@ivora.life

# Actor input Schema

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

Public channel usernames or links. @name, https://t.me/name and https://t.me/s/name are all accepted. Private invite links (t.me/+...) have no web preview.

## `mode` (type: `string`):

newOnly compares each channel with the post IDs saved under stateKey and outputs unseen posts. all outputs the posts read this run and still updates that memory. isNew is true when the post was not in the previous run.

## `firstRunBehavior` (type: `string`):

On the first run there is nothing to compare with. baseline only stores the latest post IDs (you pay the channel check). outputLatest also outputs those posts, newest first, up to maxPostsPerChannel.

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

Newest posts read for each channel on this run. In newOnly mode, posts already seen do not count toward the cap, so a previous partial run continues on the next one. One preview page is about 20 posts.

## `lookbackDays` (type: `integer`):

Optional. Skip posts older than this many days and stop paging once older posts are reached. Leave empty for no date limit.

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

Optional. Keep a post when its text, document names or links contain any of these words (case-insensitive). The whole read is still tracked, so a post hidden here is not reported as new later.

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

Optional. Drop a post when its text, document names or links contain any of these words (case-insensitive). Exclude wins over keywords.

## `keywordRegex` (type: `string`):

Optional regular expression (Python/JavaScript-style syntax), case-insensitive by default. A post is kept when any keyword OR this regex matches its text, document names or links. Example: \b(?:airdrop|listing)\b|$\[A-Z]{2,6}\b. Use the literal form /pattern/flags (flags i, m, s) to control flags, e.g. /^BUY/m. Matches are returned in matchedRegex.

## `excludeRegex` (type: `string`):

Optional regular expression, same syntax and flags as the keyword regex. Drops a post when it matches. Exclude always wins over keywords and the keyword regex.

## `includeMedia` (type: `boolean`):

Add photo and video thumbnail URLs, video file URLs and document names. hasMedia is set either way.

## `stateKey` (type: `string`):

Named key-value store that remembers seen post IDs. Each channel has its own record in that store. Use a different name for each independent monitor (a-z, 0-9, -).

## `maxConcurrency` (type: `integer`):

How many channels are read at the same time. Pages inside one channel are sequential, and requests are paced.

## `webhookUrl` (type: `string`):

Optional. After the run, one HTTP POST with a JSON body {actor, runId, sentAt, count, posts:\[...]} is sent to this public http(s) URL with all post rows delivered in this run (nothing is sent when there are no rows). Works with n8n, Make, Zapier, Slack workflow webhooks and your own server. Timeout 20 s, one retry. A failed webhook never fails the run; it is reported in the run log and in RUN_SUMMARY. Localhost and private addresses and redirects are refused.

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

Not needed for most runs (the preview is public). Turn on Apify Proxy if Telegram answers HTTP 429 or 403.

## Actor input object example

```json
{
  "channels": [
    "telegram"
  ],
  "mode": "newOnly",
  "firstRunBehavior": "outputLatest",
  "maxPostsPerChannel": 20,
  "includeMedia": true,
  "stateKey": "telegram-channel-monitor-state",
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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"
    ],
    "mode": "newOnly",
    "firstRunBehavior": "outputLatest",
    "maxPostsPerChannel": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ivora/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 = {
    "channels": ["telegram"],
    "mode": "newOnly",
    "firstRunBehavior": "outputLatest",
    "maxPostsPerChannel": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ivora/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 '{
  "channels": [
    "telegram"
  ],
  "mode": "newOnly",
  "firstRunBehavior": "outputLatest",
  "maxPostsPerChannel": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call ivora/telegram-channel-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ivora/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/vFfQltsOdfI4zFLME/builds/CRRgNbgbwDdsHTSn0/openapi.json
