# Telegram Channel Scraper: Posts, Views, Media, Subscribers (`zhtech/telegram-channel-scraper`) Actor

Scrape public Telegram channels without login: posts with text, views, reactions, photo and video URLs, links, hashtags, forwards and replies, plus channel info with exact subscriber counts. Date range, keyword and media filters.

- **URL**: https://apify.com/zhtech/telegram-channel-scraper.md
- **Developed by:** [ZH Tech](https://apify.com/zhtech) (community)
- **Categories:** Social media, News, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 posts

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, reactions, media and subscribers

Scrape **public Telegram channels** without a Telegram account: every post with its **text, date, views, reactions, photo and video URLs, links, hashtags, mentions, forwards and replies**, plus a **channel info row** with title, description, photo, verified badge and the **exact subscriber count**. Filter by **date range, keywords, media type** or **post ID** for scheduled monitoring.

No login, no phone number, no API key, no bot token. The actor reads the same public web preview anyone can open in a browser at `t.me/s/<channel>`. The default run takes a few seconds and you only pay for rows you get.

### What can this Telegram scraper do?

| You give it | You get |
|---|---|
| Channel usernames or links (`durov`, `@durov`, `https://t.me/durov`, `https://t.me/s/durov`, a post link) | One row per post, newest first, paginated back through the channel history until your limit, your oldest date or the first post |
| The same channels | One channel row each: title, username, description and the links in it, photo, verified, scam and fake labels, subscribers (exact, for example 9,921,131 instead of 9.92M), photo, video, link and file counters, latest post ID and date |
| Keywords | Only posts that mention at least one keyword, either by reading the history or by using the channel's own search box to jump straight to matching posts |
| A date window, a media type, a last seen post ID | Only posts inside the window, with that media, or newer than your previous run |

Fields on every post row: `channelUsername`, `channelTitle`, `postId`, `url`, `date` (ISO 8601, UTC), `isEdited`, `text` (line breaks and emoji kept), `views`, `viewsText`, `authorSignature`, `isForwarded`, `forwardedFromName`, `forwardedFromUrl`, `replyToPostId`, `replyToUrl`, `replyToAuthor`, `replyToText`, `viaBot`, `links`, `hashtags`, `mentions`, `mediaType`, `mediaTypes`, `mediaCount`, `photoUrls`, `videoThumbnailUrls`, `videoUrls`, `videoDurations`, `mediaUrls`, `documents`, `voice`, `sticker`, `poll`, `location`, `linkPreview`, `reactions`, `totalReactions`, `buttons`, `matchedKeywords`, `scrapedAt`.

### Why this actor

- **No account, nothing to break.** Many Telegram actors log in with a session string or phone number (MTProto). Those fail with `AUTH_KEY_DUPLICATED`, `AUTH_KEY_UNREGISTERED`, flood waits and session locks, and they put your account at risk. This actor uses only the public web preview, so there is no session to expire.
- **Clear answers for channels that cannot be read.** A nonexistent username, a channel whose owner turned off the web preview, a group, a bot or a personal account each get their own error code and plain message (and, where Telegram shows it, the title and subscriber count). Error rows are never charged.
- **Exact subscriber counts.** The preview rounds (9.92M). The actor reads the exact number from the public channel page, 1 extra page load per channel, and marks it with `subscribersExact`.
- **Filters that save money.** Posts outside your date window, without your keywords, with an excluded word, of the wrong media type or forwarded (if you turn forwarded posts off) are skipped and not charged. The keyword filter is checked against the real post text, so you do not pay for loose search matches.
- **Fast keyword search.** With "Use Telegram channel search" on, the actor uses the channel's own search (`t.me/s/channel?q=word`) to find matches anywhere in the history in a couple of page loads, instead of reading thousands of posts.
- **Built for monitoring.** Each channel row carries `latestPostId`. Put it into **Only posts newer than post ID** on your next scheduled run and you get only the new posts.
- **Polite and reliable.** About one page per second, retries with backoff on temporary errors, robots.txt checked at the start of every run, no proxy needed for normal use.
- **Fair billing.** Duplicates (the same channel listed twice in different formats) are saved and charged once. Invalid input stops the run before the start fee.

### Use cases

- **Media monitoring and PR**: follow news, brand and competitor channels, collect posts that mention your brand.
- **Crypto and finance research**: track project announcements, airdrop and listing news, measure reach with views and reactions.
- **OSINT and academic research**: archive public channels with dates, forwards and reply chains for analysis.
- **Marketing and influencer vetting**: compare channels by exact subscribers, views per post and reaction counts before buying an ad.
- **AI and RAG pipelines**: feed clean post text with dates and links into LLMs, vector databases or summarizers.
- **Alerts**: schedule a run every hour with a keyword list and send new matches to Slack, email or a webhook.

### How to use

1. Add one or more public channels in **Channels**.
2. Set **Max posts per channel** (newest first). Optionally set an **Oldest post date** such as `7 days` or `2026-01-01`.
3. Optionally add **Keywords**, **Exclude keywords** or a **media type** filter.
4. Click **Start**. Results appear in the **Posts**, **Channels** and **Errors** tabs and can be exported as JSON, CSV, Excel or XML.

### Input examples

The prefilled example: the 10 latest posts of two channels plus their channel rows.

```json
{
    "channels": ["durov", "telegram"],
    "maxPostsPerChannel": 10
}
```

Everything a channel posted in the last 7 days:

```json
{
    "channels": ["https://t.me/durov", "@telegram"],
    "maxPostsPerChannel": 1000,
    "oldestDate": "7 days"
}
```

Find every post about wallets or stories in the whole history, using the channel search:

```json
{
    "channels": ["durov", "telegram"],
    "maxPostsPerChannel": 200,
    "keywords": ["wallet", "stories"],
    "useTelegramSearch": true
}
```

Only original video posts, whole word keyword match, excluding giveaways:

```json
{
    "channels": ["nytimes"],
    "maxPostsPerChannel": 50,
    "mediaTypes": ["video", "album"],
    "includeForwarded": false,
    "keywords": ["election"],
    "keywordMatch": "wholeWord",
    "excludeKeywords": ["giveaway"]
}
```

Scheduled monitoring, only posts newer than last time:

```json
{
    "channels": ["durov"],
    "maxPostsPerChannel": 500,
    "minPostId": 560
}
```

Channel info only (subscribers, description, counters), no posts:

```json
{
    "channels": ["durov", "telegram", "tginfo"],
    "maxPostsPerChannel": 0
}
```

### Output examples

A post row (shortened URLs):

```json
{
    "type": "post",
    "input": "durov",
    "channelTitle": "Pavel Durov",
    "channelUsername": "durov",
    "postId": 519,
    "url": "https://t.me/durov/519",
    "date": "2026-05-20T15:38:10.000Z",
    "isEdited": false,
    "text": "Your Telegram inbox can now run itself.\n\nAssign a bot to read and reply for you ...",
    "views": 8980000,
    "viewsText": "8.98M",
    "authorSignature": "Pavel Durov",
    "isForwarded": false,
    "forwardedFromName": null,
    "forwardedFromUrl": null,
    "replyToPostId": null,
    "links": ["https://core.telegram.org/bots/features#secretary-bots"],
    "hashtags": [],
    "mentions": [],
    "mediaType": "video",
    "mediaTypes": ["video"],
    "mediaCount": 1,
    "photoUrls": [],
    "videoThumbnailUrls": ["https://cdn4.telesco.pe/file/lnURDRy...jpg"],
    "videoUrls": ["https://cdn4.telesco.pe/file/e174be993b.mp4?token=KVB4Q..."],
    "videoDurations": [9],
    "mediaUrls": ["https://cdn4.telesco.pe/file/e174be993b.mp4?token=KVB4Q..."],
    "linkPreview": null,
    "reactions": [
        { "emoji": "⭐", "emojiId": null, "isPaid": true, "isCustom": false, "count": 2580, "countText": "2.58K" },
        { "emoji": null, "emojiId": "5265077361648368841", "isPaid": false, "isCustom": true, "count": 23700, "countText": "23.7K" }
    ],
    "totalReactions": 40819,
    "buttons": [],
    "matchedKeywords": [],
    "scrapedAt": "2026-11-21T06:16:01.491Z"
}
```

A channel row:

```json
{
    "type": "channel",
    "input": "durov",
    "username": "durov",
    "url": "https://t.me/durov",
    "previewUrl": "https://t.me/s/durov",
    "title": "Pavel Durov",
    "description": "Founder of Telegram.",
    "descriptionLinks": [],
    "photoUrl": "https://cdn4.telesco.pe/file/A6TZDWJ...jpg",
    "verified": true,
    "labels": ["verified"],
    "subscribers": 9921024,
    "subscribersText": "9.92M",
    "subscribersExact": true,
    "photosCount": 106,
    "videosCount": 46,
    "linksCount": 203,
    "filesCount": null,
    "latestPostId": 567,
    "latestPostDate": "2026-11-20T20:47:30.000Z"
}
```

An error row (never charged):

```json
{
    "type": "error",
    "input": "BotFather",
    "channelUsername": "BotFather",
    "errorCode": "NOT_A_CHANNEL",
    "error": "\"BotFather\" is a bot, not a channel.",
    "entityType": "bot",
    "title": "BotFather",
    "profileUrl": "https://t.me/BotFather"
}
```

Error codes: `NOT_FOUND` (no public channel with that username), `PREVIEW_DISABLED` (public channel whose owner turned off the web preview), `NOT_A_CHANNEL` (group, bot or personal account), `PRIVATE` (invite link or t.me/c link), `INVALID_INPUT`, `RATE_LIMITED`, `BLOCKED`, `PARSE_FAILED`, `FAILED`.

### Field notes

- **Views** are numbers converted from what Telegram shows (`4.94M` becomes 4940000), so large values are rounded the same way Telegram rounds them. The original text is kept in `viewsText`.
- **Reactions**: standard emoji come as the emoji character. Custom (premium) emoji reactions have no character in the preview, so they come with `emojiId` and `isCustom: true`. Paid star reactions have `isPaid: true`.
- **Media**: `photoUrls` are full size image links, `videoThumbnailUrls` the video cover images. `videoUrls` are direct MP4 links when the preview can play the video (short and medium videos); they are signed and expire after a while, so download them soon if you need the files. Long videos are marked with `videoPlayableInPreview: false` and still have their thumbnail. Albums have `mediaType: "album"` with every photo in `photoUrls`.
- **Forwarded from**: some channels hide the original author; then `isForwarded` is true and the name is null.
- **Text** keeps line breaks and emoji. Links inside the text, the link preview card and inline buttons are collected in `links`.
- **Service messages** (such as "channel photo updated") are skipped and not charged.

### Pricing

Pay per event, you only pay for what is delivered:

- **Actor start**: a small flat fee once per run.
- **Post**: per post row.
- **Channel**: per channel info row (only when "Add a channel info row" is on).

The current prices are on the Pricing tab. Never charged: error rows (not found, preview disabled, not a channel, invalid input), posts skipped by your filters, duplicates, service messages, and anything after your max total charge or Max results is reached. Input with no valid channel stops the run before the start fee.

Typical runs: the prefilled example is 1 start, 2 channel rows and 20 posts. A week of posts from 10 news channels that post 20 times a day is about 1,400 posts.

### Use with the API, integrations and AI agents

- **API**: `POST https://api.apify.com/v2/acts/zhtech~telegram-channel-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN` with the JSON input as the body returns the rows in one call. Add `&view=posts` (or `channels`, `errors`) for one row type.
- **Clients**: `apify-client` for JavaScript and Python. Example (JavaScript): `await client.actor('zhtech/telegram-channel-scraper').call({ channels: ['durov'], maxPostsPerChannel: 50, oldestDate: '7 days' })`.
- **Schedules and integrations**: run it hourly or daily with **Only posts newer than post ID** or **Oldest post date** and connect Google Sheets, Slack, a webhook, Zapier, Make or n8n.
- **LLMs and MCP**: the actor works as a tool through the Apify MCP server (mcp.apify.com), so Claude, ChatGPT, Cursor and other agents can read the latest posts of a channel or search a channel for a topic on demand. Set a max total charge on the run to cap the cost.

### FAQ

**Do I need a Telegram account, phone number or API key?**
No. The actor reads the public web preview at `t.me/s/<channel>` that Telegram offers to everyone without login.

**Which channels work?**
Public channels with a username and the web preview turned on (the default for public channels). You can check any channel by opening `https://t.me/s/<username>` in a browser: if you see posts there, the actor can read them.

**Why did my channel return PREVIEW_DISABLED, NOT_A_CHANNEL or NOT_FOUND?**
Channel owners can turn off the web preview; then posts are only visible inside the Telegram app after login, which this actor does not do. Groups, bots and personal accounts have no public post feed. NOT_FOUND means the username does not exist, was renamed, or belongs to a private chat. These rows are free.

**Can it scrape private channels, groups, members or comments?**
No. All of these need a logged in Telegram account. The actor only reads what Telegram publishes without login.

**How far back can it go?**
As far as the channel's history goes. The preview shows about 20 posts per page and the actor pages back with `?before=`. Use **Oldest post date** or **Max posts per channel** to stop earlier. **Max pages to read per channel** (50 pages, about 1,000 posts, by default) caps reading when strict filters skip most posts; raise it for full archives.

**Contains or whole word matching?**
Contains (default) matches a keyword inside longer words, so `wallet` also finds `wallets`. Whole word only matches complete words or phrases, so `TON` does not match `button`. Matching is case insensitive and works in any language.

**Is Telegram channel search better than the normal keyword filter?**
For rare words or matches deep in the history, yes: it jumps straight to matching posts. Telegram's search matches word forms its own way, so the actor double checks every result against your keyword and only saves (and charges) real matches. For "recent posts that mention X", the normal filter with an oldest date is simplest.

**Are the numbers exact?**
Subscribers are exact when **Exact subscriber count** is on. Views and reaction counts are what Telegram displays (rounded above 1,000), converted to numbers.

**Is it legal to scrape Telegram?**
The actor reads only public pages that Telegram serves to anyone without login, at a slow and polite rate, and t.me/robots.txt is checked on every run. You are responsible for how you use the data, especially any personal data, and for following the laws that apply to you. Do not use it for spam.

### Limitations

- Only public channels with the web preview turned on. No private channels, groups, members, comments or login only content.
- Views and reaction counts are rounded by Telegram above 1,000.
- Video MP4 links are signed and expire; very long videos have only a thumbnail in the preview.
- Custom emoji reactions come as IDs, not characters.
- The web preview has no official API. Parsing uses stable page anchors and is covered by unit tests; if Telegram changes the page so that nothing can be read, the run reports a `PARSE_FAILED` error row. If you spot a wrong or missing field, please open an issue.

### Support

Found a wrong field, a channel that does not parse, or need another data point? Open an issue on the Issues tab with the input you used and it will be looked at quickly.

# Actor input Schema

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

Public Telegram channels, one per line: a username (durov), @username, or a link (https://t.me/durov, https://t.me/s/durov, or any post link like https://t.me/durov/123). Private invite links (t.me/+...) and personal accounts cannot be read without a login and return an error row that is not charged.

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

Newest posts first. The run stops for a channel when this many posts are saved, when the oldest date is reached, or when the channel history ends. Set 0 to save only the channel info rows.

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

One extra row per channel with title, username, description, subscriber count, photo, verified flag and the photo, video, link and file counters.

## `exactSubscriberCount` (type: `boolean`):

Reads the exact number (for example 9921131 instead of 9.92M) from the channel's public t.me page, 1 extra page load per channel. Only used with the channel info row.

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

Stop when posts get older than this. YYYY-MM-DD (UTC), a full ISO timestamp, or a relative value such as 24 hours, 7 days, 2 weeks, 3 months. Leave empty for no date limit.

## `newestDate` (type: `string`):

Skip posts newer than this (they are not saved or charged). Same formats as above; a plain date includes the whole UTC day. Leave empty to start from the latest post.

## `minPostId` (type: `integer`):

For scheduled monitoring: stop at this post ID, so only posts with a higher ID are saved. Use the latestPostId from your previous run's channel row. 0 means off.

## `keywords` (type: `array`):

Save only posts that contain at least one of these words or phrases (case insensitive, matched in post text, link preview title and description, file names and poll question). Posts that do not match are skipped and not charged. Each saved post lists its matchedKeywords.

## `useTelegramSearch` (type: `boolean`):

Off: the actor reads the channel history page by page and keeps matching posts (exact, but slow for rare words in big channels). On: uses the search box of the channel preview (t.me/s/channel?q=keyword) to jump straight to matching posts, one search per keyword, then keeps only posts that really contain the keyword. Much faster for old or rare matches.

## `keywordMatch` (type: `string`):

Contains: the keyword can be part of a longer word (wallet also matches wallets). Whole word: only complete words or phrases (TON does not match button). Applies to keywords and exclude keywords.

## `excludeKeywords` (type: `array`):

Skip posts that contain any of these words or phrases (case insensitive). Skipped posts are not charged.

## `mediaTypes` (type: `array`):

Keep only posts that contain at least one of the selected types. Leave empty for all posts.

## `includeForwarded` (type: `boolean`):

Turn off to keep only original posts of the channel.

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

Safety limit for filtered runs. Each page holds about 20 posts. With strict filters (rare keywords, a narrow date window far in the past) the actor may read many pages to find matches; this caps the reading per channel and per keyword search.

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

Stop the whole run after this many saved rows (posts and channel rows). 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.

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

Usually not needed: the t.me preview is public and the actor reads it slowly (about 1 page per second). Turn on Apify Proxy only if you see BLOCKED or RATE_LIMITED errors in big runs.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxPostsPerChannel": 10,
  "includeChannelInfo": true,
  "exactSubscriberCount": true,
  "minPostId": 0,
  "useTelegramSearch": false,
  "keywordMatch": "contains",
  "mediaTypes": [],
  "includeForwarded": true,
  "maxPagesPerChannel": 50,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

## `channels` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `allResults` (type: `string`):

No description

## `runSummary` (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"
    ],
    "maxPostsPerChannel": 10
};

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

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

```

## MCP server setup

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