# Telegram Channel Scraper - Posts, Views, Reactions & Media (`rel8ble/telegram-channel-scraper`) Actor

Scrape any public Telegram channel without logging in: post text, date, views, reactions, photos, videos, files, polls, forwards, replies and channel info (subscribers, description). Pages back through full history. Fast HTTP-only, no browser, no Telegram account.

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

## Pricing

from $1.50 / 1,000 results

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 - Scrape Telegram Messages & Posts API

This **Telegram scraper** lets you scrape Telegram messages and posts from any public channel, with no login, phone number or API key. Use this Telegram channel scraper as a simple **Telegram posts API**: send channel names, get back each post's text, date, views, reactions, photos, videos, files, polls, forwards and replies, plus channel info (subscribers, description), as JSON, CSV or Excel.

The scraper reads Telegram's own public web preview (`t.me/s/<channel>`) over plain HTTP, with **no headless browser**. It returns about 100 posts per second, and runs cost very little. It also saves one channel-info row per channel with subscribers, description, media counters and the verified badge.

### How to use

1. Enter one or more public channels in **Channels** (`durov`, `@durov` or `https://t.me/durov`). Optionally set **Max posts per channel**, a date limit or a search keyword.
2. Click **Start**. Small runs finish in seconds.
3. Download the results as JSON, CSV or Excel from the **Output** tab, or call the actor from your own code through the Apify API.

### What you get

- **Post content**: the full text with line breaks and emoji, plus the links, hashtags and @mentions found in it.
- **Engagement**: view count (e.g. `18.8M` becomes `18800000`), every reaction with its count (including paid ⭐ Star reactions), and the total reaction count.
- **Media**: photo URLs, video URLs with thumbnails and duration, albums, voice notes and audio, round videos, stickers, file names and sizes, polls with option percentages and voter counts, locations, and link previews (title, site, description, image).
- **Context**: forwarded-from (channel name, username, original post), reply-to (post ID and quoted text), author signature, and whether the post was edited.
- **IDs and links**: post ID, post URL and the numeric Telegram channel ID.
- **Channel info**: title, description, subscriber count, photo/video/file/link counters, the verified badge and the avatar URL.
- **Full history**: the scraper pages back from the newest post to the oldest. You can stop it at a post count, at a date, or let it read the whole channel.
- **In-channel search**: pass a keyword to get only the matching posts, using Telegram's own search.

### Use cases

- Media monitoring and news tracking across dozens of channels
- Crypto, trading and signals research: what got posted when, and how much attention it got
- Brand and competitor monitoring, influencer and channel vetting (subscribers, views per post, engagement)
- Datasets for NLP, sentiment analysis and LLM training
- Archiving a channel's history, with links to every media file

### Input

| Field | Default | Description |
|---|---|---|
| `channels` | `durov` | Usernames or links, any form: `durov`, `@durov`, `https://t.me/durov`, `https://t.me/s/durov` |
| `maxPostsPerChannel` | 100 | Newest posts first. `0` = the whole history |
| `onlyPostsNewerThan` | - | A date (`2026-09-01`) or a relative period (`7 days`, `2 weeks`, `3 months`). The scraper stops when posts get older than this. |
| `searchQuery` | - | Returns only the posts that match this keyword |
| `includeChannelInfo` | true | Adds one channel row per channel |
| `maxConcurrency` | 5 | Channels scraped in parallel (1-20) |
| `maxRequestRetries` | 6 | Retries per failed page (0-20) |
| `proxyConfiguration` | Apify Proxy | Datacenter proxy is enough |

#### Input example

```json
{
    "channels": ["durov", "bloomberg", "https://t.me/telegram"],
    "maxPostsPerChannel": 500,
    "onlyPostsNewerThan": "30 days"
}
```

### Output example

Each post is one dataset item with `type: "post"`. The example below is a real item from a run on 24 Sep 2026. The long CDN URL is shortened, and 5 of its 8 reactions are left out.

