# Telegram Channel Scraper & Keyword Monitor (`ax_dev/telegram-channel-monitor`) Actor

Scrape public Telegram channels and monitor them for keywords — no API key, no phone, no login. Get posts, views, reactions, media & subscriber counts as clean JSON. Reliable retries, multi-channel keyword alerts, MCP-ready output for brand monitoring, crypto, OSINT & AI agents.

- **URL**: https://apify.com/ax\_dev/telegram-channel-monitor.md
- **Developed by:** [Alexandr Maier](https://apify.com/ax_dev) (community)
- **Categories:** Social media, AI, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Telegram Channel Scraper & Keyword Monitor

Scrape **public Telegram channels** and monitor them for keywords — **no API key, no phone number, no login**. Built for reliability and for AI agents: clean, flat, predictable JSON on every run.

This actor reads Telegram's public web preview (`t.me/s/<channel>`), the same data any browser sees when you open a channel without an account. It never logs in, never touches your Telegram account, and never asks for a phone number.

### Why this one

Most Telegram actors do the same basic dump. Two things break them in production, and this actor fixes both:

- **They crash on rate limits.** This actor retries every request with exponential backoff and can fall back to Apify Proxy, so a long run finishes instead of dying at channel #7.
- **They only scrape, they don't watch.** Monitor mode remembers the last post it saw per channel and returns *only new posts* on each scheduled run — turn any channel list into a keyword alert feed.

### What you get per message

```json
{
  "channel": "durov",
  "channelTitle": "Pavel Durov",
  "channelSubscribers": 11700000,
  "id": 510,
  "url": "https://t.me/durov/510",
  "datetime": "2026-05-12T17:28:39+00:00",
  "text": "🌍 With 400 validators across 6 continents, TON is one of the most…",
  "views": 3440000,
  "reactions": [{ "emoji": "🔥", "count": 12045 }],
  "media": ["photo"],
  "forwardedFrom": null,
  "links": ["https://ton.org"],
  "matchedKeywords": ["ton"],
  "scrapedAt": "2026-07-10T12:00:00.000Z"
}
````

### Input

| Field | Type | Description |
|---|---|---|
| `channels` | array **(required)** | `@name`, `name`, or `https://t.me/name` |
| `keywords` | array | Save only posts containing a keyword (case-insensitive). Empty = save all |
| `keywordMatch` | `substring` | `word` | Substring (default) or whole-word matching |
| `mode` | `scrape` | `monitor` | `scrape` = history; `monitor` = only new posts since last run |
| `maxPostsPerChannel` | integer | Cap on posts scanned per channel (default 100) |
| `postsNewerThan` | ISO date | Stop paging once older posts are reached |
| `minViews` / `minReactions` | integer | Skip low-engagement posts |
| `useProxy` | boolean | Route via Apify Proxy (only needed for large jobs) |

#### Example: monitor three news channels for a brand

```json
{
  "channels": ["telegram", "durov", "bloomberg"],
  "keywords": ["bitcoin", "regulation", "SEC"],
  "keywordMatch": "word",
  "mode": "monitor"
}
```

Schedule this every 15 minutes and the dataset fills only with new, on-topic posts.

### Use cases

- **Brand & crypto monitoring** — alert when your project, ticker, or competitor is mentioned across channels.
- **OSINT & news** — track announcements from public channels into a structured feed.
- **AI agents (MCP)** — flat JSON output plugs straight into a RAG pipeline or an MCP tool call ("what did channel X post about Y this week?").
- **Research & analytics** — export engagement (views, reactions) over a channel's history.

### Pricing (pay-per-event)

| Event | Price |
|---|---|
| Actor start | $0.005 |
| Message saved | $0.0002 |

You pay only for messages that pass your filters. Scraping 1,000 matching posts costs about **$0.20 + $0.005 = $0.205**. No monthly subscription; the Apify free tier covers testing.

### Limits & honest notes

- Works only with **public** channels that have web preview enabled. Private channels, groups, and comments are not accessible (and scraping them would require an account — out of scope by design).
- `t.me/s/` serves ~20 posts per page; the actor paginates backward through history up to your limit.
- Reads public preview data only. This actor does **not** use MTProto, does not collect member lists, and does not require your credentials.
- You are responsible for complying with Telegram's Terms and applicable law in your use of the data.

### Local development

```bash
npm install
apify run -p           # requires apify-cli and Docker/Node 18+
```

`src/parser.js` isolates all HTML parsing — if Telegram ever changes its preview markup, that single file is the only thing to update.

# Actor input Schema

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

Public Telegram channels to scrape. Accepts @name, name, or https://t.me/name.

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

If set, only messages containing at least one keyword are saved. Case-insensitive. Leave empty to save every message.

## `keywordMatch` (type: `string`):

substring = keyword anywhere in text; word = whole-word match only.

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

scrape = fetch history up to the limit. monitor = on each run, save only posts newer than the previous run (dedup state kept per channel). Use monitor on a schedule for alerts.

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

Upper bound on posts scanned per channel (paginates backward through history).

## `postsNewerThan` (type: `string`):

ISO date/time cutoff (e.g. 2026-01-01). Stops paging once older posts are reached.

## `minViews` (type: `integer`):

Skip posts below this view count (0 = no filter).

## `minReactions` (type: `integer`):

Skip posts with fewer total reactions (0 = no filter).

## `useProxy` (type: `boolean`):

Route requests through Apify Proxy. Recommended only for large jobs — t.me/s/ usually needs no proxy.

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

Advanced proxy settings (overrides 'Use Apify Proxy').

## Actor input object example

```json
{
  "channels": [
    "@durov",
    "telegram",
    "https://t.me/whitehouse"
  ],
  "keywords": [],
  "keywordMatch": "substring",
  "mode": "scrape",
  "maxPostsPerChannel": 100,
  "minViews": 0,
  "minReactions": 0,
  "useProxy": false
}
```

# 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": [
        "durov",
        "telegram"
    ],
    "keywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("ax_dev/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": [
        "durov",
        "telegram",
    ],
    "keywords": [],
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "durov",
    "telegram"
  ],
  "keywords": []
}' |
apify call ax_dev/telegram-channel-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ax_dev/telegram-channel-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Telegram Channel Scraper & Keyword Monitor",
        "description": "Scrape public Telegram channels and monitor them for keywords — no API key, no phone, no login. Get posts, views, reactions, media & subscriber counts as clean JSON. Reliable retries, multi-channel keyword alerts, MCP-ready output for brand monitoring, crypto, OSINT & AI agents.",
        "version": "0.1",
        "x-build-id": "yFBOrIvdjQY6HMifF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ax_dev~telegram-channel-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ax_dev-telegram-channel-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ax_dev~telegram-channel-monitor/runs": {
            "post": {
                "operationId": "runs-sync-ax_dev-telegram-channel-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ax_dev~telegram-channel-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-ax_dev-telegram-channel-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "channels"
                ],
                "properties": {
                    "channels": {
                        "title": "Channels",
                        "type": "array",
                        "description": "Public Telegram channels to scrape. Accepts @name, name, or https://t.me/name.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "Keywords (optional)",
                        "type": "array",
                        "description": "If set, only messages containing at least one keyword are saved. Case-insensitive. Leave empty to save every message.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywordMatch": {
                        "title": "Keyword match mode",
                        "enum": [
                            "substring",
                            "word"
                        ],
                        "type": "string",
                        "description": "substring = keyword anywhere in text; word = whole-word match only.",
                        "default": "substring"
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "scrape",
                            "monitor"
                        ],
                        "type": "string",
                        "description": "scrape = fetch history up to the limit. monitor = on each run, save only posts newer than the previous run (dedup state kept per channel). Use monitor on a schedule for alerts.",
                        "default": "scrape"
                    },
                    "maxPostsPerChannel": {
                        "title": "Max posts per channel",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Upper bound on posts scanned per channel (paginates backward through history).",
                        "default": 100
                    },
                    "postsNewerThan": {
                        "title": "Only posts newer than",
                        "type": "string",
                        "description": "ISO date/time cutoff (e.g. 2026-01-01). Stops paging once older posts are reached."
                    },
                    "minViews": {
                        "title": "Min views",
                        "type": "integer",
                        "description": "Skip posts below this view count (0 = no filter).",
                        "default": 0
                    },
                    "minReactions": {
                        "title": "Min total reactions",
                        "type": "integer",
                        "description": "Skip posts with fewer total reactions (0 = no filter).",
                        "default": 0
                    },
                    "useProxy": {
                        "title": "Use Apify Proxy",
                        "type": "boolean",
                        "description": "Route requests through Apify Proxy. Recommended only for large jobs — t.me/s/ usually needs no proxy.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Advanced proxy settings (overrides 'Use Apify Proxy')."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
