# Telegram Channel Scraper (`anyxsolutions/telegram-channel-scraper`) Actor

Scrapes public Telegram channels: posts with text, media, views, reactions and link previews, plus channel stats — no login or API key required.

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

## Pricing

from $0.90 / 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?

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

![banner](<run ./scripts/banner.sh to generate>)

## Telegram Channel Scraper

**Turn any public Telegram channel into a clean dataset of posts, media, views, and reactions — no login, no API key.**

The Telegram Channel Scraper reads the public web preview of Telegram channels and extracts every post: text (plain and HTML), publish date, view count, reactions, images, videos, documents, polls, link previews, forwards and replies. It also captures the channel itself — title, description, photo, verified badge and subscriber count. Built for social-listening and OSINT teams, researchers, marketers, news monitors, and anyone tracking what a channel publishes without wiring up the Telegram API.

### ⚡ Quick start

```json
{
  "startUrls": [
    { "url": "https://t.me/s/telegram" },
    { "url": "https://t.me/telegram/435" }
  ],
  "channels": ["durov"],
  "maxItems": 5
}
```

### 🧩 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `startUrls` | array | one of `startUrls`/`channels` | — | Telegram URLs to scrape. A channel (`https://t.me/telegram` or `https://t.me/s/telegram`) returns the channel info plus its newest posts, walking back through older pages; a post (`https://t.me/telegram/435`) returns that single post. |
| `channels` | array | one of `startUrls`/`channels` | — | Channel usernames to scrape in addition to Start URLs, with or without `@`. |
| `maxItems` | integer | no | `5` | Maximum dataset items per start URL or channel. The channel-info row counts as one item when enabled. |
| `includeChannelInfo` | boolean | no | `true` | Push one `channel` item (title, description, photo, subscribers, media counters) before the channel's posts. |
| `proxyConfiguration` | object | no | `{ "useApifyProxy": false }` | Apify proxy settings. Telegram's public preview works without a proxy. |

Only channels with a public web preview can be scraped. Private channels, groups, and user accounts have no preview and are skipped with a warning.

### 📤 Output

The dataset mixes two item types, distinguished by `itemType`: one `channel` row per channel (when enabled), followed by its `post` rows, newest first.

#### Fields — `post`

| Field | Type | Description |
|---|---|---|
| `itemType` | string | Always `post`. |
| `id` | number | Message id inside the channel. |
| `url` | string | Public post URL, e.g. `https://t.me/telegram/435`. |
| `channelUsername` | string | Channel username without `@`. |
| `channelTitle` | string | null | Channel display name. |
| `channelUrl` | string | Channel URL. |
| `author` | string | null | Signed author name, when the channel shows post signatures. |
| `text` | string | null | Message text as plain text, line breaks preserved. |
| `textHtml` | string | null | Message text with Telegram's formatting (bold, links, emoji). |
| `date` | string | null | Publish time, ISO-8601 (UTC). |
| `views` | number | null | View count. |
| `reactions` | array | `{ emoji, emojiId, paid, count }` per reaction. `emoji` is the Unicode glyph; custom emoji expose `emojiId`; Telegram Stars reactions have `paid: true`. |
| `links` | string\[] | Outbound links found in the message text. |
| `images` | string\[] | Photo URLs. |
| `videos` | array | `{ url, thumbnail, duration }` per video. |
| `documents` | array | `{ title, extra }` per attached file. |
| `poll` | object | null | `{ question, options: [{ text, percent }] }`. |
| `linkPreview` | object | null | `{ url, siteName, title, description, image }` of the link preview card. |
| `forwardedFrom` | object | null | `{ name, url }` of the original channel for forwarded posts. |
| `replyTo` | object | null | `{ url, author, text }` of the quoted post for replies. |

#### Fields — `channel`

| Field | Type | Description |
|---|---|---|
| `itemType` | string | Always `channel`. |
| `username` | string | Channel username without `@`. |
| `url` | string | Channel URL. |
| `title` | string | null | Channel display name. |
| `description` | string | null | Channel description. |
| `photo` | string | null | Channel photo URL. |
| `verified` | boolean | Whether the channel carries Telegram's verified badge. |
| `subscribers` | number | null | Subscriber count. |
| `photos` | number | null | Number of photos posted. |
| `videos` | number | null | Number of videos posted. |
| `files` | number | null | Number of files posted. |
| `links` | number | null | Number of links posted. |

