# Telegram Scraper: Channels, Messages, Media, Views & Leads (`church_of_loujess/telegram-scraper`) Actor

Fast 256MB Telegram Channel & Message Scraper. Extract channel subscriber counts, bios, message text, Markdown, views, forwards, media URLs, reactions, emails, external links & crypto addresses from public Telegram channels. Zero API keys or proxies needed.

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

## Pricing

from $3.00 / 1,000 extracted telegram message & osint records

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, Message, Media & OSINT Lead Scraper (2026) — Zero-Proxy, 256MB & MCP Ready

Extract **Telegram channel metadata (subscribers, bio, verified badge, emails, URLs), message posts, RAG-ready Markdown (`textMarkdown`), view counts, forwards, replies, high-res photos, direct `.mp4` video URLs, polls, external links, business emails, and crypto wallet/contract addresses (`0x...`, `bc1...`, `T...`)** from any public Telegram channel.

Engineered for **AI Agents (MCP), Crypto/Web3 Alpha & OSINT Intelligence, Media Monitoring, and Lead Generation**, this Actor runs in **256 MB RAM** with **zero Telegram API keys (`api_id`/`api_hash`), zero phone logins, and zero proxies required**.

***

### Why Choose This Telegram Scraper?

| Capability | Legacy Telegram Scrapers | `church_of_loujess/telegram-scraper` |
| :--- | :--- | :--- |
| **Authentication** | Often requires Telegram phone login or `api_id` | **Zero API Keys or Login Required** |
| **Memory Footprint** | 1,024 MB – 4,096 MB (Headless Browser) | **256 MB RAM** (`curl_cffi` TLS impersonation + `lxml`) |
| **Deep History Pagination** | First 20 messages only | **Automatic `?before=` cursor pagination (up to 5,000 messages/channel)** |
| **AI & RAG Formatting** | Raw HTML or stripped text | **Clean `text`, `textMarkdown` (preserving bold/code/links) & `aiSummary`** |
| **OSINT & Web3 Entities** | None | **Auto-extracted Emails, External URLs, `t.me` Links, Hashtags, Mentions & Crypto Addresses (`0x...`, `bc1...`, `T...`)** |
| **Rich Media Extraction** | Missing or broken CSS wrappers | **Direct Photo URLs, `.mp4` Video URLs, Voice Notes, Files, Link Previews & Polls** |

***

### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `channels` | `string[]` | `["durov", "telegram"]` | Public Telegram handles (`durov`), `@username`, or URLs (`https://t.me/durov`, `https://t.me/s/telegram`). |
| `maxMessagesPerChannel` | `integer` | `25` | Max messages per channel (newest first). Set to **`0` for channel-profile-only mode**, or up to `5000` with automatic backward pagination. |
| `searchKeywords` | `string[]` | `[]` | Optional keywords/phrases filter (case-insensitive). Only matching messages are returned. |
| `oldestMessageDate` | `string` | `""` | Optional ISO date cutoff (e.g. `2025-01-01`). Pagination stops automatically once older messages are reached. |
| `onlyWithMedia` | `boolean` | `false` | Return only messages containing photos, videos, voice notes, or files. |
| `onlyWithLinksOrEmails` | `boolean` | `false` | Return only messages containing external URLs, `t.me` links, emails, or crypto addresses. |
| `includeMarkdown` | `boolean` | `true` | Include `textMarkdown` and LLM-ready `aiSummary` on every message. |

***

### Usage Examples

#### 1. Scrape Channel Posts, Media & Views

```json
{
  "channels": ["durov", "telegram"],
  "maxMessagesPerChannel": 50,
  "includeMarkdown": true
}
```

#### 2. Fast Channel Subscriber & Bio Lead Lookup (`maxMessagesPerChannel: 0`)

```json
{
  "channels": ["@durov", "@telegram", "https://t.me/toncoin"],
  "maxMessagesPerChannel": 0
}
```

***

### Sample Output

```json
{
  "recordType": "message",
  "id": "durov/471",
  "postId": 471,
  "postUrl": "https://t.me/durov/471",
  "channelUsername": "durov",
  "channelTitle": "Pavel Durov",
  "channelUrl": "https://t.me/durov",
  "verified": true,
  "subscribers": 11145000,
  "date": "2026-10-14T18:22:10+00:00",
  "timestamp": 1791998930,
  "views": 3400000,
  "viewsRaw": "3.4M",
  "text": "Telegram has reached a new milestone...",
  "textMarkdown": "**Telegram** has reached a new milestone...",
  "hasMedia": false,
  "photos": [],
  "videos": [],
  "hashtags": [],
  "mentions": [],
  "telegramLinks": [],
  "externalUrls": [],
  "extractedEmails": [],
  "cryptoAddresses": [],
  "aiSummary": "@durov (Pavel Durov, 11,145,000 subscribers) Post #471 on 2026-10-14T18:22:10+00:00 | 3,400,000 views | Media: 0 photos, 0 videos | Telegram has reached a new milestone..."
}
```

# Actor input Schema

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

Public Telegram channels to scrape: bare handles (<code>durov</code>, <code>telegram</code>), <code>@username</code>, or full URLs (<code>https://t.me/durov</code>, <code>https://t.me/s/telegram</code>).

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

Maximum number of messages to extract per channel (newest first, automatically paginating backwards via <code>?before=</code>). Set to <strong>0 for channel-profile-only mode</strong>.

## `searchKeywords` (type: `array`):

Optional list of keywords or phrases. When provided, only messages matching at least one keyword (case-insensitive) are returned.

## `oldestMessageDate` (type: `string`):

Only return messages posted on or after this ISO date (e.g. <code>2025-01-01</code>). Pagination stops automatically once older messages are reached.

## `onlyWithMedia` (type: `boolean`):

When enabled, only messages containing photos, videos, voice notes, or downloadable files are returned.

## `onlyWithLinksOrEmails` (type: `boolean`):

When enabled, only messages containing external URLs, email addresses, t.me links, or crypto wallet/contract addresses are returned.

## `includeMarkdown` (type: `boolean`):

Converts Telegram HTML formatting (bold, italic, code blocks, links) into clean Markdown (<code>textMarkdown</code>) and generates an LLM-ready <code>aiSummary</code>.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxMessagesPerChannel": 25,
  "searchKeywords": [],
  "oldestMessageDate": "",
  "onlyWithMedia": false,
  "onlyWithLinksOrEmails": false,
  "includeMarkdown": true
}
```

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

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

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

```

## MCP server setup

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