# Telegram Channel Scraper & Analytics (`thelastscraper/telegram-channel-scraper`) Actor

Export posts, views and reactions from public Telegram channels, get channel stats (reach, engagement rate, posting frequency), search keywords and monitor new posts. No login, no account. $1 per 1,000 posts.

- **URL**: https://apify.com/thelastscraper/telegram-channel-scraper.md
- **Developed by:** [The Last Scraper](https://apify.com/thelastscraper) (community)
- **Categories:** Social media, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Analytics

Export **posts, views and reactions** from public Telegram channels as numbers, get **channel
statistics and analytics** in one row (exact subscribers, median views, reach/ERR, engagement rate, posting
frequency, trend), **search keywords inside channels** and **monitor** channels for new posts on a
schedule. It reads Telegram's public web preview (`t.me/s/<channel>`): **no login, no account, no
API keys**. **$1 per 1,000 posts** on the Free plan ($0.50 on Gold), no start fee, and a free
estimate mode.

### Use it from an AI agent (MCP)

Add this Actor as a tool through Apify's MCP server:
`https://mcp.apify.com?tools=thelastscraper/telegram-channel-scraper`. A small input that works
as is:

```json
{"channels": ["telegram"], "maxPostsPerChannel": 20}
```

- **Cost control:** each post is charged as it is delivered; `maxPostsPerChannel` defaults to 100
  and Max charge per run stops the run before the next post that would not fit.
- **Results:** one row per post. Useful `fields`: `post_url,date,text,views,reactions_total`.
- **Stats instead of posts:** `{"mode": "channel_report", "channels": ["telegram"]}` returns one row
  per channel with the metrics below.
- **Not sure how big a channel is?** `{"mode": "estimate", ...}` is free and tells you how many
  posts and what the run would cost (with keywords, the most it can cost: matches are unknown
  until the queries run).

### Highlights

- **Numbers, not text:** views, reactions and paid Stars are integers (`4.95M` becomes
  `4950000`), with the text as shown kept in `views_display` and `views_rounded: true`.
- **Exact subscribers** from the channel's public card (`9 915 860`, not `9.92M`).
- **The channel report in one row:** median and average views, reach (ERR), engagement rate,
  posts per day and week, the views trend, the best hours and weekdays, the content mix.
- **Keyword search inside channels**, through Telegram's own in-channel search, several keywords
  merged (a post matching two keywords is delivered and charged once).
- **Monitoring:** schedule it with a monitor name and each run delivers only the new posts, plus
  what changed on recent posts (views, reactions, edits, deletions) and the subscriber count.
- **Date ranges:** `dateFrom` and `dateTo` (`YYYY-MM-DD` or `30 days`); the Actor jumps straight
  to an old date instead of reading everything in between.
- **Spreadsheet or JSON:** flat columns for CSV and Excel, or the full nested records.
- **Free estimate, no start fee:** you pay for what is delivered.

### How to use it

**Posts of a channel in a date range:**

```json
{
  "channels": ["telegram", "https://t.me/s/contest"],
  "dateFrom": "2026-10-01",
  "maxPostsPerChannel": 500
}
```

**Channel report (stats, one row per channel):**

```json
{
  "mode": "channel_report",
  "channels": ["telegram", "contest"],
  "metricsSamplePosts": 100
}
```

**Keyword search inside channels:**

```json
{
  "channels": ["telegram", "contest"],
  "keywords": ["wallet", "stars"],
  "keywordMatch": "strict",
  "maxPostsPerChannel": 50
}
```

**Monitor (schedule this run daily or hourly):**

```json
{
  "channels": ["telegram", "contest"],
  "monitorName": "my-channels",
  "monitorTrackViewsDays": 3,
  "maxPostsPerChannel": 100
}
```

Channels can be given as `telegram`, `@telegram`, `t.me/telegram`, `https://t.me/s/telegram`, or a
post link such as `t.me/telegram/441`, which starts from that post. Invite links and private chats are skipped
and listed in `OUTPUT.skippedInputs`. Only channels are read: a username that belongs to a person,
a bot or a group yields no row (it is listed with the reason `not_a_channel`).

`maxPostsPerChannel: 0` reads a channel's whole history. That can take hours on a big channel: at
the default pace the Actor reads about 900 pages an hour (7,000-18,000 posts), or roughly 4-8
minutes per 1,000 posts.

### What you get

One row per post in the default dataset (spreadsheet format; `full_json` keeps `reactions`,
`media`, `poll` and `link_preview` nested). The values below show the shape of a row:

| Field | Example | Notes |
|---|---|---|
| `post_url` | `https://t.me/telegram/441` | first column |
| `channel`, `channel_id` | `telegram`, `-1005640892` | the numeric id survives renames |
| `post_id`, `album_ids` | `441`, `441` | an album lists all its ids (`510; 511`) |
| `date` | `2026-11-02T14:00:00Z` | UTC |
| `text`, `text_length` | | plain text, emoji as characters, line breaks kept |
| `views`, `views_display`, `views_rounded` | `4950000`, `4.95M`, `true` | see Limits |
| `reactions_total`, `top_reaction`, `reactions` | `46394`, `👍`, JSON | paid Stars apart in `paid_stars` |
| `edited` | `false` | |
| `forwarded_from_name`, `forwarded_from_url`, `forwarded_from_channel` | | as shown on the post |
| `reply_to_post_id`, `reply_to_url` | | |
| `links`, `hashtags`, `mentioned_usernames` | | links are http(s) only |
| `media_types`, `media_count`, `first_media_url` | `video`, `1`, ... | photo, video, round video, voice, audio, document, sticker, GIF, poll, location |
| `poll_question`, `poll_options` | | with the percentages shown |
| `link_preview_url`, `link_preview_title` | | |
| `has_unsupported_media` | `false` | content the web preview cannot show |
| `matched_keywords` | `wallet; stars` | with keywords |
| `scraped_at` | | UTC |

With **Include the channel card** (on by default) the `channels` dataset gets one row per channel:
`channel_url`, `title`, `description`, `verified`, `subscribers` (exact), `photos`, `videos`,
`links`, `files`, `latest_post_id`, `latest_post_at`, `days_since_last_post`.

The **channel report** row adds: `sample_posts`, `sample_posts_used`, `views_median`, `views_avg`,
`views_p25`, `views_p75`, `views_max`, `reach_median_pct`, `reach_avg_pct`,
`engagement_rate_pct`, `reactions_per_post`, `paid_stars_total`, `posts_per_day`,
`posts_per_week`, `posts_last_7d`, `posts_last_30d`, `views_trend_pct`, `best_hours_utc`,
`best_weekdays`, `forward_share_pct`, `top_forward_sources`, `media_share_pct`, `link_share_pct`,
`avg_text_length`, `top_hashtags`, `edited_share_pct`, and with a monitor history
`subscribers_prev`, `subscribers_change`, `subscribers_growth_pct_per_day`.

The `OUTPUT` record says why the run stopped (`stoppedCode`: `done`, `spending_cap`,
`max_requests`, `rate_limited`, `aborted`, `timeout`, `layout_changed`), what was delivered and
charged, the skipped inputs and a summary per channel.

### Metric definitions

Computed over the sampled posts that are at least `metricsMinPostAgeHours` old (24 by default:
younger posts are still gaining views), called "used" posts:

- **Reach (ERR):** `reach_median_pct = median(views) / subscribers × 100`; `reach_avg_pct` uses
  the mean. The mean is the common definition; the median is robust to one viral post. Both are
  given.
- **Engagement rate:** `engagement_rate_pct = Σ reactions / Σ views × 100`, over the used posts
  that show reactions. Paid Stars reactions are left out (they count stars, not people) and
  reported apart as `paid_stars_total`. Forward and comment counts are not public, so they are not
  part of it: some tools define ER with them, so numbers are not comparable across tools.
- **Posting frequency:** `posts_per_day = posts in the sample / days between the oldest and the
  newest sampled post` (at least one day). `posts_last_7d` and `posts_last_30d` are counted only
  when the sample reaches that far back; otherwise they are empty.
- **Trend:** `views_trend_pct = median(views of the newer half) / median(views of the older half)
  × 100 − 100`.
- **Best hours and weekdays:** the UTC hours and weekdays with the highest median views, from at
  least two posts each, top 3.
- **Growth:** only from the history this Actor records. Each run with a `monitorName` stores the
  subscriber count per channel (90 points kept); with two or more points the row gets the change
  and the growth per day. Without a history these fields are empty and `growth_note` says to
  schedule the run with a monitor name. No public source gives past subscriber counts.

### Monitoring

Give the run a `monitorName` and schedule it (Schedules in Apify Console). The state lives in your
own key-value store `tg-monitor-<name>`; nothing is kept on my side. Each scheduled run:

- delivers **only the posts published since the previous run** (`post` each), oldest first; if more
  arrived than `maxPostsPerChannel`, the rest come in the next run, nothing is skipped;
- re-checks every post younger than `monitorTrackViewsDays` (3 by default, at most the newest 500
  per channel) and writes **one change row per re-checked post** in the `changes` dataset:
  `views`, `reactions`, `edited`, `missing`, `deleted` (charged `post-update`), or `snapshot` when
  nothing changed (charged `post-snapshot`, half the price; it still carries the current views, so
  you get a view time series);
- reads each channel's card once (`channel` each run) and adds a `subscribers` change row when the
  count moved.

A post already delivered by the same monitor is never charged as a post again, also after a
channel rename (channels are tracked by their numeric id). The first run delivers posts like a
normal run (`monitorFirstRun: deliver`) or only records where to start (`baseline_only`, cards
only). Two runs of the same monitor never overlap: a run that finds another live run holding the
monitor stops at once without charging.

**What a schedule costs** (Free plan prices): a daily monitor of 10 channels posting 20 posts a
day with 3 days of re-checks is about 200 new posts, ~600 re-checks (mostly snapshots) and 10
cards a day: about $0.37 a day. The same monitor run every hour reads every card 24 times and
re-checks each recent post every hour (~14,400 re-checks a day): about $4.3 a day, more when views
move every hour (a changed post costs twice a snapshot). Hourly runs
are for a few channels, or for `monitorTrackViewsDays: 0` (new posts only).

### Pricing

Pay per event, no start fee. Prices per 1,000 events:

| Event | What it is | Free | Bronze | Silver | Gold |
|---|---|---|---|---|---|
| `post` | a post delivered | $1.00 | $0.80 | $0.65 | $0.50 |
| `channel` | a channel card delivered (exact subscribers); once per channel per monitor run | $2.00 | $1.50 | $1.20 | $1.00 |
| `channel-report` | a channel row with metrics | $15.00 | $12.00 | $10.00 | $8.00 |
| `lookup` | a request that ends without a charged row (see below) | $0.50 | $0.45 | $0.40 | $0.35 |
| `post-update` | monitor: a re-checked post that changed | $0.50 | $0.40 | $0.30 | $0.25 |
| `post-snapshot` | monitor: a re-checked post that did not change | $0.25 | $0.20 | $0.15 | $0.125 |

A **lookup** is a request to t.me that delivers no charged row: each keyword query (one per
keyword per channel), each probe while jumping to `dateTo` (at most 8 per channel), a page whose
posts were all filtered out (by `keywordMatch: strict` or the dates), an input that turns out
not to be a channel, and a second username of a channel already read in the same run (it is
read once). It keeps the price of what you get honest: you pay for the work it took.

Examples on the Free plan: 1,000 posts of 5 channels with their cards = $1.01; a report of 100
channels = $1.50; a keyword search of 10 channels for 3 keywords returning 200 posts, with the cards ≈ $0.24.
The estimate mode is free.

### Limits

- **Views above 999 are rounded by Telegram** on the public preview: it shows 3 significant
  digits (`4.95M`), so the integer can be off by up to half a unit of the last digit shown (at most
  0.5 %). `views_rounded` says when. Exact views need a logged-in Telegram account, which this
  Actor never uses.
- **No forward counts and no comment counts:** they are not on the public page (the forward
  *source* is).
- **Media links expire:** photo and video URLs are Telegram CDN links with tokens that expire
  within hours or days. Download what you need promptly.
- **Channels only:** no groups, no users, no member lists, no phone numbers.
- **Search only inside the channels you give:** a search across all of Telegram needs a logged-in
  account or a search engine; this Actor uses neither.
- **Pace and rate limits:** requests go one at a time, 3 seconds apart by default. t.me's limits
  are shared with other Apify users' runs that leave from the same IPs. If t.me rate-limits, the
  Actor waits (at most 2 minutes per run in total), slows down once and then stops with what it
  delivered (`rate_limited`); try again later.
- **Mentions are not verified:** `mentioned_usernames` lists `@names` and `t.me` links as written
  in the text; they may be people, and the Actor never looks them up.
- **Monitor limits:** at most 500 re-checked posts per channel; a rounded view count may hide
  small changes. If a run is killed abruptly (out of memory, a crash), the next scheduled run may
  deliver again the posts of the one channel that was in progress.
- **If t.me changes its page layout,** the Actor stops with `layout_changed` and charges nothing
  more; I fix it from saved test pages.

### Privacy and responsible use

The Actor reads public channel pages only, the same pages anyone sees without logging in. It has
no feature for personal data: no phone numbers, no member lists, no comments, no e-mail or phone
extraction (`links` keeps http(s) links only), and it never looks up the people named in a post.
A username that belongs to a person, a bot or a group yields no row, and nothing about it is
stored. Posts can still contain personal data written by their authors; you are responsible for
how you use the data, under the GDPR and other laws that apply to you, and under Telegram's terms.

### FAQ

**Can I export a Telegram channel to Excel or CSV?** Yes: run it, then export the dataset as
CSV or Excel from the run's Storage tab. The default spreadsheet format keeps one value per
column.

**How do I get a Telegram channel's average views or engagement rate?** Run the channel report
(`channel_report` mode): its row per channel gives `views_avg` and `views_median`, the reach
(`reach_avg_pct` and `reach_median_pct`, views / subscribers) and `engagement_rate_pct`
(reactions / views). Forward and comment counts are not public, so they are not part of it.

**Can I schedule it?** Yes: save the input as a Task and add a Schedule. Add a `monitorName` so
each run delivers only what is new.

**Can I get notified of new posts?** Schedule the run with a `monitorName`: each run delivers only
the posts published since the previous run, and Make, Zapier or n8n (through Apify's
integrations) can send them on.

**Can I call it from my code?** Yes, through the Apify API or the Python and JavaScript clients;
the input is the JSON above. It also works with Make, Zapier, n8n and other integrations through
Apify.

**Why is a run slower than I expected?** The Actor reads one page of about 20 posts every 3-4
seconds, by design, to stay polite to t.me. Use the estimate mode to see the expected duration.

**I found a problem or need a field.** Open an issue on the Issues tab; I answer within 48 hours.

**Related Actors by The Last Scraper:** Airbnb Scraper, Airbnb Calendar & Occupancy, Airbnb
Reviews and Airbnb Listing Details.

# Changelog

This Actor's version history is a separate document: https://apify.com/thelastscraper/telegram-channel-scraper/changelog.md

# Actor input Schema

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

<b>Posts</b>: every post of the channels in a date range or up to N per channel, with numeric views and reactions; add keywords to search inside the channels; add a monitor name to get only new posts on a schedule. <b>Channel report</b>: one row per channel with exact subscribers, median and average views, reach (ERR), engagement rate, posting frequency and trend. <b>Estimate</b>: free; reads one page per channel and tells you how many posts and what each mode would cost.

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

Public channel usernames or links: <code>telegram</code>, <code>@telegram</code>, <code>t.me/telegram</code>, <code>https://t.me/s/telegram</code>. A post link such as <code>t.me/telegram/441</code> starts from that post. Up to 500. Invite links and private chats are skipped; people, bots and groups are not read (channels only).

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

Optional. Only posts that match, through Telegram's own in-channel search. All keywords of a channel are searched and merged: a post that matches two keywords is delivered and charged once, with both in <code>matched_keywords</code>. Each keyword query costs one lookup. Up to 20, 2-64 characters each.

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

<b>strict</b> also requires the keyword in the post text (case- and accent-insensitive); after 2 pages in a row with no strict match the search of that keyword ends.

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

Posts delivered per channel (newest first). 0 = the whole history, which can take hours: about 900 pages (7,000-18,000 posts) an hour.

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

Optional: <code>YYYY-MM-DD</code> or <code>N days</code> (e.g. <code>30 days</code>). Posts older than this are not delivered.

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

Optional: <code>YYYY-MM-DD</code> or <code>N days</code>, inclusive. The Actor jumps to that date with at most 8 probes per channel, each charged as a lookup (with keywords too: Telegram's search has no date filter, so the search starts from that date).

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

Posts mode: one row per channel in the <code>channels</code> dataset with the exact subscriber count, title and description (charged as one channel card).

## `metricsSamplePosts` (type: `integer`):

Channel report: how many of the newest posts the metrics use (20-200).

## `metricsMinPostAgeHours` (type: `integer`):

Posts younger than this are left out of the view statistics (their views are still growing).

## `includePosts` (type: `boolean`):

Channel report: the sampled posts go to the <code>posts</code> dataset (each charged as a post).

## `monitorName` (type: `string`):

Turns the run into a monitor: schedule it and each run delivers only the new posts, plus a change row (views, reactions, edits, missing, deleted) for every recent post it re-checks, and the subscriber change. Lowercase letters, digits and hyphens. The state lives in your key-value store <code>tg-monitor-\<name></code>. In the channel report mode it records the subscriber history for growth.

## `monitorTrackViewsDays` (type: `integer`):

Each run re-checks the posts younger than this (one change row each: post-update when it changed, post-snapshot when not), at most the newest 500 per channel (on a channel posting 100 a day, 30 days means about 5). 0 = new posts only.

## `monitorFirstRun` (type: `string`):

The first run of a monitor delivers posts like a normal run, or only records where to start (charging only the channel cards).

## `outputFormat` (type: `string`):

Flat rows for CSV/Excel, or the full nested records.

## `includeTextHtml` (type: `boolean`):

Adds <code>text_html</code> (the post's formatting and links).

## `delaySeconds` (type: `integer`):

A polite pace: 2-6 s between requests, plus up to 1 s of random jitter. If t.me rate-limits, the Actor slows down once (never beyond 6 s) and then stops with what it has.

## `maxRequests` (type: `integer`):

A hard cap on t.me requests in this run, retries included (0 = no cap). Use Max charge per run for a money cap.

## `jitterSeconds` (type: `integer`):

Random extra pause, 0-1 s.

## `useApifyDatacenterProxy` (type: `boolean`):

Experimental: route requests through Apify's datacenter proxy. Off by default.

## `recordEgressIp` (type: `boolean`):

Validation only: asks Apify's own api.apify.com/v2/browser-info (not t.me) for the run's public IP and writes it to RUN_REPORT.

## Actor input object example

```json
{
  "mode": "posts",
  "channels": [
    "telegram",
    "contest"
  ],
  "keywords": [],
  "keywordMatch": "telegram",
  "maxPostsPerChannel": 20,
  "dateFrom": "",
  "dateTo": "",
  "includeChannelInfo": true,
  "metricsSamplePosts": 100,
  "metricsMinPostAgeHours": 24,
  "includePosts": false,
  "monitorName": "",
  "monitorTrackViewsDays": 3,
  "monitorFirstRun": "deliver",
  "outputFormat": "spreadsheet",
  "includeTextHtml": false,
  "delaySeconds": 3,
  "maxRequests": 0,
  "jitterSeconds": 1,
  "useApifyDatacenterProxy": false,
  "recordEgressIp": false
}
```

# Actor output Schema

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

No description

## `channels` (type: `string`):

No description

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

No description

## `changes` (type: `string`):

No description

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

No description

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

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

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

```

## MCP server setup

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