<details><summary>Example output</summary>

```json
{
  "itemType": "post",
  "id": 524,
  "url": "https://t.me/durov/524",
  "channelUsername": "durov",
  "channelTitle": "Pavel Durov",
  "channelUrl": "https://t.me/durov",
  "author": "Pavel Durov",
  "text": "Telegram now has over 1 billion monthly active users…",
  "textHtml": "Telegram now has over <b>1 billion</b> monthly active users…",
  "date": "2026-06-11T17:54:31+00:00",
  "views": 14700000,
  "reactions": [
    { "emoji": null, "emojiId": null, "paid": true, "count": 5460 },
    { "emoji": null, "emojiId": "5465587407350942612", "paid": false, "count": 38500 }
  ],
  "links": ["https://telegram.org/blog"],
  "images": ["https://cdn4.telesco.pe/file/....jpg"],
  "videos": [],
  "documents": [],
  "poll": null,
  "linkPreview": {
    "url": "https://telegram.org/blog",
    "siteName": "Telegram",
    "title": "Telegram Blog",
    "description": "Latest news and features.",
    "image": "https://cdn4.telesco.pe/file/....jpg"
  },
  "forwardedFrom": null,
  "replyTo": null
}
```

</details>

### 💡 Use cases

- **Social listening & brand monitoring** — track what channels in your niche publish and how audiences react.
- **News and OSINT monitoring** — archive breaking-news, government, and community channels with timestamps and view counts.
- **Content research** — find the best-performing post formats in a vertical by views and reactions.
- **Lead and partner discovery** — pull subscriber counts and descriptions for channel prospecting.
- **Datasets for analysis** — feed post text and engagement into sentiment, trend, or ML pipelines.

### ❓ FAQ

- **Do I need a Telegram account or API key?** No. The scraper reads the public web preview that Telegram serves for every public channel.
- **Why does a channel return no posts?** Only channels with a public preview are supported. Private channels, groups, bots and personal accounts have no preview and are skipped with a warning in the log.
- **How far back can it go?** As far as the channel history reaches — set `maxItems` to control how many pages of 20 posts are walked.
- **Are comments included?** No. Comments live in a separate discussion group and are not part of the channel preview.
- **Can I scrape a single post?** Yes — pass `https://t.me/<channel>/<postId>` as a start URL.
- **Do I need a proxy?** Not usually. If you see empty pages under heavy usage, enable Apify Proxy in `proxyConfiguration`.

### 🔗 More scrapers by Anyx

- [Bluesky Scraper](https://apify.com/anyxsolutions/bluesky-scraper)
- [Threads Scraper](https://apify.com/anyxsolutions/threads-scraper)
- [X (Twitter) Scraper](https://apify.com/anyxsolutions/x-twitter-scraper)
- [Reddit Scraper](https://apify.com/anyxsolutions/reddit-scraper)
- [Facebook Posts Scraper](https://apify.com/anyxsolutions/facebook-posts-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

# Actor input Schema

## `startUrls` (type: `array`):

Telegram channel or post URLs. Supported: `https://t.me/<channel>`, `https://t.me/s/<channel>` (newest posts, paginated) and `https://t.me/<channel>/<postId>` (a single post).

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

Channel usernames to scrape in addition to Start URLs, one per line, with or without the leading `@` (e.g. `durov`).

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

Maximum number of dataset items per start URL or channel. The channel-info row counts as one item when enabled. Telegram serves 20 posts per page, so the run walks back through older pages until this limit is reached.

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

Push one `channel` item per channel with title, description, photo, verified flag and subscriber/media counters before its posts.

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

Apify proxy settings used for the run. Telegram's public preview works without a proxy.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://t.me/s/telegram"
    }
  ],
  "channels": [
    "durov"
  ],
  "maxItems": 5,
  "includeChannelInfo": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://t.me/s/telegram"
        }
    ],
    "channels": [
        "durov"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/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 = {
    "startUrls": [{ "url": "https://t.me/s/telegram" }],
    "channels": ["durov"],
}

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

```

## MCP server setup

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