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

Scrape any public Telegram channel: post text, publish date, view counts, photo/video flags, forward and reply markers, and a direct link. One row per post, pages past the 20 a page shows, bulk channels. No API key or login. $0.01 per post.

- **URL**: https://apify.com/eliai/telegram-channel-scraper.md
- **Developed by:** [Broke to Built](https://apify.com/eliai) (community)
- **Categories:** Social media, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 posts 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Telegram Channel Scraper — Public Posts, Views & Media

Read any **public Telegram channel** and get **one row per post**: the text, the publish date, the
view count as a real number, photo/video flags, forward and reply markers, and a direct link.

No API key, no bot token, no phone number, no login. **$0.01 per post** — a channel with no public
posts is recorded and **not charged**.

### Input

```json
{ "channel": "durov", "maxPosts": 50 }
```

Bulk:

```json
{ "channels": ["durov", "telegram", "durov"], "maxPosts": 100 }
```

| Field | Type | Notes |
|---|---|---|
| `channel` | string | Accepts `durov`, `@durov`, `t.me/durov` or `https://t.me/s/durov`. |
| `channels` | string\[] | Up to 10 channels per run. |
| `maxPosts` | integer | 1–300 per channel, default 20. **You are charged per post returned.** |

### Output

One row per post:

```json
{
  "ok": true,
  "channel": "durov",
  "postId": 547,
  "url": "https://t.me/durov/547",
  "text": "💸 In just one month, Telegram has awarded over $2,222,000 …",
  "publishedAt": "2026-09-06T17:40:39+00:00",
  "views": 1070000,
  "viewsLabel": "1.07M",
  "hasPhoto": false,
  "photoUrl": null,
  "hasVideo": false,
  "isForwarded": false,
  "forwardedFrom": null,
  "isReply": false
}
```

### What it gets right

- **View counts are numbers.** Telegram writes `"1.07M"` for humans; that is unsortable and
  unfilterable, so you get `views: 1070000` **and** the original `viewsLabel`. The multiplier is
  applied, so `1.07M` never arrives as `1.07`.
- **It pages past 20.** One Telegram preview page holds 20 posts; asking for more walks backwards
  with `?before=`, de-duplicates by post id, and stops if a page repeats — so a pager that spun
  could never bill you twice for the same post.
- **Emoji are not photos.** Telegram renders emoji as background images from the same CSS property
  real photos use. Counting those naively marks every text post as having a photo; emoji URLs are
  excluded, so `hasPhoto` means an actual image.
- **Text is text.** HTML tags are stripped, `<br>` becomes a newline, and entities are decoded in
  the correct order so `&amp;quot;` ends up as `"` and not `&quot;`.
- **Posts come back newest first**, and never more than `maxPosts` — the number you are billed on.
- **It cannot hang.** Paging is bounded by a page budget as well as by `maxPosts`. An unbounded
  loop would run to the platform kill and be recorded as a store-visible TIMED-OUT failure.

### Pricing

**$0.01 per post returned.** No start fee. A private, empty or non-existent channel produces an
`ok: false` record explaining which, and **is not charged**.

Set `maxPosts` to control spend: 20 posts across 3 channels is 60 rows, $0.60.

### Limits

- **Public channels only.** Private channels and group chats have no public preview and cannot be
  read by anything without an account — this returns an honest error rather than an empty page.
- 10 channels per run, up to 300 posts each.
- Reads the channel's public web preview, so it sees what a logged-out visitor sees: no member
  lists, no reactions breakdown, no comment threads.
- `photoUrl` is Telegram's own CDN link and expires; download it if you need to keep it.

### FAQ

**Do I need a bot token or phone number?** No. Neither.

**Can it read private channels or groups?** No — nothing can, without an account.

**Why are some posts missing text?** Media-only posts genuinely have none; `text` is an empty
string and `hasPhoto` / `hasVideo` tell you what it was.

**Is there a comments/replies feed?** `isReply` flags a reply, but the discussion thread lives in a
linked group that has no public preview.

### Changelog

- **0.1 (2026-09-10)** — first release. One row per post, numeric view counts, backwards paging,
  media/forward/reply flags, bulk channels.

# Actor input Schema

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

A public Telegram channel. Accepts durov, @durov, t.me/durov or https://t.me/s/durov.

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

Several public channels in one run. Up to 10.

## `maxPosts` (type: `integer`):

Telegram shows 20 per page; more than that pages backwards. You are charged per post returned.

## Actor input object example

```json
{
  "channel": "durov",
  "channels": [],
  "maxPosts": 20
}
```

# Actor output Schema

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

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

# 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 = {
    "channel": "durov",
    "channels": []
};

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

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

```

## MCP server setup

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