# Telegram Channel Scraper — Posts, Views & Reactions (`celebrated-quadraphonic/telegram-channel-scraper`) Actor

Scrape public Telegram channels with pure HTTP — no login, bot token or proxy needed. Posts, views, reactions, media, hashtags, forwards and channel info. Minimal JSON output for AI agents, relative date filters, profile-only mode and historical backfill.

- **URL**: https://apify.com/celebrated-quadraphonic/telegram-channel-scraper.md
- **Developed by:** [XiaoZhi DataTools](https://apify.com/celebrated-quadraphonic) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 post 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 — Posts, Views, Reactions & Media (No Login)

Scrape **public Telegram channels** without a bot token, phone login, or API
credentials. The Actor reads Telegram's public web preview (`t.me/s/<channel>`)
over plain HTTP — **no headless browser and no residential proxies needed**.

Each run returns structured posts (text, views, reactions, media URLs,
forwards, hashtags, link previews) plus optional per-channel profile info.
A built-in **monitor mode** returns only posts that are new since the previous
run, making it ideal for scheduled channel tracking.

### Why this Actor

- **Zero credentials** — no bot token, no phone number, no `api_id`/`api_hash`.
- **Pure HTTP, no browser** — fast and cheap; the Telegram preview pages have
  very light rate limits, so datacenter IPs and even direct connections work.
- **Richer than the preview** — reactions with counts, paid star reactions,
  photo/video/document URLs, link previews, hashtags, mentions, forwarded-from
  attribution, channel counters (subscribers / photos / videos / links).
- **Monitor mode** — `newPostsOnly` keeps a persistent cursor per channel, so
  scheduled runs deliver only fresh posts (great with Apify Schedules +
  Webhooks).
- **Filters** — date range, minimum views, keyword match, media-only.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `channels` | string\[] | `["durov","telegram"]` | Channel usernames, `@handles`, or URLs (`t.me/durov`, `https://t.me/s/durov`). One per line. |
| `postUrls` | string\[] | — | Direct post URLs, e.g. `https://t.me/durov/528`, to fetch specific posts. |
| `maxPostsPerChannel` | integer | `50` | Max newest posts per channel (automatic `?before=` pagination). Up to 5000. |
| `startDate` / `endDate` | string | — | `YYYY-MM-DD` bounds on post publish date. `startDate` also accepts relative expressions: `7 days`, `2 weeks`, `1 month`, `24 hours`, `today`, `yesterday`. |
| `beforePostId` | integer | — | Start pagination from posts older than this post ID instead of the newest posts. Useful for historical backfill in chunks. |
| `profileOnly` | boolean | `false` | Only return channel profile info (title, description, subscribers, counters) and skip post history. Fast and cheap for channel discovery. |
| `outputFormat` | `full`/`minimal` | `full` | `minimal`: compact post records (id, url, date, text, views, media, link preview URL) — cheaper and easier to feed into AI agents. |
| `minViews` | integer | `0` | Drop posts with fewer views. |
| `textContains` | string | — | Case-insensitive keyword filter; separate alternatives with `\|` (e.g. `bitcoin\|ETF`). |
| `mediaOnly` | boolean | `false` | Only posts with photos, videos or documents. |
| `includeReactions` | boolean | `true` | Include reactions, reaction counts and paid stars. |
| `includeChannelInfo` | boolean | `true` | Emit a `channel_info` record per channel (title, description, subscribers, avatar, counters). |
| `newPostsOnly` | boolean | `false` | Monitor mode: only posts newer than the last run (cursor stored in a named key-value store). |
| `requestConcurrency` | integer | `5` | Channels scraped in parallel. |
| `proxyConfiguration` | object | off | Optional Apify Proxy. Not needed for typical runs. |

### Output

Dataset items have `recordType: "post"` (or `"channel_info"`). Example post:

```json
{
  "recordType": "post",
  "channelUsername": "durov",
  "postId": 528,
  "postUrl": "https://t.me/durov/528",
  "publishedAt": "2026-06-15T18:58:13+00:00",
  "postText": "The UK government wants to ban social media…",
  "views": 18900000,
  "repliesCount": 12400,
  "reactions": [{"emojiId": "5265077361648368841", "count": 132000}],
  "reactionsCount": 218766,
  "paidStars": 14300,
  "mediaType": "video",
  "mediaUrls": ["https://cdn1.telesco.pe/file/….mp4?token=…"],
  "linkPreview": {"url": "https://telegram.org/safety", "siteName": "Telegram",
                  "title": "Telegram Safety Overview", "description": "…"},
  "links": ["https://telegram.org/safety"],
  "hashtags": ["news"],
  "mentions": ["durov"],
  "forwardedFrom": {"url": "https://t.me/other", "name": "Other channel"},
  "isPinned": false
}
```

Notes:

- `views`/`subscribers` are parsed from Telegram's compact notation
  (`18.9M` → `18900000`).
- Media URLs are served by Telegram's CDN with **time-limited tokens** —
  download promptly if you need the files.
- Reaction `emojiId`s are Telegram's internal custom-emoji identifiers.
- Private channels, deleted channels, and channels without a public preview
  are skipped with a warning (no public `t.me/s/` page exists for them).

### Use cases

- **News & OSINT monitoring** — track announcements across channels on a schedule.
- **Market research** — engagement (views/reactions) per post, hashtag trends.
- **Content pipelines** — feed channel posts into AI summarizers, newsletters,
  or RAG datasets (pair with `newPostsOnly` + Webhooks, or `outputFormat:
  minimal` for compact AI-ready records).
- **Lead discovery** — mentions, links and forwarded-from attribution.
- **Channel discovery** — `profileOnly` returns just the profile metadata
  (subscribers, counters) for many channels at minimal cost.

### Cost

The Actor itself performs only lightweight HTTP requests. If you publish it
with pay-per-event pricing, a natural model is **pay per post scraped**
(e.g. via the `apify-default-dataset-item` charge event), with channel-info
records free or cheap. No third-party API costs are incurred.

### Limitations

- Only **public** channels with a web preview (`t.me/s/<name>` resolves) can be
  scraped; private/invite-only channels are not accessible without login.
- The preview shows the most recent history; very old posts may require many
  paginated requests.
- Comments/replies content is not part of the preview page (only counts when
  shown).

### Changelog

- **0.5** — `maxPostsPerChannel` now truly keeps the newest posts (previously
  the oldest posts on the first page were kept when the limit was hit
  mid-page); `endDate` given as `YYYY-MM-DD` now covers the whole day
  (previously posts published later that day were wrongly excluded);
  `postUrls` for older posts now resolve via the single-post embed page
  (previously only posts on the latest preview page could be fetched);
  `includeReactions: false` now strips `reactionsCount`/`paidStars` too
  in `postUrls` mode, matching channel mode.
- **0.4** — Previous release.

# Actor input Schema

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

Channel usernames, @handles, or URLs (t.me/durov, https://t.me/s/durov). One per line.

## `endDate` (type: `string`):

Only posts published on or before this date (YYYY-MM-DD). Leave empty for no upper bound.

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

Add a channel\_info record per channel (title, description, subscriber count, avatar).

## `includeReactions` (type: `boolean`):

Include per-post reactions (emoji counts) and paid star reactions.

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

Maximum number of newest posts to fetch per channel (pagination is automatic).

## `mediaOnly` (type: `boolean`):

Only return posts that contain photos, videos or documents.

## `minViews` (type: `integer`):

Skip posts with fewer views than this. 0 = no minimum.

## `newPostsOnly` (type: `boolean`):

Monitor mode: only return posts newer than the previous run (state kept in a named key-value store). Ideal for scheduled runs.

## `postUrls` (type: `array`):

Direct post URLs (https://t.me/durov/528). Useful for fetching specific posts.

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

Optional. The Telegram web preview has very light rate limits, so proxies are not needed for typical runs.

## `requestConcurrency` (type: `integer`):

How many channels to scrape in parallel.

## `startDate` (type: `string`):

Only posts published on or after this date (YYYY-MM-DD). Leave empty for no lower bound.

## `textContains` (type: `string`):

Case-insensitive keyword filter on post text. Separate alternatives with |, e.g. bitcoin|ETF. Leave empty to keep all posts.

## `outputFormat` (type: `string`):

Full: every extracted field per post. Minimal: compact post records (id, url, date, text, views, media, link preview URL) — cheaper and easier to feed into AI agents.

## `profileOnly` (type: `boolean`):

Only return channel profile info (title, description, subscribers, counters) and skip post history. Fast and cheap for channel discovery.

## `beforePostId` (type: `integer`):

Start pagination from posts older than this post ID instead of the newest posts. Useful for historical backfill in chunks.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "includeChannelInfo": true,
  "includeReactions": true,
  "maxPostsPerChannel": 50,
  "mediaOnly": false,
  "minViews": 0,
  "newPostsOnly": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "requestConcurrency": 5,
  "outputFormat": "full",
  "profileOnly": false
}
```

# Actor output Schema

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,celebrated-quadraphonic/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/5QysjPAfwzFXxZJOJ/builds/8UWBKPWTgv09LRMFa/openapi.json
