# Telegram Channel Scraper — Export Posts, Views & Reach (`kaankaan2635/telegram-channel-scraper`) Actor

Export Telegram channel messages with view counts as real numbers, publishing cadence, media mix and views per subscriber.

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

## Pricing

from $5.00 / 1,000 channel scrapeds

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 — Export Posts, Views & Reach

This **Telegram channel scraper** exports messages from any public Telegram channel: every post with its **view count as a real number**, the date it went out, media flags, outbound links, and the one figure that actually measures a channel — **views per subscriber**.

No account, no API key, no phone number. It reads the same public channel preview anyone can open in a browser.

### Export Telegram channel messages and data

Give it a handle and it pages back through the archive, 20 posts per request, as far as you ask:

- **Telegram channel message export** — post text, publish date, permalink, word count
- **View counts** — as integers, not the `1.75M` string Telegram renders
- **Media flags** — photo, video, poll, document, and a media count per post
- **Forwards and replies** — including which channel a post was forwarded from
- **Outbound links** — every external URL a post points at

Output is JSON, CSV, Excel or XML through Apify's usual export, so it drops straight into a spreadsheet or a database.

### Telegram channel analytics: the number that decides a media buy

Subscriber count is the number channel owners quote. It is also the easiest number to inflate. What a buyer needs is how many people actually see a post:

| Channel | Subscribers | Avg views | Views per subscriber |
| --- | --- | --- | --- |
| Telegram News | 9,490,000 | 2,103,150 | 0.22 |
| Pavel Durov | 10,700,000 | 6,793,667 | 0.64 |

Two channels of almost identical size, a threefold difference in reach. This scraper computes that ratio for every channel you pass it, alongside median and maximum views, posting cadence, and the share of posts carrying media or links.

**Cadence is reported with its window.** `postsPerWeek` always travels with `measurementWindowDays`, so you can see what the rate is based on. Raise **Maximum posts per channel** to widen it.

### What you get

**Per channel:** `title` · `username` · `subscribers` · `description` · `photoUrl` · `isVerified` · `photosCount` · `videosCount` · `linksCount`

**Per channel summary:** `postsAnalysed` · `firstPostDate` · `lastPostDate` · `postsPerWeek` · `measurementWindowDays` · `avgViews` · `medianViews` · `maxViews` · `viewsPerSubscriber` · `forwardedPosts` · `postsWithMedia` · `postsWithLinks` · `avgTextLength`

**Per post:** `postId` · `url` · `text` · `publishedAt` · `views` · `viewsRaw` · `isForwarded` · `forwardedFrom` · `isReply` · `hasPhoto` · `hasVideo` · `hasPoll` · `hasDocument` · `mediaCount` · `outboundLinks` · `textLength`

### How to use this Telegram scraper

```json
{
  "channels": ["durov", "@telegram", "https://t.me/breakingmash"],
  "maxPostsPerChannel": 300,
  "postsOutput": "separate"
}
```

Handles, `@handles` and `t.me` links all work.

`postsOutput` controls the shape: **embedded** gives one row per channel with a `posts` array; **separate** gives one flat row per post plus a profile row per channel, which loads straight into a spreadsheet.

### FAQ

**Do I need a Telegram account or API key?**
No. This scraper reads the public channel preview at `t.me/s/<channel>`, which is served to anyone without logging in.

**Can it scrape private channels or groups?**
No. Private invite links (`t.me/+…`), group chats and user accounts are rejected before a request is made. Public channels only.

**Can it export channel members or subscribers?**
No, and it never will. Telegram does not expose member lists on this surface and this scraper does not attempt to reach them. Channels are broadcast media: it reads what a channel published, not who reads it.

**How far back can it go?**
As far as the channel's archive runs. Posts load 20 per request going backwards, so 1,000 posts is 50 requests.

**Why are view counts sometimes missing?**
Very recent posts occasionally render before Telegram attaches a view count. The raw string is kept in `viewsRaw` so you can see exactly what the page showed.

**Is scraping Telegram channels legal?**
This reads publicly published content without authentication. Telegram serves no robots.txt for `t.me`, so there is no crawl directive to breach, and the scraper caps its own request rate. How you use the output is your responsibility, including under GDPR where post content mentions people.

### Pricing

Pay per event: one charge per channel and one per post. Nothing is charged for compute time or failed requests.

### Development

```bash
npm install
npm test          # offline regression tests against a saved page
npm start         # local run; put an INPUT.json in storage/key_value_stores/default/
```

# Actor input Schema

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

Public channel handles or links — <code>durov</code>, <code>@telegram</code> or <code>https://t.me/telegram</code> all work. Private invite links (<code>t.me/+…</code>) are not supported and are skipped.

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

Posts load 20 per request, oldest-first paging back through the archive. More posts widen the window the cadence and reach figures are measured over.

## `postsOutput` (type: `string`):

<b>Embedded</b> gives one row per channel with a <code>posts</code> array. <b>Separate</b> gives one row per post plus a profile row per channel.

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

How many requests run in parallel. Lower this if pages start coming back empty.

## `maxRequestsPerMinute` (type: `integer`):

Caps the request rate against t.me.

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

Apify Proxy is recommended for larger runs.

## Actor input object example

```json
{
  "channels": [
    "telegram",
    "durov"
  ],
  "maxPostsPerChannel": 100,
  "postsOutput": "embedded",
  "maxConcurrency": 5,
  "maxRequestsPerMinute": 90,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per channel with its computed summary, or one row per post when separate output is selected.

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

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

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

```

## MCP server setup

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