# Telegram Channel Scraper (Public Posts, No Login) (`andok/telegram-channel-scraper`) Actor

Scrape public Telegram channel posts: text, date, views, links, hashtags, media URLs. No login or API keys. Pay per message.

- **URL**: https://apify.com/andok/telegram-channel-scraper.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.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

Scrape posts from any **public** Telegram channel without a Telegram account, API ID, or login. Give it channel usernames or `t.me` links and get structured JSON: post text, date, view count, links, hashtags, mentions, photo/video URLs, forward and reply info, and link previews. Built for OSINT, crypto and news monitoring, brand mentions, and feeding RAG / LLM pipelines.

It reads Telegram's public web preview (`t.me/s/<channel>`), so only channels with the preview enabled can be scraped. Private channels, groups and chats are not supported.

### Features

- **No login, no API keys** — plain HTTP, fast and cheap
- **Flexible input** — `durov`, `@durov`, `https://t.me/durov`, `https://t.me/s/durov`
- **Deep history** — paginates back up to 5,000 messages per channel
- **Date and keyword filters** — stop at `sinceDate`; keyword-filtered messages are never billed
- **Rich output** — views, links, hashtags, mentions, media URLs, forwards, replies, polls flag, link previews
- **Channel info record** — title, description, subscribers, photo/video/link counts (free)
- **Pay per message** — see pricing below

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `channels` | `string[]` | Yes | — | Usernames, `@handles`, or `t.me` links |
| `maxMessagesPerChannel` | `integer` | No | `100` | Newest-first cap per channel (1–5000) |
| `sinceDate` | `string` | No | — | Stop at posts older than this (`YYYY-MM-DD` or ISO 8601) |
| `keywords` | `string[]` | No | — | Only return messages containing any keyword (case-insensitive) |
| `includeChannelInfo` | `boolean` | No | `true` | Add one free `channel` record per channel |
| `includeHtml` | `boolean` | No | `false` | Include the formatted HTML of each message |

```json
{
  "channels": ["telegram", "https://t.me/durov"],
  "maxMessagesPerChannel": 200,
  "sinceDate": "2026-01-01",
  "keywords": ["bitcoin", "airdrop"]
}
```

### Output

Every dataset item has a `recordType`: `message`, `channel`, or `error`.

```json
{
  "recordType": "message",
  "channel": "telegram",
  "messageId": 460,
  "url": "https://t.me/telegram/460",
  "date": "2026-08-26T19:12:34+00:00",
  "text": "For all the info from today's update ...",
  "views": 1960000,
  "isForwarded": false,
  "forwardedFrom": null,
  "replyToMessageId": null,
  "links": ["https://telegram.org/blog/welcome-messages-buttons-TG-13"],
  "hashtags": [],
  "mentions": [],
  "photoUrls": [],
  "videoUrls": [],
  "linkPreview": { "url": "https://telegram.org/blog/...", "title": "Welcome Messages, ...", "description": "...", "siteName": "Telegram" }
}
```

`channel` records contain `title`, `description`, `subscribers`, `photosCount`, `videosCount`, `linksCount`. `error` records explain why a channel could not be read (private, no web preview, not found).

### Pricing

Pay per event: **$0.001 per message scraped** plus a **$0.001 start fee**. Channel info and error records are free.

Example: 5 channels x 200 messages = 1,000 messages = about **$1.00**.

### Limitations

- Only public channels with web preview enabled (`t.me/s/<name>`); no groups, private chats, comments or reactions
- View counts are rounded by Telegram for large numbers (e.g. 1.58M)
- Media is returned as CDN URLs; files are not downloaded
- Telegram may rate limit very aggressive use; the Actor retries with backoff

### Legal

Scrapes only publicly visible data. You are responsible for complying with Telegram's Terms of Service and applicable privacy law (e.g. GDPR) when processing the data.

If this Actor saves you time, a quick review on the Store page helps a lot.

# Actor input Schema

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

Public Telegram 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). Each message is billed once.

## `sinceDate` (type: `string`):

Optional. Stop when posts become older than this date. Format YYYY-MM-DD or ISO 8601 (e.g. 2026-01-01).

## `keywords` (type: `array`):

Optional. Only return messages whose text contains at least one of these keywords (case-insensitive). Filtered-out messages are not billed.

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

Adds one free record per channel with title, description, subscriber count and media counters.

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

Also return the formatted HTML of each message (bold, links, etc.).

## Actor input object example

```json
{
  "channels": [
    "telegram"
  ],
  "maxMessagesPerChannel": 100,
  "includeChannelInfo": true,
  "includeHtml": false
}
```

# Actor output Schema

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

No description

## `resultsCsv` (type: `string`):

No description

## `run` (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": [
        "telegram"
    ]
};

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

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

```

## MCP server setup

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