# Telegram Channel & Profile Scraper (`scrapeai/telegram-scraper`) Actor

Scrape Telegram public channels and profiles — channel metadata, messages, views, reactions, and media URLs. No API key or login needed.

- **URL**: https://apify.com/scrapeai/telegram-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (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 $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Telegram Channel & Profile Scraper

**Telegram Channel & Profile Scraper** is a fast, lightweight, and reliable Apify Actor designed to extract public posts, channel metadata, view counts, reaction metrics, and media attachments from Telegram public channels and profiles.

**No API key, Telegram login, or bot token is required.** The Actor accesses public web previews (`t.me/s/`) directly to provide clean, structured data in real-time.

***

### Features

- **No Authentication Required:** Scrape public Telegram channels and profiles instantly without API hash, phone numbers, or account credentials.
- **Rich Message Extraction:** Collect post IDs, post URLs, timestamps, message text (plain text & HTML), views, and reactions.
- **Media Download Links:** Extract direct URLs for images, MP4 videos, audio files, documents, and external hyperlinks embedded in posts.
- **Channel Metadata:** Fetch channel titles, handles/usernames, subscriber/member counts, channel bio/descriptions, and profile avatars.
- **Dynamic Output Formats:** Choose between **Flat** (1 item per post) or **Nested** (1 item per channel with array of posts).
- **Flexible Filters:** Filter posts by keyword search or date ranges (`startDate` / `endDate`).
- **Paging Support:** Automatically loads older channel messages up to your specified `maxPostsPerChannel`.

***

### What Data Can You Extract?

| Field Name | Type | Description |
| :--- | :--- | :--- |
| `channelTitle` | String | Name of the Telegram channel or profile |
| `channelUsername` | String | Handle or username (e.g. `durov`) |
| `channelUrl` | String | Link to the Telegram channel (`https://t.me/durov`) |
| `subscriberCount` | String | Subscriber or member count (e.g. `11.3M`) |
| `subscriberType` | String | Label for count (e.g. `subscribers`, `members`) |
| `messageId` | Integer / String | Numerical ID of the post |
| `postUrl` | String | Direct web link to the specific post |
| `date` | String | ISO 8601 publication timestamp |
| `text` | String | Full message text content |
| `views` | String | Total view count (e.g. `4.47M`) |
| `reactions` | Array | Array of reaction emojis and counts (`[{ "emoji": "⭐ Stars", "count": "7.81K" }]`) |
| `photos` | Array | URLs of high-res image previews |
| `videos` | Array | Direct MP4 video download URLs |
| `documents` | Array | Document attachment titles and details |
| `links` | Array | External web links contained in the post |
| `forwardedFrom` | String | Channel name if post was forwarded |
| `scrapedAt` | String | Timestamp when data was extracted |

***

### How to Scrape Telegram Public Channels

1. **Input Channel URLs or Usernames:** Enter full URLs (`https://t.me/s/durov` or `https://t.me/telegram`) or simple handles (`durov`, `@telegram`).
2. **Select Scrape Type:** Choose whether to collect full channel info & messages (`all`), messages only (`messages`), or metadata only (`channel_info`).
3. **Set Post Limits & Filters:** Define `maxPostsPerChannel` and optional `startDate` / `endDate` or `searchKeywords`.
4. **Run the Scraper:** Click **Start** to begin scraping.
5. **Export Data:** Download your datasets in JSON, CSV, Excel, XML, or HTML formats.

***

### Input Parameters

See the **Input** tab in Apify Console for full configuration options:

```json
{
  "startUrls": [
    { "url": "https://t.me/s/durov" }
  ],
  "channels": [
    "telegram"
  ],
  "scrapeType": "all",
  "maxPostsPerChannel": 50,
  "includeChannelMetadata": true,
  "includeMedia": true,
  "includeReactions": true,
  "includeViews": true,
  "outputFormat": "flat"
}
```

#### Key Settings:

- `startUrls` *(Array)*: List of Telegram channel URLs.
- `channels` *(Array)*: List of Telegram usernames or handles (e.g. `durov`, `@telegram`).
- `scrapeType` *(String)*: Options: `all` (default), `messages`, `channel_info`.
- `maxPostsPerChannel` *(Integer)*: Max posts per channel (default `50`, set `0` for no limit).
- `outputFormat` *(String)*: Options: `flat` (1 record per post) or `nested` (1 record per channel).

***

### Output Examples

#### Flat Format

