# Telegram Channel Messages Scraper (`maximedupre/telegram-channel-messages-scraper`) Actor

Get public Telegram channel messages from channel URLs, t.me/s archive links, @handles, bare handles, or direct post URLs. Start with the prefilled channel for a small test run. Private /c/ links, invite-only channels, DMs, and Telegram login are not supported.

- **URL**: https://apify.com/maximedupre/telegram-channel-messages-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media, Automation
- **Stats:** 4 total users, 2 monthly users, 99.7% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.25 / 1,000 telegram messages

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

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Messages Scraper

Telegram Channel Messages Scraper gets public posts from [Telegram](https://telegram.org/) channels and saves them as clean dataset rows. Paste a `t.me` channel URL, `t.me/s` archive URL, @handle, bare handle, or direct public post URL to collect message text, dates, source links, views, replies when visible, reactions when visible, links, hashtags, and media metadata.

No Telegram login, phone number, cookies, or API key is needed. The actor is built for public channel archives, so you can start with a small run, check the rows, then use the same input through the Apify API, scheduler, integrations, or dataset export.

### What This Telegram Scraper Does

Use this actor when you need a Telegram message scraper for public channel content, not private chats or member lists. It reads public channel message pages and saves one row per message, with enough context to use the data in monitoring, research, reporting, or downstream analysis.

Good use cases include:

- Track public Telegram channel posts for news, product updates, crypto announcements, community monitoring, or market research.
- Export recent Telegram channel messages to JSON, CSV, Excel, or another Apify dataset format.
- Collect source message URLs so each row can be checked back on Telegram.
- Pull links, hashtags, visible engagement, and media metadata without copying posts by hand.
- Schedule repeat runs to keep a public channel dataset fresh.

### Data You Can Get

Each Telegram channel message row can include:

- `channelUsername` and `channelUrl`
- `messageId`, `messageUrl`, and `sourceUrl`
- `date` and `scrapedAt`
- `text`
- `views` and `viewsText`
- `replyCount` when Telegram shows it
- `reactions` when Telegram shows them
- `hashtags` and `urls`
- `media` metadata for public photos, videos, or documents when Telegram exposes it
- `inputTarget`, `normalizedTarget`, `position`, and `rawMessageId`

Some fields can be empty. Telegram does not show every engagement or media field on every public message, so the actor keeps those values as `null`, `{}`, or `[]` instead of guessing.

### How To Run It

1. Add one or more public Telegram channel targets.
2. Set a message limit. The default is 50 messages.
3. Keep media metadata on if you want media type and source URL fields.
4. Run the actor and open the dataset.

For a quick test, use:

```json
{
	"targets": ["https://t.me/durov"],
	"maxMessages": 25,
	"mediaMode": "metadata"
}
````

You can also use the same input with the Apify API, webhooks, schedules, or integrations.

### Input

The `targets` field accepts these public Telegram target forms:

- `https://t.me/durov`
- `https://t.me/s/durov`
- `@durov`
- `durov`
- `https://t.me/durov/500`

Use `maxMessages` to cap saved rows and keep the run small. Use `dateFrom` and `dateTo` when you only want messages in a date range. Use `sortOrder` to save rows newest first or oldest first.

Private `/c/` links, invite-only channels, private chats, DMs, and member scraping are not part of this actor.

### Output Example

```json
{
	"inputTarget": "https://t.me/durov",
	"normalizedTarget": "https://t.me/durov",
	"channelUsername": "durov",
	"channelUrl": "https://t.me/durov",
	"messageId": "500",
	"messageUrl": "https://t.me/durov/500",
	"sourceUrl": "https://t.me/s/durov",
	"position": 1,
	"date": "2026-04-24T19:32:04+00:00",
	"text": "Public message text...",
	"views": 7570000,
	"viewsText": "7.57M",
	"forwards": null,
	"replyCount": null,
	"reactions": {},
	"hashtags": [],
	"urls": [],
	"media": [],
	"rawMessageId": "durov/500",
	"scrapedAt": "2026-05-21T17:23:48.968Z"
}
```

### Pricing

This actor uses pay-per-event pricing. You pay for each Telegram message row saved to the dataset, plus the standard Actor start event shown on the Actor page before you run it. Keep `maxMessages` low for a small first run.

### Limits And Caveats

This actor works with public Telegram channel message pages. It does not log in to Telegram, join private channels, read private chats, scrape members, or monitor messages in real time.

Telegram may hide or omit some fields. For example, reply counts, reactions, and media URLs are saved only when they are visible in the public page. Media metadata is not the same as guaranteed long-term file hosting.

### FAQ

#### Can I scrape private Telegram channels?

No. This actor is for public Telegram channel messages only. Private `/c/` links, invite-only channels, private chats, and DMs are not supported.

#### Do I need Telegram cookies or an API key?

No. Add public channel URLs or handles and start the run.

#### Can I scrape Telegram groups?

This actor is focused on channel messages. Some public Telegram pages may look similar, but group scraping is not the product contract here.

#### Can I download media files?

This actor saves media metadata when Telegram exposes it. For a media-first workflow, use a dedicated Telegram media downloader.

# Actor input Schema

## `targets` (type: `array`):

Paste one public Telegram channel target per row. Works with channel URLs, t.me/s archive URLs, @handles, bare handles, and direct public post URLs.

## `maxMessages` (type: `integer`):

Maximum number of Telegram message rows to save across the run. Lower this for a quick test.

## `sortOrder` (type: `string`):

Save rows newest first or oldest first after the requested messages are collected.

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

Optional ISO date or date-time. Saves only messages at or after this date.

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

Optional ISO date or date-time. Saves only messages at or before this date.

## `mediaMode` (type: `string`):

Choose whether message rows include public media metadata, such as media type and source URLs when Telegram exposes them.

## `includeReactions` (type: `boolean`):

Save visible Telegram reaction counts when they appear on public messages.

## `includeExtractedEntities` (type: `boolean`):

Save URLs and hashtags found in message text and Telegram markup.

## Actor input object example

```json
{
  "targets": [
    "https://t.me/durov"
  ],
  "maxMessages": 50,
  "sortOrder": "newest_first",
  "dateFrom": "2026-01-01",
  "mediaMode": "metadata",
  "includeReactions": true,
  "includeExtractedEntities": true
}
```

# Actor output Schema

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

Open the dataset with one row per public Telegram channel message.

# 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 = {
    "targets": [
        "https://t.me/durov"
    ],
    "dateFrom": "2026-01-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/telegram-channel-messages-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 = {
    "targets": ["https://t.me/durov"],
    "dateFrom": "2026-01-01",
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/telegram-channel-messages-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "targets": [
    "https://t.me/durov"
  ],
  "dateFrom": "2026-01-01"
}' |
apify call maximedupre/telegram-channel-messages-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/telegram-channel-messages-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Telegram Channel Messages Scraper",
        "description": "Get public Telegram channel messages from channel URLs, t.me/s archive links, @handles, bare handles, or direct post URLs. Start with the prefilled channel for a small test run. Private /c/ links, invite-only channels, DMs, and Telegram login are not supported.",
        "version": "0.0",
        "x-build-id": "CAQmbBlmoouoKU1qL"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~telegram-channel-messages-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-telegram-channel-messages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/maximedupre~telegram-channel-messages-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-telegram-channel-messages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/maximedupre~telegram-channel-messages-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-telegram-channel-messages-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "targets"
                ],
                "properties": {
                    "targets": {
                        "title": "Telegram channels",
                        "minItems": 1,
                        "maxItems": 500,
                        "type": "array",
                        "description": "Paste one public Telegram channel target per row. Works with channel URLs, t.me/s archive URLs, @handles, bare handles, and direct public post URLs.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "maxMessages": {
                        "title": "Messages to save",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of Telegram message rows to save across the run. Lower this for a quick test.",
                        "default": 50
                    },
                    "sortOrder": {
                        "title": "Save order",
                        "enum": [
                            "newest_first",
                            "oldest_first"
                        ],
                        "type": "string",
                        "description": "Save rows newest first or oldest first after the requested messages are collected.",
                        "default": "newest_first"
                    },
                    "dateFrom": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Optional ISO date or date-time. Saves only messages at or after this date."
                    },
                    "dateTo": {
                        "title": "End date",
                        "type": "string",
                        "description": "Optional ISO date or date-time. Saves only messages at or before this date."
                    },
                    "mediaMode": {
                        "title": "Media metadata",
                        "enum": [
                            "none",
                            "metadata"
                        ],
                        "type": "string",
                        "description": "Choose whether message rows include public media metadata, such as media type and source URLs when Telegram exposes them.",
                        "default": "metadata"
                    },
                    "includeReactions": {
                        "title": "Include reactions",
                        "type": "boolean",
                        "description": "Save visible Telegram reaction counts when they appear on public messages.",
                        "default": true
                    },
                    "includeExtractedEntities": {
                        "title": "Extract links and hashtags",
                        "type": "boolean",
                        "description": "Save URLs and hashtags found in message text and Telegram markup.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
