# Telegram Channel Scraper for LLM & RAG (No Login) (`henrycrawl/telegram-channel-rag`) Actor

Scrape posts from public Telegram channels without login or API keys: clean text, detected language, views, reactions, links and ready-made RAG chunks. No personal data stored. Pay only for posts delivered.

- **URL**: https://apify.com/henrycrawl/telegram-channel-rag.md
- **Developed by:** [Henry Crawl](https://apify.com/henrycrawl) (community)
- **Categories:** AI, Social media, News
- **Features:** Limited permissions
- **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 for LLM & RAG (No Login)

Scrape posts from **public Telegram channels** — no Telegram account, no API keys, no phone number — and get them back **cleaned, language-tagged and ready for LLMs, embeddings and RAG pipelines**.

It reads the public web preview Telegram serves to everyone at `t.me/s/<channel>`, pages back through the channel history newest-first, and returns one tidy row per post (or per RAG chunk).

### Why this scraper

| | This Actor | Typical Telegram scrapers |
|---|---|---|
| Login / API keys | **None** | Often need a Telegram account, api_id/api_hash or session string |
| Text | Clean plain text, line breaks kept, emoji kept, links extracted | Raw HTML or markup |
| Language | Detected per post (`language`) — filter with `languages` | – |
| RAG | Optional `chunks` output with token estimates and stable ids | – |
| Filters before billing | Keywords, exclude words, language, minimum length, date, forwarded posts — **filtered posts are free** | Pay first, filter later |
| Personal data | **No admin signatures, no hidden forward senders, no commenters** | Often included |
| Errors | A free row explaining why a channel can't be read | Silent empty dataset |

### Use cases

- **News & market monitoring** — follow crypto, finance, geopolitics or industry channels daily with *Only posts since*.
- **RAG knowledge bases** — turn a channel's history into embedding-ready chunks with `postId`, `date` and `url` for citations.
- **AI agents** — give an LLM the latest posts of a channel as context ("what did @channel announce this week?").
- **Research & OSINT on public channels** — multilingual: Russian, Ukrainian, Persian, Arabic, Vietnamese, Chinese and more.
- **Brand & competitor tracking** — keyword filters across many channels in one run.

### Input

```json
{
  "channels": ["durov", "https://t.me/bbcrussian", "@telegram"],
  "maxPostsPerChannel": 200,
  "postsSince": "2026-11-01",
  "includeKeywords": [],
  "languages": [],
  "outputFormat": "posts"
}
```

- **channels** — `name`, `@name` or `t.me` links. Only public channels with web preview.
- **maxPostsPerChannel** — newest first; the Actor pages back until this number or `postsSince`.
- **includeKeywords / excludeKeywords / languages / minChars / includeForwarded** — applied *before* billing.
- **outputFormat** — `posts` (one row per post) or `chunks` (one row per RAG chunk; `chunkTokens`, `chunkOverlapTokens`).
- **includeChannelInfo** — adds one free row per channel: title, description, subscribers, verified.

### Output

One row per post (`recordType: "post"`):

```json
{
  "recordType": "post",
  "status": "OK",
  "id": "durov-559",
  "channel": "durov",
  "channelTitle": "Pavel Durov",
  "postId": 559,
  "url": "https://t.me/durov/559",
  "date": "2026-11-13T09:29:23Z",
  "edited": false,
  "text": "Founders — don't have a board. Be the board 😏",
  "language": "en",
  "views": 558000,
  "reactions": 48950,
  "forwarded": false,
  "forwardedFromChannel": null,
  "replyToPostId": null,
  "photos": 0,
  "videos": 0,
  "hasDocument": false,
  "pollQuestion": null,
  "links": [],
  "linkPreview": null,
  "hashtags": [],
  "charCount": 251,
  "wordCount": 47,
  "tokenEstimate": 63,
  "contentHash": "3f1c0d9a7b2e4c11",
  "scrapedAt": "2026-11-13T14:30:00Z"
}
```

With `outputFormat: "chunks"` each row is `recordType: "chunk"` with `id` (`<channel>-<postId>-<chunkIndex>`), `text`, `tokenEstimate`, `chunkIndex`, `chunkCount` and the post's metadata.

Error rows (`recordType: "error"`, free): `NO_PUBLIC_PREVIEW` (channel doesn't exist, preview disabled, or it's a group / bot / person), `NO_POSTS`, `INVALID_CHANNEL`, `RATE_LIMITED`, `HTTP_ERROR`, `NETWORK_ERROR`.

A run summary is saved to the key-value store as `SUMMARY`.

### Pricing

Pay per event: **$0.60 per 1,000 posts delivered** (plus Apify's tiny per-run start fee).
Filtered-out posts, channel info rows and error rows are **free**. In `chunks` mode you still pay once per post, not per chunk.

### Limits & notes

- Works only for **public channels whose owner left the web preview on** (most news, media and project channels). Private channels, groups, invite links and personal accounts are out of scope — by design, no login is ever used.
- Telegram does not say whether an unavailable name doesn't exist or just has no preview; both return `NO_PUBLIC_PREVIEW`.
- Views and reactions are Telegram's rounded counters (e.g. `4.69M` → 4690000).
- Media files are not downloaded; you get counts and the post URL.
- Requests are paced politely (one page at a time per channel).
- Admin signatures, the names of hidden forward senders and comments are deliberately not collected.

### FAQ

**Do I need a Telegram account?** No.

**How far back can it go?** As far as the channel's public history goes; set `maxPostsPerChannel` high (up to 20,000) or use `postsSince`.

**Can I monitor channels daily?** Yes — schedule the Actor with `postsSince` set to yesterday and dedupe on `id`.

# Actor input Schema

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

Public Telegram channels: @name, name, or t.me link (https://t.me/durov or https://t.me/s/durov). Invite links, groups and personal accounts are not supported.

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

Newest posts first. The scraper pages back through the channel history until this number (or the date below) is reached.

## `postsSince` (type: `string`):

YYYY-MM-DD (UTC). Paging stops at the first older post - ideal for daily monitoring.

## `includeKeywords` (type: `array`):

Case-insensitive whole-word match on post text, poll question and link title. Empty = all posts. Filtered-out posts are free.

## `excludeKeywords` (type: `array`):

e.g. advertising markers like "#ad" or "promo". Skipped posts are free.

## `languages` (type: `array`):

Detected language codes, e.g. \["en", "ru"]. Empty = all. Filtered-out posts are free.

## `minChars` (type: `integer`):

1 (default) skips media-only posts with no text, which are useless for LLMs. 0 keeps everything.

## `includeForwarded` (type: `boolean`):

Turn off to keep only the channel's own posts.

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

Chunks are ready for embeddings: each row carries the post's metadata. You are still charged once per post.

## `chunkTokens` (type: `integer`):

Only used when output format is chunks.

## `chunkOverlapTokens` (type: `integer`):

Tokens repeated between consecutive chunks so sentences are not cut off from their context.

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

One free row per channel with title, description, subscribers and verified flag.

## `maxConcurrency` (type: `integer`):

Pages within one channel are always read one by one, politely.

## Actor input object example

```json
{
  "channels": [
    "durov",
    "https://t.me/bbcrussian"
  ],
  "maxPostsPerChannel": 100,
  "includeKeywords": [],
  "excludeKeywords": [],
  "languages": [],
  "minChars": 1,
  "includeForwarded": true,
  "outputFormat": "posts",
  "chunkTokens": 400,
  "chunkOverlapTokens": 40,
  "includeChannelInfo": true,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

Posts or RAG chunks, channel info rows and error rows.

## `summary` (type: `string`):

Counts per status for this run (SUMMARY record).

# 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",
        "https://t.me/bbcrussian"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("henrycrawl/telegram-channel-rag").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",
        "https://t.me/bbcrussian",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("henrycrawl/telegram-channel-rag").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",
    "https://t.me/bbcrussian"
  ]
}' |
apify call henrycrawl/telegram-channel-rag --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,henrycrawl/telegram-channel-rag"
        }
    }
}
```

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/K5yHCTh94XUXvQPmF/builds/qHUszwOm7WsTQafLx/openapi.json