```json
{
    "type": "post",
    "channel": "bloomberg",
    "channelId": "1488156064",
    "channelTitle": "Bloomberg",
    "postId": 3225,
    "url": "https://t.me/bloomberg/3225",
    "date": "2026-09-22T03:26:17.000Z",
    "timestamp": 1790047577,
    "edited": false,
    "text": "Alibaba unveils new AI chip it says is China's most powerful and targets 20 gigawatts of data center capacity by 2032. https://bloom.bg/4ydroys\n\n📷: Qilai Shen/Bloomberg",
    "textLength": 169,
    "views": 13400,
    "viewsText": "13.4K",
    "reactionsTotal": 173,
    "reactions": [
        { "emoji": "🔥", "customEmojiId": null, "isPaid": false, "count": 62, "countText": "62" },
        { "emoji": "❤", "customEmojiId": null, "isPaid": false, "count": 33, "countText": "33" },
        { "emoji": "👏", "customEmojiId": null, "isPaid": false, "count": 27, "countText": "27" }
    ],
    "mediaType": "photo",
    "mediaUrls": ["https://cdn5.telesco.pe/file/B-Vjm-tufLB1ZSrW02mb...R7w.jpg"],
    "isAlbum": false,
    "photos": [{ "url": "https://cdn5.telesco.pe/file/B-Vjm-tufLB1ZSrW02mb...R7w.jpg", "postUrl": "https://t.me/bloomberg/3225" }],
    "videos": [],
    "roundVideos": [],
    "audio": [],
    "documents": [],
    "sticker": null,
    "poll": null,
    "location": null,
    "linkPreview": null,
    "links": ["https://bloom.bg/4ydroys"],
    "hashtags": [],
    "mentions": [],
    "forwardedFrom": null,
    "replyTo": null,
    "author": null,
    "unsupportedInPreview": false,
    "input": "bloomberg",
    "searchQuery": null,
    "scrapedAt": "2026-09-24T05:15:24.280Z"
}
```

When a post has them, the fields look like this:

```json
"forwardedFrom": { "name": "Mash Money", "url": "https://t.me/mashmoneymash/2732", "username": "mashmoneymash", "postId": 2732 },
"replyTo": { "postId": 78053, "url": "https://t.me/mash/78053", "author": "Mash", "text": "..." },
"videos": [{ "url": "https://cdn4.telesco.pe/file/7451201fa5.mp4?token=...", "thumbnail": "https://cdn4.telesco.pe/file/...", "duration": "0:25", "isGif": false, "tooLargeForPreview": false }],
"documents": [{ "title": "Features 1.png", "size": "3.9 MB", "postUrl": "https://t.me/designers/243?single" }],
"poll": { "question": "...", "type": "Anonymous Poll", "voters": 1720, "options": [{ "text": "Yes", "percent": 42 }, { "text": "No", "percent": 34 }] }
```

Each channel also gets one item with `type: "channel"`:

```json
{
    "type": "channel",
    "username": "bloomberg",
    "title": "Bloomberg",
    "description": "The first word in business news.",
    "subscribers": 175000,
    "photos": 800,
    "videos": 49,
    "files": null,
    "links": 3180,
    "verified": true,
    "photoUrl": "https://cdn5.telesco.pe/file/TczlHBZov8...jpg",
    "url": "https://t.me/bloomberg",
    "previewUrl": "https://t.me/s/bloomberg",
    "previewAvailable": true
}
```

The dataset has three ready-made views: **Overview** (date, text, views, reactions, media), **Engagement** (views and reactions for each post) and **Channels** (the channel-info rows).

#### Field fill rates (real test run: 900 posts across 6 channels)

| Field | Fill rate |
|---|---|
| postId, url, date, channelId, channelTitle | 100% |
| views | 100% |
| text | 99% (the rest are media-only posts) |
| links in text | 77% |
| media (photo / video / file / poll) | 66% |
| reactions | 62% (100% on channels that have reactions turned on; some channels switch them off) |
| linkPreview | 17% |
| author signature | 17% (only channels that sign their posts) |
| hashtags | 15% |
| edited | 14% |
| forwardedFrom / replyTo | 3% / 2% |

### Pricing

Pay per result: **$1.50 per 1,000 results**. A result is a post or a channel-info row saved to the dataset.

- 1,000 results = $1.50
- 10,000 results = $15

You're never charged for failed requests or for duplicates. If you set a maximum cost per run, the scraper stops cleanly when it reaches that amount. The Apify free plan includes $5 of monthly credit, enough to try the scraper on a few thousand posts.

### Integrations

