# Telegram Scraper (`dead00/telegram-scraper`) Actor

Scrape public Telegram channels without login: every post type, views, reactions and links, plus channel stats. Search inside channels, pick dates on a calendar, and get only new posts on each run, with no duplicates.

- **URL**: https://apify.com/dead00/telegram-scraper.md
- **Developed by:** [Dead](https://apify.com/dead00) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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 Scraper

Scrape public Telegram channels without login: every post type, views, reactions and links, plus channel stats. Search inside channels, pick dates on a calendar, and get only new posts on each run, with no duplicates.

### What you get

**Posts:** text, date, views, reactions (with paid stars), engagement rate, author signature, edited flag, forwarded-from, reply-to, hashtags and mentions. Links are split into external `links` and `telegramLinks` (links to other Telegram posts and channels). Media: photos, albums, videos, round videos, voice messages, documents and stickers. Also polls (with vote percentages) and link previews.

**Channel row:** title, description, avatar, verified badge, subscribers, photo/video/file/link counts, plus stats from the scraped posts: posts per day, average and median views, total views, average reactions, average engagement rate and the top 5 posts.

### How to use

Add channels in any format, one per line: `durov`, `@durov`, `https://t.me/durov` or `https://t.me/s/durov`.

- **Scrape posts:** turn it off to get only channel info (title, subscribers, counts). It's quick and cheap, and it ignores Max posts.
- **Max posts per channel:** how many posts to collect per channel.
- **Search in channels:** only posts containing a word or phrase. Telegram runs the search, so it's fast.
- **From date / To date:** pick days on the calendar, or use a relative date like `7 days` (the last week), which is ideal for scheduled runs. The actor jumps straight to the end date instead of reading every newer post, so old date ranges are quick even on huge channels.

### No duplicates between runs

Choose **Which posts**:

| Option | What happens | Good for |
|---|---|---|
| **Newest posts** (default) | Always starts from the latest post | One-off checks |
| **Continue older posts** | Each run picks up below the oldest post from last time: 20, then the next 20 older, and so on | Downloading a whole channel in chunks |
| **Only new posts** | Each run returns just the posts published since last time, oldest first | Scheduled monitoring (e.g. every hour) |

Progress is remembered per channel in a key-value store in your own account (default name `telegram-progress`). A few details:

- **Nothing is skipped.** If 500 new posts arrived and you asked for 20, you get the 20 oldest new ones, and the next run continues from there. The same applies if a run stops at your maximum cost.
- **Searches have their own memory,** separate from the channel's full post list.
- **Each channel row shows `progress`:** the newest and oldest post collected so far, whether the first post was reached, and how many new posts are still waiting.
- **Start from a specific post:** paste a post link like `https://t.me/durov/500` to start there and go older.
- **Separate projects:** use a different **Memory name**. Turn on **Reset memory** to start over.

### Output example

```json
{
  "type": "post",
  "channel": "durov",
  "postId": 385,
  "url": "https://t.me/durov/385",
  "date": "2025-05-10T09:00:00+00:00",
  "text": "Line one\nLine two with a link",
  "views": 1200000,
  "reactions": [{ "emoji": "👍", "count": 12045 }],
  "reactionsTotal": 12045,
  "engagementRate": 1.0,
  "hashtags": ["#news"],
  "links": ["https://example.com/story"],
  "telegramLinks": ["https://t.me/durov/380"],
  "media": [
    { "type": "photo", "url": "https://cdn4.telesco.pe/file/a1.jpg" },
    { "type": "video", "url": "https://cdn4.telesco.pe/file/v3.mp4", "duration": "1:05" }
  ],
  "isAlbum": true
}
```

### Channels that can't be read

Telegram shows a normal-looking page even when there's nothing to read. The actor tells you why instead of silently returning nothing. These rows are free:

| Status | Meaning |
|---|---|
| `no_preview` | The channel exists, but its owner turned off the web preview. Title and subscribers are still included. |
| `group` | A group chat. Group messages are not public on the web. |
| `private` | An invite-only channel. |
| `restricted` | Telegram does not display it on the web. |
| `not_found` | No public channel with this name. |
| `personal_account` | A person's account, not a channel. Skipped. |
| `invalid` | Not a channel name or link (for example, an invite link). |

### Pricing

You pay only for results. Platform costs are included.

| Event | Price per 1,000 |
|---|---|
| Post scraped | $1.00 |
| Channel scraped (channel row with stats) | $3.00 |
| Actor start (per run) | $0.00005 |

Set a **Maximum cost per run** in Run options. When it is reached, the actor stops and keeps everything collected so far.

### Good to know

- Only **public channels** with the web preview turned on can be read. No private channels, groups, members or phone numbers.
- Comments on posts are not included, because Telegram doesn't show them on the public web preview.
- **Engagement rate** = (reactions + paid stars) ÷ views × 100.
- **Numbers are rounded the way Telegram shows them** (2.27M views, 42.2K reactions), because the public page doesn't show exact counts.
- **Custom emoji reactions** are returned by `customEmojiId` with `emoji: null`, because Telegram's public page doesn't show them as characters. Some channels, like @durov, use only custom reactions. Standard reactions (👍 ❤️ 🔥) come through as characters.
- `contentOnlyInApp: true` means Telegram shows nothing readable for that post on the web (for example, a story or a new media type). Open it in the app to see it.
- Telegram limits how fast pages can be read. The actor paces itself and waits automatically when asked. For very large runs, adding a proxy can help.

# Actor input Schema

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

Public Telegram channels, one per line: durov, @durov, https://t.me/durov or https://t.me/s/durov. A post link like https://t.me/durov/500 starts from that post, going older.

## `scrapePosts` (type: `boolean`):

Turn off to get only channel info (title, subscribers, counts). When off, no posts are scraped, whatever Max posts is set to.

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

How many posts to collect per channel, newest first. Ignored when Scrape posts is off.

## `readMode` (type: `string`):

Newest = always start from the latest post. Continue = each run picks up below the oldest post from last time (download a whole channel in chunks, no duplicates). Only new = each run returns just the posts published since last time (ideal for scheduled monitoring).

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

Only posts containing this word or phrase. Telegram runs the search, so it's fast. Leave empty for all posts.

## `dateFrom` (type: `string`):

Only posts on or after this date. Pick a day on the calendar, or switch to relative, e.g. 7 days for the last week (great for scheduled runs).

## `dateTo` (type: `string`):

Only posts on or before this date. The actor jumps straight to it instead of reading every newer post. Leave empty for up to today.

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

Add one row per channel: title, description, subscribers, media counts, verified badge, posts per day, average views and top posts.

## `memoryName` (type: `string`):

Where progress is remembered between runs (used by Continue and Only new). Use different names to keep separate projects apart.

## `resetMemory` (type: `boolean`):

Forget the saved progress for these channels and start fresh on this run.

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

Optional. Usually not needed; helps if Telegram slows down very large runs.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "scrapePosts": true,
  "maxPostsPerChannel": 100,
  "readMode": "newest",
  "includeChannelInfo": true,
  "memoryName": "telegram-progress",
  "resetMemory": false,
  "proxyConfiguration": {
    "useApifyProxy": 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dead00/telegram-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",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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