# Telegram Channel Scraper - Public Messages, Views to JSON/CSV (`projecthax/telegram-public-channels`) Actor

Scrape messages from public Telegram channels without login or API keys: text, date, views, reactions, links, media and forwards, exported to JSON, CSV or Excel.

- **URL**: https://apify.com/projecthax/telegram-public-channels.md
- **Developed by:** [ProjectHax](https://apify.com/projecthax) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 - Public Messages, Views to JSON/CSV

Scrape messages from public Telegram channels without login, phone number or API keys: text, date, views, reactions, links, photos, videos, forwards and replies, exported to JSON, CSV or Excel.

### What does Telegram Channel Scraper do?

- Reads the public web preview of any open Telegram channel (`t.me/s/<channel>`) and saves one clean row per message: text, publish date, view count, reactions, links, hashtags, mentions, photos, videos, documents, polls, link previews, forwards and replies.
- No Telegram account, no phone number, no API ID or bot token. Nothing to log in to, nothing to get banned.
- Fast and cheap: plain HTTP, no browser. About 400 messages per channel per 30 seconds; many channels run in parallel.
- Filters: newest N messages, messages since a date, messages newer than an ID (incremental monitoring), or in-channel keyword search.
- Optional channel profile row: title, description, subscriber count, photo/video/link counters, verified badge, avatar.
- Exports to JSON, CSV, Excel, XML or via API, webhooks and integrations (Make, Zapier, n8n, LangChain, MCP).

Typical uses: brand and crypto monitoring, news and OSINT research, competitor channels, building datasets for LLM/RAG, tracking post reach (views) over time.

### How to use it

1. Click **Try for free** and add one or more channels: `durov`, `@telegram` or `https://t.me/bloomberg`.
2. Set **Max messages per channel** (default 100, 0 = everything the public preview serves). Optionally set **Oldest message date**, **Only messages newer than ID** or **Search within channels**.
3. Click **Start**, then download the dataset in the format you need.

Tip: paste a message link such as `https://t.me/durov/400` to start at that message and go back in time.

### Input

| Field | Type | Description |
|---|---|---|
| `channels` | array | Channel usernames or t.me links. Required. |
| `maxMessagesPerChannel` | integer | Newest messages per channel (default 100, 0 = all). |
| `oldestDate` | string | Only messages posted on or after this date (YYYY-MM-DD, UTC). |
| `minMessageId` | integer | Only messages with a higher ID (for incremental runs). |
| `searchQuery` | string | Keyword or hashtag, using Telegram's in-channel search. |
| `includeChannelInfo` | boolean | Add one channel profile row per channel (default true). |
| `maxResults` | integer | Total message limit for the run (0 = no limit). |
| `requestDelayMs` | integer | Pause between pages of one channel (default 500 ms). |
| `proxyConfiguration` | object | Optional Apify Proxy. Usually not needed. |

Example:

```json
{"channels": ["durov", "https://t.me/telegram"], "maxMessagesPerChannel": 200, "oldestDate": "2026-01-01"}
```

### Sample output

Message rows have `type: "message"`, profile rows `type: "channel"`, and channels that could not be read produce an uncharged `type: "error"` row.

```json
[
  {
    "type": "message",
    "channel": "bloomberg",
    "messageId": 3225,
    "url": "https://t.me/bloomberg/3225",
    "date": "2026-09-22T03:26:17+00:00",
    "edited": false,
    "author": null,
    "text": "Alibaba unveils new AI chip it says is China's most powerful and targets 20 gigawatts of data center capacity by 2032. https://bloom.bg/4ydroys\n\n📷: Qilai Shen/Bloomberg",
    "views": 67000,
    "reactions": [
      {
        "emoji": "❤",
        "count": 48
      },
      {
        "emoji": "🔥",
        "count": 40
      }
    ],
    "links": [
      "https://bloom.bg/4ydroys"
    ],
    "hashtags": [],
    "mentions": [],
    "linkPreview": null,
    "mediaTypes": [
      "photo"
    ],
    "photos": [
      "https://cdn5.telesco.pe/file/vm1KvEWUxCE3Jtc0KwM3iYgLWGJVC4g..."
    ],
    "videos": [],
    "documents": [],
    "audio": [],
    "poll": null,
    "forwardedFrom": null,
    "replyToMessageId": null,
    "channelTitle": "Bloomberg",
    "channelSubscribers": 186000,
    "searchQuery": null,
    "scrapedAt": "2026-11-09T15:00:00Z"
  },
  {
    "type": "channel",
    "channel": "bloomberg",
    "url": "https://t.me/bloomberg",
    "title": "Bloomberg",
    "verified": true,
    "description": "The first word in business news.",
    "subscribers": 186000,
    "photos": 800,
    "videos": 49,
    "files": null,
    "links": 3180,
    "avatarUrl": "https://cdn5.telesco.pe/file/habIlq7Qogc4NnfmGumhrhmRWCxsWXY...",
    "scrapedAt": "2026-11-09T15:00:00Z"
  }
]
```

`views`, `subscribers` and reaction counts are parsed from Telegram's rounded labels (`67K` becomes 67000). Media URLs point to Telegram's CDN and expire after a while; download them soon if you need the files.

### Pricing

**Currently free to use.** Pay per event pricing (below) is coming soon; the Actor stays free until it is switched on. Free Apify plan limits apply meanwhile.

This Actor uses **pay per event** pricing: you pay only for what you get, platform usage is included.

| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.005 | Once per run |
| Message | $0.0015 (= $1.50 per 1,000) | Per message saved to the dataset. Error rows are free. |
| Channel profile | $0.002 | Per channel profile row (only with `includeChannelInfo`). |

Example: 1,000 messages from 5 channels with profiles cost about $1.52. Set **Max total charge** on the run to cap your spend; the Actor stops cleanly when the limit is reached and never bills above it.

**Free Apify plan:** runs are capped at **20 messages** from the **first 3 channels**. Each capped row carries a `notice` field, and the run status says so. Any paid Apify plan removes the cap.

### FAQ

**Why did my run stop at 20 messages?**
You are on the free Apify plan, which is capped at 20 messages from up to 3 channels per run. Upgrade to any paid plan to remove the cap.

**Why did my run stop early?**
Either `maxResults`, a date/ID filter, or your run's **Max total charge** was reached, or the channel has no older messages. The status message says which.

**Which channels work?**
Public channels that show a web preview at `https://t.me/s/<name>`. Private channels, invite links (`t.me/+...`), most groups, users and bots have no public preview; they produce an error row and are not charged.

**Can I get all messages of a channel?**
Set **Max messages per channel** to 0. The Actor pages back through the public preview until the first message. Deleted messages are skipped.

**Can I monitor a channel for new posts?**
Yes. Schedule the Actor and pass the highest `messageId` from the previous run as **Only messages newer than ID**, so you only pay for new messages.

**Does it download comments?**
No. Comments live in a linked discussion group that has no public web preview.

**Is scraping Telegram legal?**
This Actor only reads public pages that Telegram serves to anyone without login. You are responsible for complying with Telegram's terms and with data-protection law (GDPR, CCPA) when you process personal data.

**Something broke or a field is missing?**
Open an issue on the Actor's **Issues** tab with the run ID. We usually reply within one business day.

### Changelog

- 0.1 (2026-11-09): first release.

# Actor input Schema

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

Public Telegram channels: usernames (durov, @durov) or links (https://t.me/durov, https://t.me/s/durov). A message link like https://t.me/durov/500 starts from message 500 and goes back in time. Only channels with a public web preview at t.me/s/<name> work; private channels, groups without a preview, users and bots are reported as error rows (not charged). Free Apify plan: first 3 channels only.

## `maxMessagesPerChannel` (type: `integer`):

Newest messages to save per channel (0 = all messages the public preview serves). Free Apify plan: capped at 20 messages per run.

## `oldestDate` (type: `string`):

Only save messages posted on or after this date (YYYY-MM-DD or ISO date-time, UTC). Leave empty for no date limit.

## `minMessageId` (type: `integer`):

Only save messages with an ID greater than this. Use it for incremental monitoring: pass the highest messageId from your previous run.

## `searchQuery` (type: `string`):

Optional keyword or hashtag. Uses Telegram's in-channel search, so only matching messages are saved (and charged).

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

Save one extra row per channel with its title, description, subscriber count, media counters and avatar (charged as one 'Channel profile' event). Every message row also carries channelTitle and channelSubscribers.

## `maxResults` (type: `integer`):

Stop after this many messages in total across all channels (0 = no limit). You never pay more than the 'Max total charge' you set for the run.

## `requestDelayMs` (type: `integer`):

Pause between page requests of the same channel, in milliseconds. Raise it if you see HTTP 429 retries in the log.

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

Optional Apify Proxy. Not needed for most runs; use it for very large scrapes if Telegram rate-limits you.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxMessagesPerChannel": 20,
  "includeChannelInfo": true,
  "maxResults": 0,
  "requestDelayMs": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per message (type=message: text, date, views, reactions, links, media, forwards, replies), one optional row per channel profile (type=channel) and uncharged error rows (type=error).

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

// Run the Actor and wait for it to finish
const run = await client.actor("projecthax/telegram-public-channels").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",
        "telegram",
    ],
    "maxMessagesPerChannel": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("projecthax/telegram-public-channels").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",
    "telegram"
  ],
  "maxMessagesPerChannel": 20
}' |
apify call projecthax/telegram-public-channels --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,projecthax/telegram-public-channels"
        }
    }
}
```

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/zf397PR5UTpTomYXm/builds/QpRNvuChb7mP1rinO/openapi.json