- **Make, Zapier and n8n**: start runs and pass new posts into your workflows.
- **Google Sheets**: export the dataset straight to a spreadsheet.
- **Apify API**: run the actor and fetch results over REST, or with the JavaScript and Python API clients.
- **Webhooks**: get a call when a run finishes.
- **MCP for AI agents**: through the Apify MCP server (https://mcp.apify.com), Claude, ChatGPT and Cursor agents can call this actor as a tool.
- **Schedules**: run it daily or hourly to track channels over time.

### Limits (read before large runs)

- **Only public channels that have a web preview.** Private channels, invite links (`t.me/+...`), groups and bots have no public post history. For groups and channels with the preview turned off, the scraper returns only the channel-info row (`previewAvailable: false`), and the log says why.
- **Comments are not included.** Telegram doesn't show discussion-group replies in the web preview.
- **Custom (premium) emoji reactions** come back as a `customEmojiId` with no emoji character, because Telegram shows them as images. Their counts are still correct.
- **Counts are rounded the way Telegram shows them**, e.g. `13.4K` is saved as `13400`. The raw text is kept in `viewsText` and `countText`.
- **Very large videos** are listed without a direct file URL, because Telegram doesn't stream them in the preview. You still get the thumbnail, the duration and a link to the post (`tooLargeForPreview: true`).
- **Media URLs are signed CDN links that expire after a while.** Download the files soon after the run if you need to keep them.
- A few service messages and deleted posts leave gaps in the post IDs. That's normal.

### FAQ

**Do I need a Telegram account or API ID?**
No. The scraper reads the same public page you see when you open `https://t.me/s/durov` in a browser.

**How far back can it go?**
All the way to the first post. Set `maxPostsPerChannel: 0` to read the whole history. In our tests, 250 posts took 7 seconds and 480 posts took 12 seconds.

**How do I get only new posts every day?**
Schedule the actor with `onlyPostsNewerThan: "1 day"`. To skip anything you've already stored, deduplicate on `url` (or on `channel` + `postId`).

**Why did a channel return 0 posts?**
Check the `RUN_SUMMARY` record in the key-value store. It gives a stop reason for each channel, such as "channel not found" or "web preview not available (group)".

**Which proxy should I use?**
The default Apify Proxy works. Telegram rarely blocks the preview pages. When it rate-limits a request, the scraper retries it on a new IP.

**How does it avoid blocks?**
It sends realistic desktop Chrome headers through Apify Proxy and keeps a pool of sessions. A 401, 403 or 429 response, or a page it doesn't recognise, retires that session, so the next attempt goes out on a new IP. Failed pages are retried up to 6 times by default (`maxRequestRetries`), with a growing back-off between attempts.

**What are the limits?**
Only public channels with a web preview (no private channels, groups or comments), up to 20 posts per preview page, and counts rounded the way Telegram shows them. See **Limits** above for the full list. There's no fixed cap on posts: `maxPostsPerChannel: 0` reads the whole history.

**Is it legal to scrape Telegram?**
The scraper collects only content that channel owners have published publicly on the open web. You're responsible for how you use the data, including complying with Telegram's terms of service and with privacy laws such as GDPR for any personal data that appears in posts. This is not legal advice; if you're unsure, check with a lawyer.

### How it works (for developers)

`t.me/s/<channel>` returns server-rendered HTML with up to 20 posts per page, plus a `<link rel="prev" href="?before=N">` cursor. The scraper parses each `tgme_widget_message` block with cheerio. It reads every field defensively, so one malformed post can never break a page. Channels run in parallel, and the pages of one channel run in order. Everything the scraper has already seen is kept in the actor state, so a migrated run resumes without creating duplicates.

Run it locally:

```bash
npm install
npm test                                   # parser tests on saved fixtures
APIFY_LOCAL_STORAGE_DIR=./storage node src/main.js   # input in storage/key_value_stores/default/INPUT.json
```

# Actor input Schema

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

Public Telegram channel usernames or links, one per line. Any form works: "durov", "@durov", "https://t.me/durov" or "https://t.me/s/durov". Private invite links (t.me/+...) and groups cannot be scraped.

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

How many posts to collect from each channel, newest first. The scraper pages back through history until it has this many. Example: 100. Set 0 to scrape the whole channel history.

## `onlyPostsNewerThan` (type: `string`):

Optional. Skip posts older than this and stop paging. Use a date (2026-09-01) or a relative period ("7 days", "2 weeks", "3 months"). Leave empty for no date limit.

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

Optional keyword, e.g. "bitcoin". Only posts matching it are returned, using Telegram's own in-channel search. Leave empty to get all posts.

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

Add one row per channel with its title, description, subscriber count, photo/video/file/link counters, verified badge and avatar URL.

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

How many channels are scraped in parallel (1-20). Pages within one channel always run in order. The default of 5 suits most runs.

## `maxRequestRetries` (type: `integer`):

How many times a failed page is retried (0-20). Rate-limited or blocked requests are retried on a new proxy session.

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

Apify Proxy (datacenter) is enough for Telegram and is the default. Rate-limited requests are retried on a new IP automatically.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "bloomberg"
  ],
  "maxPostsPerChannel": 20,
  "includeChannelInfo": true,
  "maxConcurrency": 5,
  "maxRequestRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All posts found (type = post), plus one channel-info row per channel (type = channel).

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

Per-channel counts, date range covered and stop reasons.

# 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",
        "bloomberg"
    ],
    "maxPostsPerChannel": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rel8ble/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",
        "bloomberg",
    ],
    "maxPostsPerChannel": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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