# Telegram Channel Scraper: Messages, Views & Reactions (`ksvan/telegram-channel-scraper`) Actor

Scrape messages from public Telegram channels without login, phone number or API keys: text, date, views, reactions, photos, videos, forwards, link previews, hashtags and channel info (title, subscribers). Search inside channels and filter by date.

- **URL**: https://apify.com/ksvan/telegram-channel-scraper.md
- **Developed by:** [K.S. Van](https://apify.com/ksvan) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Scraper: Messages, Views & Reactions

Scrape messages from **public Telegram channels** with **no login, no phone number and no API keys**. For every message you get the text, date, **views**, **reactions** (including paid star reactions), photos, videos, documents, polls, forwards, replies, link previews, links and hashtags. Add **channel info** (title, description, subscribers, media counts, verified flag) with one switch, **search inside channels** by keyword or hashtag, and filter by date.

It reads Telegram's own public web preview (`t.me/s/<channel>`), so it is fast, cheap and stable. No browser. Pay only per message delivered.

### What you can paste

- Usernames: `durov`, `@telegram`
- Channel links: `https://t.me/durov`, `t.me/s/durov`
- Single message links: `https://t.me/durov/531`

Only public channels with a web preview are available. Private channels, invite links (`t.me/+...`) and group chats need a logged-in account and are reported as errors (not charged).

### What you get

| Field | Example |
|---|---|
| `channel`, `messageId`, `url` | durov, 552, https://t.me/durov/552 |
| `date` | 2026-10-14T16:02:11+00:00 |
| `text` (and `textHtml` with **Include message HTML**) | message body |
| `views` | 5820000 |
| `reactions`, `totalReactions` | \[{"emoji": "⭐", "count": 5940, "isPaid": true}, ...], 84300 |
| `mediaType` | text / photo / video / document / poll |
| `photos`, `videos` (thumbnail, duration, url), `documents`, `poll` | media details |
| `forwardedFrom`, `forwardedFromUrl`, `replyToUrl`, `author`, `isEdited` | message context |
| `linkPreview` (url, site, title, description), `links`, `hashtags` | links in the post |
| `channelTitle`, `channelSubscribers` | Pavel Durov, 10300000 |

With **Include channel info** you also get one record per channel (`type: "channel"`): `title`, `description`, `subscribers`, `photos`, `videos`, `links`, `files`, `isVerified`, `photoUrl`.

Custom (premium) emoji reactions come with `customEmojiId` instead of an emoji character.

### Use cases

- **Crypto, trading and news monitoring**: track signal channels, announcements and breaking news.
- **Brand and competitor monitoring**: what a channel posts, how often, and how much reach (views and reactions) each post gets.
- **Influencer and channel research**: subscribers, posting frequency and engagement before you buy an ad.
- **OSINT and research**: archive public channels with dates, forwards and links.
- **AI and RAG**: clean message text for summaries, sentiment and LLM pipelines.

### How to use

1. Add channel usernames or links.
2. Set **Max messages per channel** (newest first) and optionally a date range.
3. Optionally add **Search inside channels** words or #hashtags.
4. Run. Each message is one dataset record.

#### Example input

```json
{
  "channels": ["durov", "https://t.me/telegram"],
  "maxMessagesPerChannel": 200,
  "dateFrom": "2026-06-01",
  "includeChannelInfo": true
}
```

### Pricing

- **Message**: charged per message saved to the dataset.
- **Channel info**: charged per channel record, only when **Include channel info** is on.

Channels that fail (not found, private, no web preview) are reported as `error` records and are **not charged**.

### FAQ

**Do I need a Telegram account?** No. The actor reads the public web preview that Telegram shows to everyone.

**Can it scrape groups or comments?** No. Group chats and comment threads are not part of the public web preview and need a logged-in account.

**Is it legal?** It collects publicly available posts from public channels. Make sure your use complies with Telegram's terms and the data protection rules that apply to you.

**Something missing?** Open an issue on the Issues tab and I will look at it.

# Actor input Schema

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

Public channel usernames (durov, @durov), channel links (t.me/durov, t.me/s/durov) or single message links (t.me/durov/531).

## `searchQueries` (type: `array`):

Optional. Only messages matching these words or #hashtags (Telegram's own channel search). Each query runs on every channel.

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

Newest messages first. With search, the limit applies per query.

## `dateFrom` (type: `string`):

Optional YYYY-MM-DD. Stop at older messages.

## `dateTo` (type: `string`):

Optional YYYY-MM-DD. Skip newer messages.

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

Add one record per channel: title, description, subscribers, photo/video/link counts, verified flag, avatar.

## `includeHtml` (type: `boolean`):

Add the formatted message body as HTML (bold, links, emoji).

## `includeServiceMessages` (type: `boolean`):

Keep service messages such as 'channel photo updated'.

## `maxItems` (type: `integer`):

Stop after this many messages in total. 0 = no limit.

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

Apify datacenter proxy works well.

## `maxRetries` (type: `integer`):

Retries with a fresh proxy IP before a channel is reported as failed.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "https://t.me/telegram"
  ],
  "maxMessagesPerChannel": 100,
  "dateFrom": "",
  "dateTo": "",
  "includeChannelInfo": false,
  "includeHtml": false,
  "includeServiceMessages": false,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxRetries": 5
}
```

# Actor output Schema

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

One record per message (plus one channel record per channel when Include channel info is on).

# 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",
        "https://t.me/telegram"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ksvan/telegram-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": [
        "durov",
        "https://t.me/telegram",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("ksvan/telegram-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": [
    "durov",
    "https://t.me/telegram"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call ksvan/telegram-channel-scraper --silent --output-dataset

```

## MCP server setup

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