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

Scrape posts, views, media, polls and subscriber counts from any public Telegram channel. No API key, no login, no phone number.

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

## Pricing

from $0.60 / 1,000 posts

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

Extract posts, views, media, polls and subscriber counts from **any public Telegram channel** in seconds. No Telegram API key, no phone number, no login, no bot token.

Give it channel names or `t.me` links and get a clean, structured dataset of the newest posts: text, date, view count, photos, videos, documents, link previews, forwards, replies and polls. Filter by keyword or date, and run it on a schedule to monitor channels continuously.

### What can you do with it?

- **Monitor news and alerts** from crypto, finance, tech or local-news channels and push new posts to Slack, Google Sheets or your own app.
- **Track brands and competitors**: who mentions your product, what competitors announce, how many views their posts get.
- **Build datasets** for research, trend analysis or AI training from thousands of posts per run.
- **Feed AI agents and RAG pipelines** with fresh Telegram content (works out of the box with the Apify MCP server).
- **Archive a channel** including media URLs before posts are edited or deleted.
- **Analyze reach**: views per post, posting frequency, media mix, which links get shared.

### Features

- Works with usernames (`durov`), handles (`@telegram`) or links (`https://t.me/bloomberg`, `https://t.me/s/bloomberg`).
- Newest posts first, with automatic pagination back in time up to the limit you set.
- **Keyword search** on Telegram's side (`searchQuery`) so you only pay for matching posts.
- **Date filter** (`postedAfter`) for incremental runs: scrape only what is new since yesterday.
- One `channel` record per channel: title, description, subscribers, photo/video/file/link counters, verified badge.
- Every post includes plain `text` and `textHtml`, extracted `links`, `views`, author signature, forward source, reply target, photos, videos (with thumbnails and duration), documents, stickers, polls (with percentages) and link previews.
- Non-existent or private channels produce an `error` record instead of failing the whole run.
- Fast and cheap: no browser, no proxy needed by default.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `channels` | array | required | Usernames or `t.me` links of public channels. |
| `maxPostsPerChannel` | integer | 100 | Stop after this many posts per channel (newest first). |
| `postedAfter` | string | – | ISO date (`2026-01-01`). Older posts are skipped and pagination stops. |
| `searchQuery` | string | – | Keyword filter applied by Telegram. Only matching posts are returned. |
| `includeChannelInfo` | boolean | true | Also output a `channel` record with subscribers and counters. |
| `proxyConfiguration` | object | none | Optional Apify Proxy settings. Only needed if you hit HTTP 429. |

Example:

```json
{
    "channels": ["durov", "https://t.me/telegram"],
    "maxPostsPerChannel": 200,
    "postedAfter": "2026-10-01",
    "includeChannelInfo": true
}
```

### Output

Channel record:

```json
{
    "type": "channel",
    "channelUsername": "durov",
    "url": "https://t.me/durov",
    "title": "Pavel Durov",
    "description": "Founder of Telegram.",
    "subscribers": 10400000,
    "photos": 102,
    "videos": 47,
    "links": 200,
    "isVerified": true,
    "photoUrl": "https://cdn4.telesco.pe/file/....jpg"
}
```

Post record:

```json
{
    "type": "post",
    "channelUsername": "durov",
    "channelTitle": "Pavel Durov",
    "postId": 552,
    "url": "https://t.me/durov/552",
    "datetime": "2026-10-11T14:52:40+00:00",
    "text": "✨ Designers × AI\n\nThe mockup era is over. ...",
    "textHtml": "<b>✨ Designers × AI</b><br/><br/>...",
    "views": 760000,
    "author": null,
    "isForwarded": false,
    "forwardedFromTitle": null,
    "forwardedFromUrl": null,
    "replyToUrl": null,
    "replyToText": null,
    "isEdited": false,
    "hasMedia": true,
    "mediaCount": 1,
    "photos": ["https://cdn4.telesco.pe/file/....jpg"],
    "videos": [],
    "documents": [],
    "sticker": null,
    "poll": null,
    "linkPreview": null,
    "links": ["https://t.me/designers"],
    "scrapedAt": "2026-10-13T15:00:00.000Z"
}
```

Poll example inside a post: `{"question": "Which feature next?", "options": [{"text": "Folders", "percent": 62}, {"text": "Themes", "percent": 38}], "voters": 125000}`.

### Pricing

You pay per post (and a tiny amount per channel record). There are no platform usage fees on top. A run that collects 1,000 posts typically finishes in under a minute. Use `postedAfter` or `searchQuery` to pay only for the posts you need.

### Tips

- **Daily monitoring**: schedule the Actor every hour or day with `postedAfter` set to the previous run time and connect a webhook or an integration (Slack, Google Sheets, Make, Zapier, n8n).
- **Big archives**: `maxPostsPerChannel` can go to 100,000; Telegram serves about 20 posts per page, so large channels take a few minutes.
- **Media files**: the photo and video URLs point to Telegram's CDN and can expire after some hours. Download them right away if you need to keep them.
- **AI agents**: this Actor is available through the Apify MCP server, so Claude, ChatGPT or any MCP client can call it with a plain-language request.

### Limitations

- Only public channels with the web preview enabled can be scraped. Private channels, channels restricted by the owner, and most groups return an `error` record.
- Comments live in a separate discussion group and are not part of the channel preview.
- Reactions are not shown in the public preview.

### Legal and fair use

This Actor only reads publicly available pages that Telegram serves to anyone without logging in. Please respect Telegram's terms, the rights of channel owners and applicable privacy laws (such as GDPR) when storing or republishing content.

### Support

Found a channel that doesn't parse correctly, or need an extra field? Open an issue on the **Issues** tab of this Actor. Issues are usually answered within a day.

You can also email <support@agentsgearbox.com>. More actors, daily-updated comparisons of scrapers for 200+ websites and custom scraper requests at [agentsgearbox.com](https://agentsgearbox.com).

# Actor input Schema

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

Public channel usernames or links, e.g. `durov`, `@telegram`, `https://t.me/bloomberg` or `https://t.me/s/bloomberg`. Private channels and channels that have disabled the web preview cannot be scraped.

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

Stop after this many posts for each channel. Newest posts come first.

## `postedAfter` (type: `string`):

Optional ISO date such as `2026-01-01` or `2026-01-01T12:00:00Z`. Older posts are skipped and pagination stops once posts are older than this date.

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

Optional keyword filter applied by Telegram on the server side (same as the search box on t.me). Only matching posts are returned.

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

Also output one record per channel with title, description, subscriber count and media counters (`type: "channel"`).

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

Telegram's public preview rarely blocks, so no proxy is needed by default. Enable Apify Proxy only if you see HTTP 429 or empty results.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxPostsPerChannel": 100,
  "includeChannelInfo": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Posts and channel records as JSON (one item per post or channel).

# 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("agentsgearbox/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",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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