# Telegram Channel Scraper — $0.05/1K · Posts & History (`apivault_labs/telegram-public-channels-scraper`) Actor

Export public Telegram channel posts with text, dates, links, media references and approximate views/reactions. Older-page traversal, filters and continuation. $0.05/1K delivered posts plus resources; no login or private groups.

- **URL**: https://apify.com/apivault_labs/telegram-public-channels-scraper.md
- **Developed by:** [Apivault Labs](https://apify.com/apivault_labs) (community)
- **Categories:** Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.05 / 1,000 useful public channel post delivereds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — public posts and structured data](https://raw.githubusercontent.com/apivault-labs/apivault-labs/fca996ae1a890302acb6252fb0cf75992cc0d343/assets/telegram-public-channels-scraper/readme-cover-generated-v1.png)

## Telegram Channel Scraper — public posts and paginated history

Collect the posts exposed by public Telegram channel previews at **t.me/s**. Export visible post text, UTC publication dates, links, media references and available views and reactions into a Dataset for CSV, JSON and API workflows. No Telegram account, phone number, bot token or external API subscription is required.

Use it for channel research, editorial monitoring, link discovery and analysis of your own public channels. Older pages are followed using Telegram's real `before` cursor. This is a public preview collector: source gaps, deleted posts and restricted previews prevent a promise of complete history.

### Quick start: five posts

```json
{"channels":["telegram"],"maxPostsPerChannel":5,"maxResults":5}
```

Run the Actor, open **Post Dataset**, and export CSV or JSON. Open **SUMMARY**, **COVERAGE**, **ERRORS** and **CHANNELS** in the run's key-value store to understand what was scanned and why collection stopped. Missing data is represented by `null` or an empty collection, not an invented zero.

**Price: $0.05 per 1,000 useful delivered posts on every plan, plus Apify resources.** There is no startup event, channel profile event or filtered-post event. Resource use still costs money when no post matches. Set both the run spending limit and reasonable page/result/time limits.

### What this Telegram scraper collects

| Capability | Result and boundary |
|---|---|
| Multiple public channels | Handles, @handles and public channel URLs; equivalent inputs are deduplicated |
| Public post history | Latest visible posts, then older preview pages; newest post ID first within each channel |
| Text and links | Visible text with line breaks; HTTP/HTTPS links in the post body |
| Publication date | ISO UTC date from the post permalink's time element, separate from video duration |
| Views and reactions | Raw source labels plus approximate numbers; custom emoji identifiers retained when exposed |
| Media | Public photo/video/audio references and thumbnails when exposed; files are not downloaded |
| Filters | Inclusive UTC date range and case-insensitive keyword OR filter on visible text |
| Continuation | Per-channel `nextBefore` in COVERAGE; copy into a separate single-channel run |
| Diagnostics | Coverage, profile context and source errors outside the paid post Dataset |

### Useful inputs

#### Compare channels

```json
{"channels":["telegram","https://t.me/s/durov"],"maxPostsPerChannel":50,"maxResults":100,"maxConcurrency":2}
```

Each row contains a channel identity. Concurrent channels can interleave; sort by channel/postId or publishedAt after export. Post IDs determine traversal order; dates are output and filter values, not a guarantee that every source date is monotonically ordered.

#### Find posts containing any phrase

```json
{"channels":["telegram"],"keywords":["update","privacy"],"maxPostsPerChannel":20,"maxPagesPerChannel":25}
```

Filters apply to the pages actually scanned. A rare keyword can produce fewer rows or no rows. This does not prove the phrase is absent from all channel history.

#### Read a date range

```json
{"channels":["durov"],"dateFrom":"2026-01-01","dateTo":"2026-12-31","maxPostsPerChannel":100,"maxPagesPerChannel":30}
```

`dateTo` without a time includes that whole UTC day. Old date ranges may require a known cursor or more pages. This version scans backward; it does not perform a binary date search.

#### Continue older history

```json
{"channels":["telegram"],"beforePostId":400,"maxPostsPerChannel":100,"maxResults":100}
```

The numeric cursor is illustrative; use your channel's `COVERAGE.nextBefore`. It is **exclusive**: the previous last scanned/delivered post is not requested again. Continue channels separately because their IDs are independent. Retain `(channel,postId)` in your own database and deduplicate across separate runs. The Actor does not maintain a persistent cross-run monitoring state or guarantee exactly-once delivery across crashes.

#### Increase collection with explicit caps

```json
{"channels":["telegram","durov"],"maxPostsPerChannel":1000,"maxResults":2000,"maxPagesPerChannel":100,"maxConcurrency":2,"maxRunSeconds":1800}
```

The accepted upper bounds are 1,000 channel inputs, 10,000 delivered posts per channel, 100,000 posts per run, 500 pages per channel and five concurrent channels. These are safety bounds, not measured throughput or source availability promises. A short channel can end before the requested count. Start small, inspect coverage and costs, then raise caps.

### All settings

| Input | Default | Meaning |
|---|---|---|
| `channels` | `telegram` at runtime | 1–1000 public usernames or channel URLs; UI prefilled with telegram |
| `keywords` | `[]` | Up to30 nonempty phrases, max200 characters each; any phrase matches visible text |
| `dateFrom` | unset | ISO date/time, inclusive; timezone omitted means UTC |
| `dateTo` | unset | ISO date/time, inclusive; a date alone includes the whole day |
| `beforePostId` | unset | Exclusive older-history cursor; only one valid channel |
| `maxPostsPerChannel` | 100 | Delivered post cap per channel, 1–10000 |
| `maxResults` | 1000 | Shared delivered post cap, 1–100000 |
| `maxPagesPerChannel` | 100 | Source page cap per channel, 1–500 |
| `maxConcurrency` | 3 | Channels in parallel, 1–5; pages within a channel remain sequential |
| `maxRunSeconds` | 900 | Collection budget, 10–3300 seconds, checked between requests |

Set the Apify run timeout above `maxRunSeconds` to leave time for in-flight requests, retries and final storage. Defaults use 512MB and a 3600-second Actor timeout. Requests use bounded retries for network failures, 429 and transient server errors. Repeated pages and non-advancing cursors stop collection with diagnostics instead of looping.

### Output fields

| Field | Meaning |
|---|---|
| `channel`, `channelTitle` | Normalized public username and current preview title |
| `postId`, `postUrl` | Numeric post ID and public permalink; identity is channel plus ID |
| `publishedAt` | Source publication timestamp in UTC; this is not the scrape time |
| `text` | Visible post text, nullable for media-only posts |
| `links` | Deduplicated HTTP/HTTPS links inside the visible post text |
| `media` | Available public photo/video/audio references, videoThumbnail, or documentPreview metadata; no file download. documentPreview has title/description/postUrl and url=null because the source exposes no file URL |
| `mediaUnavailable` | Telegram labels some media as unsupported/restricted; may be true even if a thumbnail is exposed |
| `viewsLabel`, `viewsApprox` | Source label, e.g. 1.29M, and approximate numeric conversion |
| `reactions` | Exposed emoji/customEmojiId/isPaid/countLabel/countApprox items; empty if none exposed |
| `metricsAreApproximate` | Always true: rounded source metrics are not exact counters |
| `source`, `scrapedAt` | Public-preview provenance and collection time |

Reaction labels, custom emoji and paid/star reactions differ between channels. A custom emoji ID does not imply a known Unicode emoji. A profile's rounded subscriber count is stored in CHANNELS. No channel member list, personal contact information, commenter profiles or phone numbers are collected.

SUMMARY records delivered rows, fetched pages, filtered/invalid rows, duplicates, errors and elapsed time. COVERAGE records each channel's page count, stop status and continuation cursor. `SOURCE_END` means no older link was exposed in this traversal; it does not prove complete historic coverage. `PAGE_LIMIT`, `CHANNEL_RESULT_LIMIT`, `GLOBAL_STOP` and `BUDGET_LIMIT` indicate bounded collection. Source errors remain in ERRORS. A mixed run may succeed with useful posts and errors; inspect diagnostics. A source-only failure without posts fails the run, while a valid filter producing no matches succeeds.

### Billing and costs

Only useful unique post rows delivered through the SDK's coupled Dataset/event operation use the `post` event. Duplicate, filtered, invalid-input and diagnostic records are not post events. Channel context is not a separate paid event. An uncertain Dataset/billing failure fails the run; it is not silently retried.

The event component is `delivered posts × $0.00005`: 100 posts cost $0.005 in events; 1,000 cost $0.05. Add the actual Apify platform usage shown on the run. This is not an all-inclusive price or a fixed total quote. HTML size, scanned pages, retries and filters change resource cost. No proxy is configured or required by this version; source blocking can still occur. Configure `maxTotalChargeUsd` when launching through the API or the Console's spending limit.

### API, Python and automation

Call the Actor using `apivault_labs~telegram-public-channels-scraper` and your own Apify token. A private candidate is accessible only to its owner until publication. Store tokens as credentials, never in shared input examples.

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("apivault_labs~telegram-public-channels-scraper").call(
    run_input={"channels": ["telegram"], "maxPostsPerChannel": 5},
    max_total_charge_usd=0.10,
)
for post in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(post["channel"], post["postId"], post["publishedAt"])
```

Use `iterate_items()` for paginated Dataset reads. One API request with a default response limit is not a full Dataset download. [Official Python client](https://docs.apify.com/api/client/python/) and [Apify API reference](https://docs.apify.com/api/v2) describe token authentication, runs, Dataset export and key-value records. n8n or Make can call the same API through standard HTTP request nodes and stored credentials. No Telegram-specific verified n8n node, custom Python package or MCP execution is claimed. This pass provides input examples rather than new public Tasks.

### Limits and troubleshooting

Only publicly exposed channel previews are supported. Private groups, invite links, personal profiles, member lists, login-only content, comments and full reply trees are excluded. Forward counts and complete media downloads are not promised. A post may have text plus an unavailable-media warning; the warning is retained. Signed media links can expire or stop working independently of post URLs.

Preview-disabled, removed or renamed channels can redirect or return no preview. These become source errors; they are not fake empty successes or paid placeholder posts. Public groups are rejected when the source identifies members rather than channel subscribers. Rate limits and source markup changes can interrupt history collection. The Actor does not bypass access controls.

**Why fewer posts than requested?** The source ended, a filter excluded posts, a page/time/output/budget cap was hit, or a source error occurred. Read COVERAGE and ERRORS.

**Are views, reactions and subscriber counts exact?** No. Source labels such as K/M are rounded. Preserve the labels when reporting metrics.

**Is this real-time monitoring?** Each run is a snapshot. You can schedule it yourself and deduplicate IDs in your database; persistent monitoring/baselines are not built in.

**Can I collect the complete archive?** Only the older pages exposed by the public preview. Deleted/restricted posts and source gaps remain unavailable.

### Python client and n8n workflow

Use the thin [Python client](https://github.com/apivault-labs/apivault-labs/tree/main/packages/apivault-telegram-public-channels-scraper) or install it from [PyPI](https://pypi.org/project/apivault-telegram-public-channels-scraper/):

```bash
pip install apivault-telegram-public-channels-scraper==0.1.0
```

The client starts this hosted Actor through the Apify API and reads its dataset. An Apify account and your own API token are required. Actor result charges and infrastructure usage follow the current pricing. The client package has no subscription of its own. Set both Actor collection limits and run charge caps; the dataset download limit does not limit paid collection.

[n8n node source and manual workflow](https://github.com/apivault-labs/apivault-labs/tree/main/community-nodes/n8n-nodes-apivault-telegram-public-channels-scraper) are available on GitHub. The workflow is inactive and has no embedded credentials. Its Run operation starts a paid Actor run; Read Existing Run reads a previous run without starting another. npm version0.1.0 currently awaits npm staged-release approval; do not install the placeholder0.0.0-stage as an operational node. npm publication, when approved, does not establish n8n verification or availability in n8n Cloud.

# Changelog

This Actor's version history is a separate document: https://apify.com/apivault_labs/telegram-public-channels-scraper/changelog.md

# Actor input Schema

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

1–1000 public channel usernames, @handles or https://t.me/s/channel URLs. Aliases deduplicated; groups, invites and post URLs excluded.

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

Optional case-insensitive OR filter on visible text. Filtered posts are not post events. More source pages may be needed.

## `dateFrom` (type: `string`):

Optional ISO date/time. A date starts at 00:00 UTC. Filters apply inside the scanned page window.

## `dateTo` (type: `string`):

Optional ISO date/time; YYYY-MM-DD includes the whole UTC day.

## `beforePostId` (type: `integer`):

Optional exclusive older-history cursor. Exactly one valid channel is required. Copy nextBefore from COVERAGE into a new single-channel run.

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

Stops after this many matching useful posts. This is an upper bound, not a completeness promise.

## `maxResults` (type: `integer`):

Shared output cap across all channels, checked before each write.

## `maxPagesPerChannel` (type: `integer`):

Usually about20 source messages per page. Filters still consume page/time resources. Safety limit, not a fixed source page size.

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

Pages within each channel are sequential; different channels may interleave in the Dataset.

## `maxRunSeconds` (type: `integer`):

Checked between source requests. An in-flight request/retry and storage writes can extend the wall time; set the Apify run timeout higher.

## Actor input object example

```json
{
  "channels": [
    "telegram"
  ],
  "keywords": [],
  "maxPostsPerChannel": 100,
  "maxResults": 1000,
  "maxPagesPerChannel": 100,
  "maxConcurrency": 3,
  "maxRunSeconds": 900
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

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

No description

## `coverage` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `channels` (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("apivault_labs/telegram-public-channels-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("apivault_labs/telegram-public-channels-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 apivault_labs/telegram-public-channels-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apivault_labs/telegram-public-channels-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/twNJt78gEvyWYoyOk/builds/g1nWfUEPxI4m0xrTX/openapi.json
