# Telegram Public Channel Scraper (`simiodev/telegram-public-channel-scraper`) Actor

Messages, views, reactions, media, polls and replies from public Telegram channels. No login, no proxy, fast.

- **URL**: https://apify.com/simiodev/telegram-public-channel-scraper.md
- **Developed by:** [Nestor Cabrera](https://apify.com/simiodev) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 messages

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 Public Channel Scraper

Extract messages, views, reactions, media, polls, replies and forwards from **public Telegram channels**. No Telegram account, no login, no proxy and no API keys. Results are sorted newest first and are ready to export as JSON, CSV or Excel.

It reads the public web preview that Telegram publishes at `t.me/s/<channel>`, so it only works on channels that have that preview enabled.

### What you can do with it

- **Monitor channels on a schedule.** Turn on `incremental` and run it hourly or daily: each run returns only the messages published since the previous one, so you never pay twice for the same message. Connect the dataset to Make, n8n, Zapier, Slack or a webhook for alerts.
- **News and market watching.** Follow news, crypto, finance, tech or local channels and feed the text, links and reaction counts into your own dashboards. (This is data collection, not financial advice.)
- **Brand and topic listening.** Search a keyword across the channels you choose. Filtering happens on Telegram's side, so you only pay for matches.
- **Content and competitor research.** Compare views, reactions and posting frequency across channels to see what actually performs.
- **Journalism, fact-checking and OSINT.** Archive public posts with their original URLs and timestamps before they are edited or deleted.
- **Datasets for analysis or NLP.** Export clean text with dates, metadata, hashtags and mentions to JSON, CSV or Excel. Check the licensing and privacy rules that apply to your use.
- **Time windows.** Pull exactly "the last 7 days" or "September 2026" with `sinceDate` and `untilDate`, so you don't pay to scan history you don't need.

### Input

| Field | Description |
|---|---|
| `channels` | Usernames or links: `durov`, `@durov`, `https://t.me/durov`. Duplicates are merged. Private invite links (`t.me/+...`) can't be read and are skipped with a warning. |
| `maxMessagesPerChannel` | Newest messages first. Default 100. Also your cost cap per channel. |
| `sinceDate` / `untilDate` | ISO date (`2026-10-01`) or relative (`7d`, `12h`, `2w`). Paging stops as soon as it passes `sinceDate`, so you never pay to scan history you don't need. |
| `searchQuery` | Optional keyword filtered by Telegram. |
| `incremental` | Return only messages newer than the last one delivered in a previous run (kept per channel in a store on your account). Default off. |
| `includeChannelInfo` | Adds one free record per channel (title, description, subscribers, counters). Default on. |

Example:

```json
{
  "channels": ["durov", "https://t.me/telegram"],
  "maxMessagesPerChannel": 200,
  "sinceDate": "7d",
  "searchQuery": "update"
}
```

### Output

One dataset item per message (`type: "message"`):

```json
{
  "type": "message",
  "channel": "durov",
  "id": 548,
  "url": "https://t.me/durov/548",
  "date": "2026-09-11T16:04:02+00:00",
  "author": "Pavel Durov",
  "text": "Plain text with line breaks preserved",
  "textHtml": "<div class=\"tgme_widget_message_text\">...</div>",
  "views": 2130000,
  "reactions": [{"emoji": "👍", "count": 1200}],
  "totalReactions": 72470,
  "forwardedFrom": {"name": "Source channel", "url": "https://t.me/source/12"},
  "replyTo": {"id": 540, "url": "https://t.me/durov/540", "author": "Pavel Durov", "text": "..."},
  "photos": ["https://cdn..."],
  "videos": [{"url": "https://cdn...", "thumbnail": "https://cdn...", "duration": "0:42"}],
  "documents": [{"title": "Report", "extra": "PDF"}],
  "poll": {"question": "...", "kind": "Anonymous Poll", "options": [{"text": "A", "percent": 24}]},
  "linkPreview": {"url": "...", "siteName": "...", "title": "...", "description": "...", "image": "..."},
  "links": ["https://example.com"],
  "hashtags": ["#news"],
  "mentions": ["@someone"]
}
```

Plus one `type: "channel"` record per channel and, if a channel can't be read, a `type: "error"` record that explains why. Neither of those is charged.

### Incremental mode in detail

- First run: you get the newest messages (up to `maxMessagesPerChannel`) and the actor remembers the newest id per channel.
- Next runs: only messages newer than that id are returned and charged. If nothing new was posted, the run costs almost nothing.
- If more than `maxMessagesPerChannel` new messages appeared between two runs, you get the newest ones and the older gap is skipped. Raise the limit or run more often if you must not miss any.
- If a run stops early (for example, you hit your maximum charge), the pointer for that channel is not advanced, so the next run may repeat some messages but will never skip any.
- Combining it with `searchQuery` tracks new matching messages only.

### Good to know

- **Public channels only.** Groups, private channels, member lists, comments and anything behind a login are not available through the public preview.
- **Channels without a preview** (many large publishers disable it) return a clear error instead of an empty result.
- Video and media URLs are Telegram CDN links that can expire. Download what you need soon after the run.
- Reaction counts and views are a snapshot at the time of the run.
- Telegram rate-limits heavy traffic. The actor spaces out requests and retries with backoff automatically.

### Is it legal?

It only collects data that Telegram already shows publicly on the web. You are responsible for how you use it, including compliance with Telegram's terms and with data-protection law such as GDPR when messages contain personal data.

# Actor input Schema

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

Public channel usernames or links, for example durov, @durov or https://t.me/durov. Private invite links (t.me/+...) are not supported.

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

Newest messages first. You are charged per message returned, so this is also your cost cap per channel.

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

ISO date such as 2026-10-01 or relative value such as 7d, 12h, 2w. Leave empty for no limit.

## `untilDate` (type: `string`):

Same formats as above. Useful to fetch a past time window together with the previous field.

## `searchQuery` (type: `string`):

Optional keyword. Telegram filters on its side, so you only pay for matching messages.

## `incremental` (type: `boolean`):

Remembers the newest message already delivered per channel and returns only newer ones. Ideal for scheduled monitoring: you never pay twice for the same message. The first run returns the latest messages as usual.

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

Adds one record per channel with title, description, subscribers and media counters (free).

## Actor input object example

```json
{
  "channels": [
    "telegram"
  ],
  "maxMessagesPerChannel": 100,
  "incremental": false,
  "includeChannelInfo": true
}
```

# Actor output Schema

## `messages` (type: `string`):

Scraped messages in table view. Switch the format in the dataset page to export JSON, CSV or Excel.

## `dataset` (type: `string`):

Messages, channel info and error records.

# 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"
    ]
};

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

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

```

## MCP server setup

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

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/sPWElneWNPRLb0Y3d/builds/16ULH5NDs41cuu7Kx/openapi.json
