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

Scrape posts from any public Telegram channel: text, view counts, timestamps, photos, videos and links. Also returns channel subscriber counts. No API key, no phone number, no login.

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

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Telegram Channel Scraper

Posts from **any public Telegram channel** — text, view counts, timestamps, media and links.

**No API key. No phone number. No login. No bot token.**

Most Telegram scrapers need a phone number and an API hash from my.telegram.org, or a bot that must first be added to the channel. This one reads Telegram's own public web preview, so you just give it a channel name.

### What you get

| Field | Description |
|---|---|
| `channel` / `post_id` / `url` | Which post, and a permalink |
| `datetime` | ISO 8601 publish time |
| `text` | Full post text, HTML stripped, line breaks preserved |
| `views` | View count, parsed to a number (`11.4M` → `11400000`) |
| `media_type` | `text`, `photo`, `video`, `document`, `voice` or `poll` |
| `photo_urls` / `video_urls` / `video_duration` | Media attached to the post |
| `links` | Every URL in the post body |
| `is_forwarded` / `forwarded_from` | Whether it was forwarded, and from where |
| `reply_to_url` | The post it replies to |

Channel mode returns `title`, `description`, `subscribers`, `photos`, `videos`, `links` and `avatar_url`.

### Who uses this

- **Crypto & trading** — monitor signal, airdrop and announcement channels
- **News monitoring** — Telegram breaks stories before mainstream feeds
- **Brand & competitor monitoring** — track mentions and campaigns
- **OSINT & research** — public channel archives with view counts
- **Content analysis** — which posts actually get views

### Input

```json
{
  "channels": ["telegram", "@durov", "https://t.me/bloomberg"],
  "mode": "posts",
  "maxPostsPerChannel": 200
}
```

| Option | Default | Notes |
|---|---|---|
| `channels` | `["telegram"]` | Any format: `name`, `@name`, `t.me/name`, `t.me/s/name` |
| `mode` | `posts` | `posts` or `channels` |
| `maxPostsPerChannel` | `100` | Newest first, 20 per request |
| `minPostId` | – | Stop at this post ID — see below |
| `includeChannelInfo` | `false` | Adds a channel row and stamps posts with title + subscribers |

#### Fetching only what's new

Save the highest `post_id` from a run and pass it as `minPostId` next time. The Actor stops as soon as it reaches that post, so a daily run only pays for genuinely new content.

### Notes

- **Only public broadcast channels are readable.** Private channels, groups, bots and user accounts have no public preview — Telegram simply does not expose them, and this Actor does not attempt to reach them. Those names are reported and skipped.
- View counts are approximate above 1,000 — Telegram itself rounds them (`11.4M`), and that rounding is preserved in the parsed number.
- Large runs should raise `maxPostsPerChannel` **and** the run timeout together. If the run would exceed its timeout, the Actor stops cleanly and keeps everything collected so far rather than failing.

### Pricing

Pay per event:

- `post` — one channel post
- `channel` — one channel profile row

# Actor input Schema

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

Public channel names. Accepts any format: durov, @durov, t.me/durov or https://t.me/s/durov. Private channels, groups and bots are not accessible.

## `mode` (type: `string`):

posts = one row per post. channels = one row per channel with subscriber count, description and media totals.

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

Posts are collected newest-first, 20 per request, until this limit is reached or the channel runs out.

## `minPostId` (type: `integer`):

Stop once a post with this ID or lower is reached. Use the highest post\_id from your last run to fetch only what is new.

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

Also emit one channel row per channel, and stamp each post with the channel title and subscriber count. Costs one extra request per channel.

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

Optional. Telegram is reachable without a proxy; enable this for very large runs.

## Actor input object example

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

# 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("straightforward_hydra/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("straightforward_hydra/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 straightforward_hydra/telegram-channel-scraper --silent --output-dataset

```

## MCP server setup

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