# Telegram Channel Scraper — Public Posts, No Login, $1.5/1k (`leadharbor/telegram-channel-scraper`) Actor

Scrape public Telegram channel posts: text, views, dates, media links. $0.0015/message, no login, no proxy. Recent-history preview pages only.

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

## Pricing

from $0.50 / 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 (Public Preview, No Account Needed)

Give it public Telegram channels. It returns their recent posts: **text, views, date, photo and video links, link previews, forwarded-from, reply link**. It reads the public web preview that Telegram serves at `t.me/s/<channel>`, with plain HTTP. No Telegram account, no login, no cookies, no browser, no proxy.

**Price: $1.50 per 1,000 posts** ($0.0015 each) plus $0.001 per run start. You are charged **only for posts actually returned**. Channels that cannot be read (not found, preview disabled, fetch error) and invalid inputs come back as a row with an `error` field and are **not charged**.

### Limits, stated plainly

- **Public preview only.** This is what Telegram shows on the web without an account. It is not the Telegram API.
- **Recent history.** The scraper walks backwards through the preview with `?before=<id>`. How far back it goes is decided by Telegram, not by this actor; you may get fewer posts than `maxPosts`. The run log shows how many were returned per channel.
- **Channels can disable the preview.** Those, plus channels that do not exist, look the same from outside. Both come back as one error row ("does not exist, is private, or has the web preview disabled").
- **No private channels or groups.** Invite links (`t.me/+...`, `t.me/c/...`) are rejected.
- **No members, no subscriber lists, no comments or replies threads, no reactions.** Not implemented.
- **Views are as Telegram shows them** (for example `1.52M`). `viewsNumber` is that text converted to a number, so it is rounded the same way.
- **Video files:** the preview only exposes a direct video URL for some videos. When it does not, `url` is `null` and `postUrl` links to the post.
- Posts with no text (media only) are returned with `text: null`.
- Telegram can rate-limit. The actor retries a failed page up to 3 times, then stops that channel and reports the error. Posts already returned stay in the dataset.
- Media URLs and video tokens come from Telegram's CDN and may expire. Download what you need soon after the run.

### Input

| Field | What it does |
|---|---|
| `channels` | One per line: `@name`, `name`, or a t.me link (`https://t.me/s/telegram`, `t.me/telegram/441`). Up to 100 per run. Duplicates are removed. |
| `maxPosts` | Posts per channel, 1 to 5,000 (default 100). Newest first. |

Bad input fails the run with a clear message; a single bad entry among good ones becomes an error row.

### Output

One row per post, newest first within each channel:

```json
{
  "channel": "telegram",
  "postId": 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": "1.68M",
  "viewsNumber": 1680000,
  "edited": false,
  "forwardedFrom": null,
  "forwardedFromUrl": null,
  "replyToUrl": null,
  "media": [],
  "linkPreview": {
    "url": "https://telegram.org/blog/welcome-messages-buttons-TG-13",
    "siteName": "Telegram",
    "title": "Welcome Messages, Buttons in Messages and Signed Gifts",
    "description": "Introducing Welcome Messages ..."
  },
  "links": ["https://telegram.org/blog/welcome-messages-buttons-TG-13"],
  "channelTitle": "Telegram News",
  "error": null
}
```

`media` items are `{ "type": "photo" | "video" | "round-video" | "audio", "url", "thumbnail" (video only), "postUrl" }`. Rows for channels that failed look like `{ "channel": "...", "postId": null, "error": "..." }`.

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/leadharbor~telegram-channel-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channels":["telegram","durov"],"maxPosts":50}'
```

### Good to know

- Only data that Telegram shows publicly without an account is read. Check the rules that apply to you (privacy law, Telegram's terms) before processing personal data in posts.

# Actor input Schema

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

One channel per line: @name, name, or a t.me link such as https://t.me/s/telegram. Up to 100 channels per run. Duplicates are removed.

## `maxPosts` (type: `integer`):

Stop after this many posts per channel (1-5000). You are charged only for posts actually returned. Telegram's public preview may expose fewer than this.

## Actor input object example

```json
{
  "channels": [
    "telegram",
    "durov"
  ],
  "maxPosts": 100
}
```

# Actor output Schema

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

One row per post: text, views, date, media links, link preview, forwarded-from. Channels that cannot be read come back as a row with an error.

## `resultsUi` (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",
        "durov"
    ]
};

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

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

```

## MCP server setup

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