# Telegram Public Channel History Exporter

**Use case:** 

Export historical posts, view counts, reactions, links, and media URLs from any public Telegram channel (t.me/s/) to JSON, CSV, or Excel with automatic backwards pagination and date cutoff.

## Input

```json
{
  "channels": [
    "durov",
    "telegram"
  ],
  "maxMessagesPerChannel": 200,
  "sinceDate": "2026-01-01",
  "keywords": [],
  "onlyNewSinceLastRun": false,
  "monitorStateName": "default",
  "includeMediaUrls": true,
  "concurrency": 3,
  "requestDelayMs": 300,
  "timeoutMs": 15000
}
```

## Output

```json
{
  "channel": {
    "label": "Channel",
    "format": "text"
  },
  "channelTitle": {
    "label": "Title",
    "format": "text"
  },
  "messageId": {
    "label": "Msg ID",
    "format": "number"
  },
  "publishedAt": {
    "label": "Published",
    "format": "date"
  },
  "text": {
    "label": "Message Text",
    "format": "text"
  },
  "viewsNum": {
    "label": "Views",
    "format": "number"
  },
  "hasPhoto": {
    "label": "Photo",
    "format": "boolean"
  },
  "hasVideo": {
    "label": "Video",
    "format": "boolean"
  },
  "forwardedFrom": {
    "label": "Forwarded From",
    "format": "text"
  },
  "postUrl": {
    "label": "Post URL",
    "format": "link"
  },
  "isNewSinceLastRun": {
    "label": "New",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Telegram Public Channel Scraper & Incremental Monitor Actor is ready to run with the inputs already set for "Telegram Public Channel History Exporter". [Sign up or log in](https://console.apify.com/create-task-from-example/e69maQuYPppdglFgh) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Telegram Public Channel History Exporter" task

The Telegram Public Channel Scraper & Incremental Monitor Actor will start running based on the input automatically. You can also change all the input fields, like public telegram channels, max messages per channel, and more, to match your specific use case.

### 3. Receive the "Telegram Public Channel History Exporter" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as channel, title, msg id, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Telegram Public Channel History Exporter" task via API](https://apify.com/clearstack-data/telegram-public-channel-monitor.md).

## FAQ

### What types of data does the Telegram Public Channel History Exporter task retrieve?

The Telegram Public Channel History Exporter task retrieves historical posts, view counts, reactions, media URLs, links, and subscriber counts from public Telegram channels.

### What output format options are available for the exported data?

The Telegram Public Channel History Exporter task allows exported data to be delivered in JSON, CSV, or Excel formats.

### What is the purpose of the 'onlyNewSinceLastRun' input field?

The 'onlyNewSinceLastRun' input field enables the task to output only new messages published since the last execution, which is useful for monitoring updates.

### How does the task handle pagination for retrieving older messages?

The task handles pagination by automatically walking backwards through messages up to a maximum of 2,000 posts or until a specified date cutoff.

### What kind of channels can this task scrape and monitor?

The task can scrape and monitor all public Telegram channels with web preview enabled, accessible via URLs like 't.me/s/<channel>'.

### What is the significance of the 'includeMediaUrls' input?

The 'includeMediaUrls' input determines whether the task extracts and includes URLs of images and videos in the output.

## About this Actor

This example demonstrates how to use [Telegram Public Channel Scraper & Incremental Monitor](https://apify.com/clearstack-data/telegram-public-channel-monitor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/clearstack-data/telegram-public-channel-monitor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/clearstack-data/telegram-public-channel-monitor.md

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`).