```json
{
	"channelTitle": "Pavel Durov",
	"channelUsername": "durov",
	"channelUrl": "https://t.me/durov",
	"subscriberCount": "11.3M",
	"subscriberType": "subscribers",
	"messageId": 519,
	"postUrl": "https://t.me/durov/519",
	"date": "2026-05-20T15:38:10.000Z",
	"text": "🤖 Your Telegram inbox can now run itself.Assign a bot to read and reply for you — with granular control over its rights and chat access. 🧠⚙️ Start building!",
	"views": "8.64M",
	"reactions": [
		{
			"emoji": "⭐ Stars",
			"count": "2.48K"
		},
		{
			"emoji": "custom_5265077361648368841",
			"count": "23.4K"
		},
		{
			"emoji": "custom_5465587407350942612",
			"count": "7.75K"
		},
		{
			"emoji": "custom_5399847211989246390",
			"count": "5.99K"
		},
		{
			"emoji": "custom_5936157098181135162",
			"count": "417"
		},
		{
			"emoji": "custom_5373223594484587136",
			"count": "107"
		}
	],
	"photos": [],
	"videos": [
		"https://cdn4.telesco.pe/file/e174be993b.mp4?token=ohtSSMZAhThj4sFImo9zSLjbBQL-_f4gsyzNyPEQmebkua-Fzfjvv-roC2IPuJSB5aF_LMFjiI488ZnzhnHleK6YMHpXYwKjHdzXaH7BA3Swbjitr8GHJFWhLh-AgpueKR2GYNS1QRaq_pOTThZ9-yTEPo0cj71MlV1CvU8BEBAXuctVSiXT6FpWTJupqvXzwkAQXvOt45Wviuhrjn-vq0G73Em20yaWoBIh5pa8576wk1XrSqtM83PO33MYHc3dp1lDS0x56hznQqM2t7kCGKyxc7KpDUVec1AlWq3G0HeEsDdIPCfHb6bTf-BAttdkx-lvuerEgp1HY9gcIXdb6A"
	],
	"documents": [],
	"links": [
		"https://core.telegram.org/bots/features#secretary-bots"
	],
	"scrapedAt": "2026-08-06T09:03:13.169Z"
}
```

***

### Disclaimer & Legal Note

> Our Actors are ethical and do not extract any private user data, such as private chat messages, non-public phone numbers, or hidden personal details. They only extract what channel owners have chosen to publish publicly on Telegram web previews. You should ensure that your use of scraped data complies with applicable privacy laws (such as GDPR) and Telegram's Terms of Service.

***

### Support & Feedback

If you encounter any issues or have feature requests, please open an issue in the **Issues** tab on Apify Console.

# Actor input Schema

## `startUrls` (type: `array`):

Telegram channel or profile URLs (e.g., https://t.me/s/durov or https://t.me/telegram) or usernames.

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

List of Telegram channel usernames or links (e.g. durov, @telegram, https://t.me/s/durov). Used if Start URLs is empty.

## `scrapeType` (type: `string`):

Select what data to extract: channel info + messages, messages only, or channel info only.

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

Maximum number of posts/messages to scrape per channel (0 = unlimited).

## `includeChannelMetadata` (type: `boolean`):

Include channel metadata (title, subscribers, bio, avatar) in output items.

## `includeMedia` (type: `boolean`):

Extract image, video, audio, and file attachment URLs.

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

Extract reaction emojis and counts.

## `includeViews` (type: `boolean`):

Extract post view counts.

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

Optional list of keywords to filter posts. Only posts containing any of these keywords will be scraped.

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

Only extract messages posted on or after this date (ISO format: YYYY-MM-DD).

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

Only extract messages posted on or before this date (ISO format: YYYY-MM-DD).

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

Structure of the dataset output: Flat (1 item per post) or Nested (1 item per channel with messages array).

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

Proxy settings for scraping.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://t.me/s/durov"
    }
  ],
  "channels": [
    "durov",
    "telegram"
  ],
  "scrapeType": "all",
  "maxPostsPerChannel": 50,
  "includeChannelMetadata": true,
  "includeMedia": true,
  "includeReactions": true,
  "includeViews": true,
  "searchKeywords": [],
  "outputFormat": "flat",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "startUrls": [
        {
            "url": "https://t.me/s/durov"
        }
    ],
    "channels": [
        "durov",
        "telegram"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/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 = {
    "startUrls": [{ "url": "https://t.me/s/durov" }],
    "channels": [
        "durov",
        "telegram",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/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 '{
  "startUrls": [
    {
      "url": "https://t.me/s/durov"
    }
  ],
  "channels": [
    "durov",
    "telegram"
  ]
}' |
apify call scrapeai/telegram-scraper --silent --output-dataset

```

## MCP server setup

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