# Telegram Channel Scraper: Posts, Views & Media Links (`gr8data/telegram-channel-scraper`) Actor

Telegram Channel Scraper for public channels: posts, dates, views, reactions, links, media URLs and channel info. No login, no API, no proxy. Full history paging, optional onlyNew for scheduled runs, formula-safe CSV and an offline report.

- **URL**: https://apify.com/gr8data/telegram-channel-scraper.md
- **Developed by:** [Gr8 Data](https://apify.com/gr8data) (community)
- **Categories:** Social media, News
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.35 / 1,000 posts scraped

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/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: Posts, Views & Media Links

**Fetch the full post history of any public Telegram channel: text, date, views, reactions, links and media URLs. No login, no API key, no proxy. You pay only for posts delivered, with no start fee.**

Give it channel names or `t.me` links. It reads the public web preview (`t.me/s/<channel>`) and pages back through the channel history, newest first, until it reaches your post limit, your start date, or the beginning of the channel.

[![30-second walkthrough: public Telegram channels as clean data, from a real run](https://img.youtube.com/vi/cePs8DaojwY/maxresdefault.jpg)](https://youtu.be/cePs8DaojwY)

**Real run on Apify:** 8 public channels (English, Arabic and Russian news and tech) returned **2,400 posts in 4.5 minutes**, 300 per channel, with views on every post, reactions on 1,200 of them, photo or video links on 1,180, and the channel subscriber count on every row. A channel with no public preview (and an invalid link) came back as a free, clearly labelled row instead of an error. Run it again on a schedule with `onlyNew` and the identical second run delivered **0 repeated posts**: you pay only for posts you do not have yet.

![Offline report with search: 300 posts from three channels](https://simple-free-apps.github.io/listings/telegram-channel-scraper/report-overview.png)
![English news channel: views, reactions and media count per post](https://simple-free-apps.github.io/listings/telegram-channel-scraper/english-news-channel.png)
![Russian news channel in the same report](https://simple-free-apps.github.io/listings/telegram-channel-scraper/russian-news-channel.png)

### What you get per post

| Field | Notes |
|---|---|
| `channel`, `postId`, `url`, `date` | ISO 8601 UTC date, direct link to the post |
| `text`, `hashtags`, `mentions`, `links` | Plain text with line breaks, Arabic/Cyrillic/emoji intact; links from the text and the link preview |
| `views`, `viewsRaw` | Parsed number plus the raw string as Telegram shows it (`"21.6K"`). Telegram rounds large counts, so they are not exact |
| `reactions`, `reactionsTotal` | Emoji and counts when the channel shows them (paid star reactions appear as ⭐) |
| `media` | Photos and videos: `type`, `url`, `thumbnailUrl`, `duration`, `postUrl`. Albums are listed with each photo's own post link |
| `linkPreview` | Site name, title, description, URL |
| `replyTo`, `isForwarded`, `forwardedFrom`, `isEdited`, `author` | Reply target, forward source (when public), "edited" flag, post signature |
| `hasUnsupportedContent` | `true` when Telegram's preview hides part of the post ("Please open Telegram to view this post"), e.g. content the web preview cannot show |
| `channelTitle`, `channelSubscribers` | On every row. Full channel info is in `RUN_SUMMARY` |

Also written to the run's storage: `export.csv` (formula-injection-safe, opens cleanly in Excel and Google Sheets), an offline `report.html` (search box, no external requests) and `RUN_SUMMARY` (per channel: status, posts, pages, and why it stopped).

### Input

```json
{
  "channels": ["durov", "t.me/s/telegram", "@bloomberg"],
  "maxPostsPerChannel": 500,
  "dateFrom": "2026-11-01",
  "onlyNew": false
}
```

- **`channels`**: usernames or links in any common form. Leave empty (`{}`) for a cheap demo: the latest 20 posts of one channel.
- **`maxPostsPerChannel`**: default 200 when you list channels, up to 100,000. Each delivered post is one billed event.
- **`dateFrom`**: stop once posts are older than this date.
- **`onlyNew`**: for schedules. Delivers only posts newer than the highest post id already delivered for that channel. Edited old posts are never reported as new. If a channel produces more new posts than the cap between runs, raise the cap. Use `stateKey` to keep separate histories for separate schedules.

### Pricing

Pay per event: one `post-scraped` event for each post delivered to the dataset. **No start fee.** Unavailable channels, invalid links, service messages (pins, joins), duplicates and the summary, CSV and report files are free. Set a maximum cost per run in Apify and the Actor stops cleanly at that limit.

### What it covers, and what it does not

- **Public channels with the Telegram web preview only.** No groups, no private channels, no invite links, no personal accounts, no member lists. If a channel has no public preview, the run says so for that channel and charges nothing.
- **Not verified in testing:** voice messages, documents and polls. The preview often hides these (`hasUnsupportedContent`), and I have not captured enough real examples to promise their fields. Photos, videos, albums, link previews, reactions, replies, forwards and edits are covered by tests on real pages.
- **Comment counts and per-viewer data are not exposed** by the public preview and are not returned.
- **Media URLs are Telegram CDN links, and some are signed and expire.** Download the files soon after the run if you need them. The Actor returns links only, never the files.
- **Speed:** it reads one page (about 20 posts) every 2 seconds across all channels, politely, because everything comes from one host. That is about 1,000 posts in 105 seconds. Large multi-channel runs take minutes; the default 1-hour timeout fits roughly 34,000 posts.
- **The preview shows the history Telegram exposes publicly.** If Telegram blocks or rate-limits a run, the Actor stops immediately, never retries a block, and reports it in `RUN_SUMMARY`. No proxy, no workarounds.
- You are responsible for using the data lawfully and respecting channel owners' rights and Telegram's terms. Not affiliated with or endorsed by Telegram.

### Tips

- Schedule it daily with `onlyNew: true` for a feed of fresh posts per channel.
- Combine with `dateFrom` for a backfill of the last month, then switch to `onlyNew`.
- Many channels in one run is fine: failures on one channel never stop the others.

# Actor input Schema

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

Public channel usernames or links: durov, @durov, t.me/durov, https://t.me/s/durov. Public channels with a web preview only (no groups, private channels or personal accounts).

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

Newest posts first, paging back until this many are delivered. Default 200 when you list channels (20 for the empty demo input). Up to 100,000. Each delivered post is one billed event.

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

Stop paging once posts are older than this date, e.g. 2026-11-01 or 2026-11-01T12:00:00Z.

## `onlyNew` (type: `boolean`):

For scheduled runs: delivers only posts newer than the highest post id already delivered for each channel (edited old posts are never reported as new). If more new posts than the cap exist, raise Max posts per channel.

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

Use different names to keep independent onlyNew histories for different schedules. Default: default.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxPostsPerChannel": 200,
  "onlyNew": false
}
```

# Actor output Schema

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

Channel posts, newest first.

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

Per-channel status, counts and why each channel stopped.

## `report` (type: `string`):

Self-contained HTML report with search.

## `csv` (type: `string`):

Formula-injection-safe CSV of all delivered posts.

# 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"
    ],
    "maxPostsPerChannel": 200
};

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

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

```

## MCP server setup

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