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

Scrape public Telegram channels: posts with text, date, view count, photos and video flags, forwards and link previews, plus channel title and subscriber count. Paginates full history. For social monitoring, crypto/news tracking and research. Only public channels. Not affiliated with Telegram.

- **URL**: https://apify.com/haketa/telegram-channel-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Social media, News
- **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.
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 — Posts, Views & Media

> **Scrape posts from any public Telegram channel: text, date, view count, photos and video, forwards and link previews — plus the channel's title and subscriber count.** Paginates back through history. Clean JSON/CSV/Excel in seconds. Built for social monitoring, crypto/news tracking, sentiment and research.

[![Telegram](https://img.shields.io/badge/Telegram-Public%20Channels-29a9eb)]()
[![Posts + Views](https://img.shields.io/badge/Posts%20%2B%20Views%20%2B%20Media-2da44e)]()
[![Monitoring](https://img.shields.io/badge/Monitoring%20%2F%20Research-8250df)]()
[![Export](https://img.shields.io/badge/Export-JSON%20%2F%20CSV%20%2F%20Excel-fb8500)]()

***

### What This Actor Does

Give it public channel usernames and it returns every post as a clean record:

- **Post** — text, post ID, URL, date/time
- **Reach** — view count (formatted and numeric)
- **Media** — photo URLs, has-photo / has-video flags
- **Context** — forwarded-from source, link-preview URL
- **Channel** — title and subscriber count

It paginates back through the channel's history (≈20 posts per page) up to your limits.

***

### Why Use This

- **Monitor channels at scale.** Track posts, reach and media across many channels on a schedule.
- **Crypto & news intelligence.** Telegram is where crypto calls, announcements and news break first.
- **Sentiment & trend research.** Collect post text + view counts for analysis and dashboards.
- **No key, no login.** Reads Telegram's public web preview — no API token, no anti-bot, no browser.

***

### Quick Start

#### Run it in the console (no code)

1. Add one or more **public channel usernames** (e.g. `durov`, `telegram`).
2. Set **Max posts** (and per-channel caps if you like).
3. Click **Start**, export as **JSON, CSV, Excel or HTML**.

#### Pull a channel's posts (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("YOUR_USERNAME/telegram-channel-scraper").call(run_input={
    "channels": ["durov", "telegram"], "maxItems": 1000,
})
for p in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(p["date"], "·", p["viewsCount"], "views ·", p["text"][:80])
```

***

### Input Parameters

| Field | Type | Description |
|---|---|---|
| `channels` | array | Public channel usernames (accepts `@name`, `t.me/name` or URLs). |
| `maxItems` | integer | Max posts across all channels. `0` = no limit. |
| `maxPostsPerChannel` | integer | Cap posts per channel. |
| `maxPagesPerChannel` | integer | Pagination cap per channel (~20 posts/page). |
| `proxyConfiguration` | object | Apify Proxy. Datacenter is enough (public preview). |

***

### Output

```json
{
  "channel": "durov", "channelTitle": "Pavel Durov", "channelSubscribers": 1300000,
  "id": 528, "messageId": "durov/528", "url": "https://t.me/durov/528",
  "text": "The UK government wants to ban social media for children under 16…",
  "date": "2026-06-15T18:58:13+00:00",
  "views": "18.9M", "viewsCount": 18900000,
  "photoUrls": ["https://cdn.../file/..."], "hasPhoto": true, "hasVideo": false,
  "isForwarded": false, "linkPreviewUrl": ""
}
```

***

### Use Cases

1. **Social & brand monitoring** — track what channels post and how far it reaches.
2. **Crypto signal & announcement tracking** — capture calls and news as structured rows.
3. **News & media research** — collect post text and engagement over time.
4. **Sentiment & trend analysis** — feed post text + views into analytics.

***

### Tips

- **`viewsCount`** is the numeric view count (e.g. `18900000`); `views` keeps Telegram's `18.9M` format.
- **`maxPagesPerChannel`** controls how far back in history you go.
- Pass **many channels** at once to build a monitoring feed.
- **Schedule it** with Apify Schedules to track channels continuously.

***

### Frequently Asked Questions

**Do I need an account or key?**
No. This reads Telegram's public web preview (`t.me/s/…`) — no login, API token or anti-bot.

**Can it scrape private channels or groups?**
No. Only **public** channels (those with a public web preview) are accessible. Private channels, groups and DMs are not.

**How far back can it go?**
It paginates through history via older-post links, up to your `maxPostsPerChannel` / `maxPagesPerChannel` limits.

**Does it get view counts and media?**
Yes — view counts, photo URLs and has-video flags are included per post.

**What export formats are supported?**
JSON, CSV, Excel, HTML, or via API — plus Google Sheets, webhooks, Make and Zapier.

***

### Legal & Responsible Use

This Actor is an independent tool and is **not affiliated with, endorsed by, or sponsored by Telegram.** It reads only public channel data. Use it responsibly and in line with applicable terms and data-protection laws.

# Actor input Schema

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

Public Telegram channel usernames (e.g. durov, telegram). Accepts @name, t.me/name or full URLs.

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

Maximum posts across all channels. 0 = no limit.

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

Cap posts collected per channel.

## `maxPagesPerChannel` (type: `integer`):

Pagination cap per channel (~20 posts per page, older posts via before=).

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

Apify Proxy. The preview is public — datacenter is enough and enabled by default.

## Actor input object example

```json
{
  "channels": [
    "durov"
  ],
  "maxItems": 200,
  "maxPostsPerChannel": 200,
  "maxPagesPerChannel": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `channel` (type: `string`):

Channel username

## `channelTitle` (type: `string`):

Channel display name

## `channelSubscribers` (type: `string`):

Subscriber count

## `id` (type: `string`):

Message ID

## `messageId` (type: `string`):

channel/ID

## `url` (type: `string`):

Post URL

## `text` (type: `string`):

Post text

## `date` (type: `string`):

Post datetime (ISO)

## `views` (type: `string`):

Views (formatted)

## `viewsCount` (type: `string`):

Views (number)

## `photoUrls` (type: `string`):

Photo URLs

## `hasPhoto` (type: `string`):

Has photo

## `hasVideo` (type: `string`):

Has video

## `isForwarded` (type: `string`):

Is forwarded

## `forwardedFrom` (type: `string`):

Forward source

## `linkPreviewUrl` (type: `string`):

Link preview URL

## `scrapedAt` (type: `string`):

ISO timestamp

# 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"
    ],
    "maxItems": 200,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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