# Telegram Channel & Group Scraper - Messages, Links & Metadata (`extractmaster01/telegram-channel-scraper`) Actor

Extract messages, views, reactions, and links from public Telegram channels. No proxy, no login, no browser. Monitor brands, track keywords, export history.

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

## Pricing

from $0.80 / 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?

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 & Group Scraper

Scraper for public Telegram channels and groups. It reads data directly from Telegram's public web preview (`t.me/s/<channel>`), so there is no login, no proxy, and no browser automation involved. That keeps runs fast and keeps Compute Unit usage close to zero.

### What it does

The actor collects channel/profile metadata (name, bio, follower count, verified status) and, optionally, the message history: text, view counts, media links, replies, forwards, polls, the message author (for channels with multiple posters), and link previews.

Common uses:

- Monitoring competitors, industry news, or crypto/finance channels
- Feeding messages into sentiment analysis or LLM pipelines
- Building lead lists from profile bios and follower counts
- Indexing media links and URL previews shared in a channel

### Pricing

This actor uses Pay-per-Event pricing:

- $0.80 per 1,000 messages scraped ($0.0008 per message)
- $0.002 per channel analyzed

There are no separate Compute Unit charges. You pay only for the data that gets extracted.

### Input

| Field | Type | Default | Description |
| ----- | ---- | ------- | ----------- |
| `profiles` | Array | *(required)* | Usernames or full profile links (e.g. `https://t.me/durov` or `durov`). The input form prefills this with `["telegram"]`. |
| `collectMessages` | Boolean | `true` | When enabled, messages are extracted along with the profile. When disabled, only profile metadata is returned. |
| `oldestMessageDate` | String | *(empty)* | Only scrape messages posted on or after this date (e.g. `2023-06-15`). |
| `scrapeLastNDays` | Integer | *(empty)* | Number of days to look back. `1` means today only, `2` means today and yesterday, and so on. If both date fields are set, whichever is more recent applies. |

### Output

Each dataset item is a flat JSON object representing one message, with the profile metadata repeated on every item so it's ready for direct database insertion. If `collectMessages` is disabled, one item per profile is returned instead.

Sample item:

```json
{
  "username": "@durov",
  "fullName": "Pavel Durov",
  "avatarUrl": "https://cdn4.telesco.pe/file/...",
  "followers": 11000000,
  "verified": true,
  "bio": "Founder of Telegram.",
  "url": "https://telegram.me/s/durov",
  "message": {
    "fulldate": "2024-07-31T21:11:09.000Z",
    "date": "July 31, 2024",
    "views": 21000,
    "image": "https://cdn4.telesco.pe/file/...",
    "video": "",
    "document": "",
    "description": "🚩 Big day! Today we introduce the Telegram Browser and Mini App Store...",
    "preview": {
      "link": "https://telegram.org/blog/w3-browser-mini-app-store/",
      "text": "Telegram Browser, Gifting Stars and More..."
    },
    "link": "https://telegram.me/s/durov/340",
    "reply": "",
    "poll": "",
    "forwardedFrom": "",
    "author": "Pavel Durov"
  }
}
```

`preview` is `null` when a message has no link preview attached.

### Limitations

This works only on public channels and groups. Private channels, restricted groups, and channels that require joining can't be accessed. Telegram also doesn't publish member lists, so member scraping isn't possible.

# Actor input Schema

## `collectMessages` (type: `boolean`):

Scrape messages of provided profiles.

## `profiles` (type: `array`):

The profiles to look for. Must be exact. You can also provide a link to the profile, e.g. https://t.me/telegram

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

Works only when collecting messages. Only messages uploaded after or on this date will be scraped.

## `scrapeLastNDays` (type: `integer`):

Specify how old scraped posts can be (in days). Putting 1 will get you only today's posts, 2 - tomorrow's and today's, and so on. If the Post newer than field was set, the most recent post will be chosen.

## Actor input object example

```json
{
  "collectMessages": true,
  "profiles": [
    "telegram"
  ]
}
```

# Actor output Schema

## `channelsAndMessages` (type: `string`):

Channel profile metadata (username, followers, bio) and, unless collectMessages is disabled, one item per message with text, views, media and reactions.

# 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 = {
    "profiles": [
        "telegram"
    ]
};

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

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

```

## MCP server setup

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