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

- **URL**: https://apify.com/backhoe/telegram-channel-scraper.md
- **Developed by:** [D](https://apify.com/backhoe) (community)
- **Categories:** Social media
- **Features:** Full permissions
- **Stats:** 76 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

Scraper for Telegram channels via public interface `t.me/s/` with residential proxy rotation.

### Features

#### Channel Metadata

- Channel name
- Username (@channel)
- Channel description
- Avatar/photo URL
- Subscriber count
- Numeric channel ID
- Statistics: photos, videos, files, links

#### Post Data

- Post ID
- Author
- Message text
- Publication date and time
- View count
- Forwards from other channels
- Replies to posts
- Media: photos, videos (URLs)
- Links in text

### Input Parameters

```json
{
  "channels": [
    "telegram",
    "https://t.me/s/ShrikeNews",
    "shtuchka_intelekt"
  ],
  "max_posts": 100,
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "rotate_proxy_per_request": true
}
```

#### Parameters:

- **channels** (required): Array of Telegram channels to scrape. Accepts:
  - Username (e.g., `"telegram"`)
  - Full URL (e.g., `"https://t.me/ShrikeNews"`)
  - Public URL (e.g., `"https://t.me/s/channel"`)
- **max_posts** (default: 100): Maximum number of posts to scrape **per channel**
- **proxy_configuration** (default: RESIDENTIAL): Apify Proxy settings
  - By default uses residential proxy
- **rotate_proxy_per_request** (default: true): Rotate proxy for each request

### Output Data

The actor returns an **array of channel objects**, one for each channel scraped. Each object contains:

- Channel metadata
- Array of posts (`last_posts`)

Example output (array with 2 channels):

```json
[
  {
    "url": "https://t.me/s/ShrikeNews",
    "channel_username": "ShrikeNews",
    "channel_id": 1505028797,
    "channel_title": "Shrike News",
    "channel_description": "News that I find interesting...",
    "subscribers": 94500,
    "photos_count": 12100,
    "videos_count": 4090,
    "last_posts": [
      {
        "channel": "ShrikeNews",
        "post_id": "26982",
        "author": "Shrike News",
        "text": "Don't get confused...",
        "datetime": "2025-12-03T19:25:46+00:00",
        "views": 39900,
        "photos": ["https://cdn4.telesco.pe/file/..."],
        "links": ["https://t.me/ShrikeNews/26981"]
      }
    ]
  },
  {
    "url": "https://t.me/s/telegram",
    "channel_username": "telegram",
    "channel_id": 1234567890,
    "channel_title": "Telegram",
    "subscribers": 500000,
    "last_posts": [...]
  }
]
```

### Memory Settings

**Recommended: 128 MB**

The actor is optimized for minimal memory usage. When running via CLI or API use:

```bash
apify run --memory-mbytes=128
```

### Usage

#### Via Apify Console

1. Open the actor in Apify Console
2. Enter channel list in `channels` field (e.g., `["telegram", "ShrikeNews"]`)
3. Configure other parameters as needed (residential proxy enabled by default)
4. Click Start

#### Via CLI

```bash
## Run locally
apify run --memory-mbytes=128

## Run on Apify platform
apify push
apify call <ACTOR_ID> --memory-mbytes=128
```

#### Via API

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

run_input = {
    "channels": ["ShrikeNews", "telegram", "https://t.me/s/shtuchka_intelekt"],
    "max_posts": 50
}

run = client.actor('<ACTOR_ID>').call(
    run_input=run_input,
    memory_mbytes=128
)

## Get results
dataset = client.dataset(run["defaultDatasetId"])
items = dataset.list_items().items
```

### Key Features

- ✅ **Residential proxies by default** - bypasses blocking
- ✅ **Proxy rotation** - new IP for each request
- ✅ **Realistic headers** - mimics real browser
- ✅ **Complete data extraction** - all available content
- ✅ **Low memory footprint** - runs on 128 MB
- ✅ **Numeric channel ID extraction** - extracts real Telegram channel ID

### Limitations

- Scrapes only public channels
- Post limit determined by `max_posts` parameter
- Requires Apify Residential Proxy for stable operation

# Actor input Schema

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

List of channels to scrape - supports usernames, t.me links, or t.me/s links. Scrape unlimited channels for free! Perfect for bulk data collection, competitor analysis, and audience research.

## `max_posts` (type: `integer`):

Control how many posts to extract from each channel. Higher values = more historical data. Set to 100 for quick snapshots or 1000 for deep analysis. No extra charges for larger datasets!

## `proxy_configuration` (type: `object`):

Enable premium residential proxies for 99.9% success rate and zero blocking. Highly recommended for scraping multiple channels. Included free with Apify - no additional proxy costs!

## `rotate_proxy_per_request` (type: `boolean`):

Get a fresh IP for every HTTP request to maximize anonymity and avoid rate limits. Recommended for large-scale scraping. Free proxy rotation included!

## Actor input object example

```json
{
  "channels": [
    "telegram",
    "https://t.me/s/ShrikeNews",
    "shtuchka_intelekt"
  ],
  "max_posts": 100,
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "rotate_proxy_per_request": true
}
```

# 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",
        "ShrikeNews"
    ],
    "max_posts": 100,
    "proxy_configuration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    },
    "rotate_proxy_per_request": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("backhoe/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",
        "ShrikeNews",
    ],
    "max_posts": 100,
    "proxy_configuration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
    "rotate_proxy_per_request": True,
}

# Run the Actor and wait for it to finish
run = client.actor("backhoe/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",
    "ShrikeNews"
  ],
  "max_posts": 100,
  "proxy_configuration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "rotate_proxy_per_request": true
}' |
apify call backhoe/telegram-channel-scraper --silent --output-dataset

```

## MCP server setup

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