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

Scrape messages, views, reactions, media, polls, forwards and subscriber counts from any public Telegram channel. Date ranges, keyword search and incremental monitoring. No login, no API keys.

- **URL**: https://apify.com/borjagvo/telegram-channel-scraper.md
- **Developed by:** [Borja GVO](https://apify.com/borjagvo) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 message 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

Export the full message history of any **public Telegram channel**: text, date, view counts, reactions (including paid Telegram Stars), photos, videos, documents, polls, link previews, forwards and replies, plus the channel's **exact subscriber count**. No Telegram account, phone number, API ID or bot token needed.

Built for speed and low cost: it reads Telegram's lightweight public web preview (no browser), jumps straight to any date range instead of scrolling, and can run on a schedule to return **only new posts** since the last run.

### What can this Telegram scraper do?

- 📨 **Scrape messages from many channels at once**: paste usernames (`durov`), handles (`@durov`) or links (`https://t.me/durov`)
- 📅 **Date range filter with instant seek**: get e.g. all posts from March 2024 without paging through everything newer
- 🔎 **Keyword search** inside channels using Telegram's own search
- 🔁 **Monitoring mode**: schedule the Actor and get only messages published since the previous run (perfect for alerts, dashboards and AI agents)
- 📊 **Engagement data**: views, every reaction with its count, total reactions, paid Stars
- 🖼️ **Media**: photo URLs, video URLs with duration and thumbnail, voice notes, documents, stickers, locations, full albums
- 🧵 **Context**: forwarded-from channel, reply-to message, link previews (title, description, image), polls with options and percentages, hashtags, mentions and all outgoing links
- 👤 **Channel profiles**: title, description, exact subscribers, verified badge, number of photos/videos/links, last post date
- ⚡ **Fast**: ~1,000 messages per minute per channel, many channels in parallel

### Why scrape Telegram?

Telegram has 1B+ users and is where crypto projects, news outlets, traders, brands, OSINT sources and communities publish first. Typical uses:

- **Crypto & trading**: collect signals, announcements and sentiment from project and signal channels
- **News & media monitoring**: track breaking news, propaganda and narratives across hundreds of channels
- **Marketing & influencer research**: compare channels by subscribers, views per post and reaction rates before buying ads
- **OSINT & research**: archive channels, study forwarding networks between channels, build datasets for academic work
- **AI & LLM pipelines**: feed fresh channel content to RAG systems, summarizers or agents (works with the Apify MCP server)
- **Competitive intelligence**: follow competitors' announcement channels automatically

### How much does it cost to scrape Telegram?

This Actor uses pay-per-event pricing, so you only pay for data you get:

| Event | Price |
| --- | --- |
| Message scraped | **$1.00 per 1,000 messages** |
| Channel profile | $0.002 per channel |

Example: 10 channels × 500 messages = 5,000 messages ≈ **$5.02**. Apify's free plan includes monthly credits, enough to try the Actor on thousands of messages. You can cap spending per run with the "Maximum cost per run" setting; the Actor stops cleanly when the cap is reached.

### How to use

1. Click **Try for free**.
2. Add one or more channels: `durov`, `@telegram` or `https://t.me/nytimes`.
3. Optionally set **Max messages per channel**, a **date range**, a **keyword**, or enable **monitoring mode**.
4. Click **Start** and download your data as JSON, CSV, Excel, XML or HTML, or fetch it through the API.

#### Input example

```json
{
    "channels": ["durov", "@telegram", "https://t.me/cointelegraph"],
    "maxMessagesPerChannel": 500,
    "fromDate": "2025-01-01",
    "toDate": "2025-03-31",
    "searchQuery": "",
    "onlyNewMessages": false,
    "includeChannelInfo": true
}
```

Dates accept absolute values (`2025-01-31`) or relative ones (`7 days`, `2 weeks`, `3 months`).

### Output example

Each message is one record:

```json
{
    "type": "message",
    "channel": "durov",
    "id": 548,
    "url": "https://t.me/durov/548",
    "date": "2026-09-11T16:04:02.000Z",
    "text": "🤝 Telegram has become the sponsor of Codeforces — the largest competitive programming platform in the world…",
    "views": 2100000,
    "viewsText": "2.1M",
    "reactions": [
        { "emoji": null, "customEmojiId": "5399847211989246390", "count": 32300 },
        { "emoji": "🔥", "customEmojiId": null, "count": 9380 }
    ],
    "totalReactions": 50580,
    "paidStars": 21400,
    "author": "Pavel Durov",
    "isEdited": false,
    "forwardedFrom": null,
    "replyTo": null,
    "media": [],
    "mediaCount": 0,
    "linkPreview": {
        "url": "https://codeforces.com/blog/entry/156620",
        "siteName": "Codeforces",
        "title": "Telegram Returns as Title Sponsor of Codeforces!",
        "description": "Hi, Codeforces!",
        "imageUrl": "https://cdn4.telesco.pe/file/…jpg"
    },
    "poll": null,
    "links": ["https://codeforces.com/blog/entry/156620"],
    "hashtags": [],
    "mentions": [],
    "channelTitle": "Pavel Durov",
    "scrapedAt": "2026-10-06T19:37:55.966Z"
}
```

And, when "Include channel profile" is on, one record per channel:

```json
{
    "type": "channel",
    "channel": "durov",
    "url": "https://t.me/durov",
    "entityType": "channel",
    "title": "Pavel Durov",
    "verified": true,
    "description": "Founder of Telegram.",
    "subscribers": 10491942,
    "photos": 102,
    "videos": 46,
    "links": 200,
    "hasPublicPreview": true,
    "latestMessageId": 548,
    "latestMessageDate": "2026-09-11T16:04:02.000Z"
}
```

The dataset has two ready-made views, **Messages** and **Channel profiles**, so you can export each one separately as CSV or Excel.

### Monitoring Telegram channels on a schedule

1. Enable **Only new messages since last run**.
2. Save the input as a [task](https://docs.apify.com/platform/actors/running/tasks) and add a [schedule](https://docs.apify.com/platform/schedules) (e.g. every 15 minutes).
3. Connect the output to Slack, Google Sheets, a webhook, Make, Zapier or n8n through [integrations](https://docs.apify.com/platform/integrations).

Each run returns only posts newer than the last one it saw, so you never pay twice for the same message.

### Use it from code, AI agents and automation tools

- **API**: run the Actor and fetch results with the [Apify API](https://docs.apify.com/api/v2) or the JavaScript/Python clients.
- **AI agents**: available through the [Apify MCP server](https://mcp.apify.com), so Claude, ChatGPT, Cursor and other MCP clients can call it as a tool.
- **No-code**: Make, Zapier, n8n, Google Sheets and webhooks.

### FAQ

**Do I need a Telegram account or API keys?**
No. The Actor reads the same public web preview anyone can open at `https://t.me/s/<channel>`.

**Can it scrape private channels or groups?**
No. Only public channels whose owners keep the web preview enabled. Public groups return a profile record (title, members, online count) but Telegram does not publish their message history on the web. Channels that disabled the preview are reported with `hasPublicPreview: false`.

**How far back can it go?**
All the way to the first post of a public channel. Use `toDate` to jump to old periods instantly.

**Why are some reactions shown with `customEmojiId` instead of an emoji?**
Channels can use custom (premium) emoji as reactions. Telegram's web preview only exposes their ID, which is returned so you can still count and group them.

**Are view counts exact?**
Telegram rounds large view counts in public previews (e.g. `2.1M`). The rounded value is converted to a number in `views`; the original text is kept in `viewsText`. Subscriber counts in channel profiles are exact.

**Is scraping Telegram legal?**
The Actor only collects data that channel owners chose to publish publicly. You are responsible for how you use it, including compliance with GDPR and other privacy laws when processing personal data.

### Support

Found a bug or need an extra field? Open an issue in the **Issues** tab — this Actor is actively maintained.

# Actor input Schema

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

Public channels to scrape. Accepts usernames (durov), @handles (@durov) or links (https://t.me/durov, https://t.me/s/durov).

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

Stop after this many messages per channel (newest first). Use 0 for no limit.

## `fromDate` (type: `string`):

Only messages posted on or after this date. Absolute (2025-01-31) or relative (7 days, 2 weeks, 3 months).

## `toDate` (type: `string`):

Only messages posted on or before this date. The scraper jumps straight to this point in the channel's history instead of scrolling through newer posts.

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

Only return messages that match this keyword, using Telegram's own in-channel search.

## `onlyNewMessages` (type: `boolean`):

Remember the newest message seen per channel and, on the next run, return only messages posted after it. Ideal for scheduled runs that feed a database, Slack, Google Sheets or an AI agent.

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

Add one record per channel with title, description, exact subscriber count, verified badge and media counters.

## `includeHtml` (type: `boolean`):

Also return the original HTML of each message (keeps bold, italics and inline links).

## `maxConcurrency` (type: `integer`):

How many channels to process in parallel.

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

Proxies are optional for Telegram but help with very large jobs.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxMessagesPerChannel": 50,
  "onlyNewMessages": false,
  "includeChannelInfo": true,
  "includeHtml": false,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `messages` (type: `string`):

No description

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

No description

## `summary` (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"
    ],
    "maxMessagesPerChannel": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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