# Telegram Comments Scraper: Public Replies & Reactions (`xmolodtsov/telegram-comments-scraper`) Actor

Scrape telegram comments from public channel posts. Export reply text, authors, timestamps, reactions and photos using post URLs, post ranges or recent channel posts.

- **URL**: https://apify.com/xmolodtsov/telegram-comments-scraper.md
- **Developed by:** [GoFetch](https://apify.com/xmolodtsov) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 items

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

Scrape telegram comments from public channel posts and export one row for each discussion reply. Collect comment text, public author details, timestamps, reply relationships, reactions and photo URLs for product feedback analysis, community reporting or research. Supply specific post URLs, an inclusive channel post range, or a channel username and a number of recent posts. This actor reads the anonymous public discussion widget; no Telegram account or credentials are required.

### What data you get

Each result is a real public comment, including media-only comments with empty text. The output includes the original post URL, comment ID and URL, comment text, author name and username when shown, public author and avatar URLs, timestamp, parent comment ID, reactions and attached photo URLs. Every row has the same keys, with null values where the public widget omits a value.

The `threadComments` field is the reported thread count, repeated for context. It is not a promise that every counted comment can be retrieved. Deleted or hidden comments and stale counters can leave small differences. The actor follows the older-comments cursor until it ends or your selected limit is reached. `views` is always null because the widget does not expose per-comment view counts. Post view counts are a different metric and are not added to comment rows.

Authors can be anonymous or have temporarily blank names. These rows remain valid and are saved with nullable author fields. The actor does not visit profiles or enrich contacts. It returns only the information shown in the public discussion widget, without looking up phone numbers or other contact information.

### How to use it

1. Open the actor in [Apify Console](https://console.apify.com/actors).
2. Keep the sample post to try a small export, or enter your public channel post URLs under **Post URLs**.
3. Choose **Maximum results** and **Maximum comments per post**. The sample saves at most 20 comments.
4. Start the run. Open its Dataset tab to review rows or export JSON, CSV, Excel and other supported formats.

The prefilled software-news thread is a small demonstration of the same workflow used for larger exports. To inspect recent posts, remove the sample URL and enter a public channel username such as `unigram`, with `latestPosts` set to the desired number. For a historical slice, set both numeric range fields; the range includes its first and last ID.

You can also start the actor with the [Apify API](https://docs.apify.com/api/v2). Keep your API token in an environment variable:

```bash
curl -X POST \
  'https://api.apify.com/v2/acts/xmolodtsov~telegram-comments-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"postUrls":["https://t.me/unigram/358"],"maxResults":20}'
```

The API returns a run ID and default dataset ID. Wait for the run to finish before downloading its dataset, or use an Apify client to manage that sequence. AI assistants can invoke this actor through Apify's MCP integration; use the same input object and inspect the resulting dataset. See [Apify integrations](https://docs.apify.com/platform/integrations) for connection options.

### Pricing

The billing unit is one unique comment saved to the default dataset. There are no start fees or additional charge events. Duplicate comments encountered during pagination are removed before saving. Empty discussions produce no billable result rows.

| Apify plan | Price per 1,000 results |
| --- | --- |
| FREE | $0.72 |
| BRONZE | $0.65 |
| SILVER | $0.58 |
| GOLD | $0.50 |

At the listed rates, 20 saved comments cost $0.0144 on FREE, $0.0130 on BRONZE, $0.0116 on SILVER or $0.0100 on GOLD. A 1,000-comment run costs $0.50 on GOLD. PLATINUM and DIAMOND use the GOLD rate. Actual charges follow the pricing displayed by Apify, and free-plan credits depend on your account. Set a maximum charge in Console when you want a monetary spending limit; the actor stops before admitting rows beyond that limit.

#### Is it free?

On the Apify free plan, this developer allows **100 results per run and 20 runs per month**, using UTC calendar months. These limits apply alongside available account credits. Paid plans remove this developer free allowance cap, while the result limits you choose still apply. A run refused because the monthly allowance has been used ends successfully without fetching Telegram pages. Free runs use Apify datacenter and ignore custom proxy URLs. Named Apify groups are limited to datacenter groups `SHADER`, `BUYPROXIES94952` and `DATACENTER`; omit groups for automatic datacenter selection. Other named groups, including residential and SERP requests, are rejected before fetching pages, including either group alias (`groups` or `apifyProxyGroups`) in any casing. Country aliases `countryCode` and `apifyProxyCountry` accept uppercase two-letter datacenter country codes. Subdivision routing and tiered proxy options are unsupported. Paid runs may supply HTTP proxy URLs or select direct mode with `useApifyProxy: false`.

### Input

| Field | Purpose and default |
| --- | --- |
| `postUrls` | Up to 5,000 public post URL strings. Default empty array; Console sample Unigram post 358. Empty uses only `channel`. |
| `channel` | Public username, `@username` or public channel URL, optionally `/s/`. Blank disables channel input. |
| `fromPostId` | First ID in an inclusive range. Default 0 means no range; maximum 9,007,199,254,740,991. |
| `toPostId` | Last ID in an inclusive range. Supply both range IDs and a channel. Default 0; maximum ID 9,007,199,254,740,991. Maximum 5,000 IDs per range. |
| `latestPosts` | Inspect this many recent channel posts when no range is supplied. Default 10; minimum 1, maximum 1,000; ignored with a range. |
| `maxCommentsPerPost` | Unique comments saved per thread, including existing rows after restart. Default 200; minimum 1, maximum 5,000. |
| `maxResults` | Saved comments across all posts, including rows already present after a reboot. Default 1,000; Console prefill 20; minimum 1, maximum 100,000. |
| `proxyConfiguration` | Defaults to Apify datacenter. Optional paid-run custom routing. |

Post URLs accept `http://` or `https://`, the public hosts `t.me`, `telegram.me` and `telegram.dog` (also `www.`), and preview links such as `https://t.me/s/unigram/358`. Parameters such as `?single`, `?comment=…`, `?embed=1`, tracking parameters and fragments are removed. Channel URLs accept the same hosts and schemes, without a post ID. Internal `t.me/c/<numeric>/…` links and invite links (`t.me/+…`, `t.me/joinchat/…`) are unsupported because they do not identify a public channel; they fail `invalid:` before quota admission. Numeric limits must be integers; zero is valid only for the two range fields. Null values are invalid. At least one URL or a channel is required.

Post URLs and a channel can be combined. Repeated URLs are normalized and deduplicated. IDs do not have to be consecutive on Telegram: a missing post or a post with comments disabled can return a confirmed empty discussion. A range can therefore produce fewer active threads than the number of requested IDs. There is no keyword search, private-group access or date-range inference.

### Output

This example is a public comment from the sample thread. Long avatar URLs are source-provided and can expire; download media separately if your workflow needs a durable copy.

```json
{
  "postUrl": "https://t.me/unigram/358",
  "commentId": 580534,
  "url": "https://t.me/unigram/358?comment=580534",
  "text": "imagine unigram in rust 👀",
  "authorName": "Reza Nanakar",
  "authorUsername": "GraMint",
  "authorUrl": "https://t.me/GraMint",
  "authorPhotoUrl": "https://cdn4.telesco.pe/file/SxncQx8AlC1sgvjlF-RwksTih7zONh_Rfteepp2bslPivvj_PzAEC3ym4HfXrwzuvQw1tdz5m6tu5DdiUo1aJGnv9OR6cNIx5RX3QtV-8qceXjiAyju1zCW-qaQg-ybnxTlpZsRNJdIMTOEiJY5JoFSJKHeDVf4caopJxTSq2RTuFvY78qgDuGZDuZW4npP_ffAeH-c3PcYnUfzbx0ksmrOiTU6Mw3GIic2vpv1RTFkXFrWt74s09DczQep0I0s_m0jqBrdf-OCKlw36Zbw4UQS5GJl8v8wAtfZpy9q-PCf8U5e1CuwBFWLxpA2Ngakym4cF0UHUF1tE0yrEZQ9T3g.jpg",
  "timestamp": "2026-11-17T13:54:04+00:00",
  "replyToCommentId": null,
  "reactions": [],
  "photos": [],
  "views": null,
  "threadComments": 90,
  "discussionId": "c1060755082_-2746948501853547261"
}
```

![Preview of actual public discussion comment rows](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/telegram-comments-scraper-output.png)

Use `postUrl` with `commentId` as a stable compound key in downstream storage. A comment ID alone may belong to a different discussion. `replyToCommentId` can refer to an older comment outside your selected export limit; it does not guarantee that the parent row is in this dataset. Reaction arrays reflect the widget response at scrape time. An empty array means no displayed reactions or photos were found, rather than an additional lookup being performed.

### Guarantees and failure semantics

Successfully saved comments remain in the dataset if a later request fails. Such runs finish SUCCEEDED with partial results; use the `STATISTICS` record in the run's key-value store to see attempted posts, answered posts, exhausted posts, requests and failure counts. An answered post can be limited; `exhaustedPosts` counts only threads whose final page was fully saved. A resumed run reads existing dataset keys before saving new rows, so already saved comments are not pushed again. Dataset appends are never blindly retried. If an append acknowledgement is lost, scheduling stops, saved keys and counts are reconciled from the default dataset, and the run finishes with partial results or a failure when nothing was saved.

A zero-row run succeeds as “no results” only when the public site confirms an empty answer, such as the observed “Discussion is not available at the moment” response or a missing-channel message. Empty channel previews and other unobserved empty layouts fail as `outdated:`. Unrecognized markup does not count as a valid empty thread. If no rows have been saved and a required input cannot be answered, the run is FAILED with a leading reason token: `blocked:`, `network:`, `timeout:`, `invalid:` or `outdated:`. These indicate an access challenge, transport failure, deadline, invalid input or changed response format respectively.

Requests have bounded timeouts and one retry using a fresh session in the selected proxy mode. The actor processes at most three posts at a time, serializes dataset writes, uses compressed responses, bounds page traversal and reserves time to save statistics before the run timeout. Channel previews are scraped one batch at a time, before discovering the next batch. Successful previews and confirmed-empty posts do not consume a failure budget. Requests stop after three failed source attempts plus one per saved comment; each request has a 20-second timeout and 25-second abort signal. Repeated cursors or pages with no new comment IDs fail `outdated:`. Successful traversal is bounded by your requested post and comment counts and the run deadline. Response caps are 256 KiB compressed and 1 MiB decoded. The deadline or failure budget retains partial results, or fails `timeout:` when no rows were saved. Sparse ranges can cost more compute per result than dense discussions. It does not switch silently to a more expensive proxy class. Public availability and widget format can change; a successful export represents the comments retrievable during that run.

### Integrations

Download datasets directly or connect the actor to Make, n8n, Zapier or your own application through Apify. Use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to start downstream processing after a run finishes. CSV fits a spreadsheet workflow; JSON preserves reaction and photo arrays. For recurring analysis, schedule the actor in Console and upsert using the compound comment key, because separate runs intentionally return matching comments again.

### More scrapers from this developer

**TikTok:** [TikTok Search Scraper](https://apify.com/xmolodtsov/tiktok-search-scraper): Videos and creators for any keyword, pay per result · [TikTok Profile Scraper (Pay Per Result)](https://apify.com/xmolodtsov/tiktok-profile-scraper): Profiles, followers and latest posts by username · [TikTok Comments Scraper](https://apify.com/xmolodtsov/tiktok-comments-scraper): Comments and full reply threads from any video · [TikTok Hashtag Scraper](https://apify.com/xmolodtsov/tiktok-hashtag-scraper): Videos for any hashtag, with views, likes and music · [TikTok Sound & Music Scraper](https://apify.com/xmolodtsov/tiktok-sound-scraper): Videos that use a sound or song · [TikTok Top Ads Scraper](https://apify.com/xmolodtsov/tiktok-top-ads-scraper): Public Creative Center ad rankings, engagement, media and landing pages

**Social & news:** [Reddit Search Scraper](https://apify.com/xmolodtsov/reddit-scraper): Posts by keyword, subreddit or author · [Google News Scraper](https://apify.com/xmolodtsov/google-news-scraper): Google News results as clean full-text articles · [Threads Replies Scraper](https://apify.com/xmolodtsov/threads-replies-scraper): Public post replies, likes, authors and inline nested replies

**Instagram:** [Instagram Reel Scraper](https://apify.com/xmolodtsov/instagram-reel-scraper): Public profile reels, plays, captions, music and media URLs · [Instagram Comment Scraper](https://apify.com/xmolodtsov/instagram-comment-scraper): Public post and reel comments, likes, timestamps and usernames · [Instagram Post Scraper](https://apify.com/xmolodtsov/instagram-post-scraper): Public profile posts, likes, captions, locations and media URLs

**E-commerce:** [Prom.ua Product Search Scraper](https://apify.com/xmolodtsov/prom-ua): Prom.ua product search results, no browser needed · [Amazon Product Search & Bestsellers Scraper](https://apify.com/xmolodtsov/amazon-search-scraper): Search results, category rankings and product details from Amazon · [AliExpress Search Scraper](https://apify.com/xmolodtsov/aliexpress-search-scraper): AliExpress products by keyword with prices, orders and shipping · [AliExpress Product Reviews Scraper](https://apify.com/xmolodtsov/aliexpress-reviews-scraper): Public product reviews, ratings, buyer photos and follow-up feedback

**Maps & leads:** [Google Maps Scraper](https://apify.com/xmolodtsov/google-maps-scraper): Places, leads and emails from Google Maps

**Ads:** [Facebook Ad Library Scraper (Meta Ads Library)](https://apify.com/xmolodtsov/facebook-ads-library-scraper): Ads from the Meta Ad Library, with EU reach and payers · [Google Ads Transparency Scraper](https://apify.com/xmolodtsov/google-ads-transparency-scraper): Google ad creatives by advertiser or domain, with regional details

**Video:** [YouTube Transcript Scraper](https://apify.com/xmolodtsov/youtube-transcript-scraper): Transcripts, subtitles and captions from YouTube videos · [YouTube Shorts Scraper](https://apify.com/xmolodtsov/youtube-shorts-scraper): Shorts of any channel with exact views, likes and duration · [YouTube Channel Scraper](https://apify.com/xmolodtsov/youtube-channel-scraper): Every video of a channel, with channel stats · [YouTube Search Scraper](https://apify.com/xmolodtsov/youtube-search-scraper): Search results and videos for any keyword · [YouTube Comments Scraper](https://apify.com/xmolodtsov/youtube-comments-scraper): Comments, replies and likes from any video · [Bilibili Comments Scraper](https://apify.com/xmolodtsov/bilibili-comments-scraper): Public hot comments and reply threads by video or keyword

**Jobs:** [SEEK Job Listings Scraper](https://apify.com/xmolodtsov/seek-jobs-scraper): Public AU/NZ job listings, salaries and redacted descriptions

### FAQ

#### Why is the exported total smaller than the reported count?

Some counted comments may be deleted, hidden or no longer returned by the widget. Your per-post limit, overall result limit, free allowance or maximum charge can also stop an export early. Pagination stops when the server stops providing an older-comments cursor, even if the displayed count is slightly higher. No synthetic rows are added to fill the gap.

#### Why are author names or usernames null?

Telegram can omit public author names, handles or profile links. A reply without an author name is still a comment. This actor preserves it and does not attempt profile scraping to fill the missing fields.

#### Can I scrape private groups or write replies?

The input must identify public channel posts and the publicly accessible discussion widget. The actor does not accept account sessions, bot tokens, QR login or credentials, and it does not post messages. It reads public comments only.

#### Is it legal to scrape telegram comments?

Use this actor for public data only and assess the rules that apply to your project, including platform terms, GDPR and CCPA. Public author identifiers can still be personal data. Establish an appropriate legal basis, minimize collection, limit retention and honor applicable access or deletion rights. You are responsible for your use of the exported data.

### Support

For reproducible problems, open an issue in this actor's [Apify Issues tab](https://apify.com/xmolodtsov/telegram-comments-scraper/issues). Include the run ID, public post URL, selected limits and expected behavior. Never include an API token or private account information. A run ID lets support inspect the fixed diagnostic counters without asking you to reproduce an expensive export.

# Changelog

This Actor's version history is a separate document: https://apify.com/xmolodtsov/telegram-comments-scraper/changelog.md

# Actor input Schema

## `postUrls` (type: `array`):

Up to 5000 public post links; HTTP(S), t.me, telegram.me, telegram.dog and /s/channel/id forms normalize to https://t.me/channel/id. Query parameters and fragments are removed. Internal t.me/c and invite (+ or joinchat) links are unsupported. Empty array selects only channel input; at least one post or channel is required.

## `channel` (type: `string`):

Optional public channel: bare username, @username or HTTP(S) t.me/telegram.me/telegram.dog channel URL, optionally /s/. Empty disables channel discovery. Internal t.me/c and invite links are unsupported. Combines with postUrls.

## `fromPostId` (type: `integer`):

First positive safe-integer post ID in an inclusive channel range (maximum 9007199254740991). Both range fields default to 0, selecting latestPosts instead. Requires channel and both nonzero IDs; at most 5000 IDs.

## `toPostId` (type: `integer`):

Last positive safe-integer post ID in the inclusive channel range (maximum 9007199254740991). Default 0 selects recent posts when both IDs are 0. Must be at least fromPostId; at most 5000 IDs.

## `latestPosts` (type: `integer`):

Inspect 1–1000 recent public channel posts, default 10. Used only when channel is supplied and both range IDs are 0. Discovery and comment scraping are interleaved; zero is invalid.

## `maxCommentsPerPost` (type: `integer`):

Save 1–5000 unique comments per post, default 200, including already saved rows after restart. Fewer may be retrievable than the reported count. Zero is invalid; media-only comments count.

## `maxResults` (type: `integer`):

Save 1–100000 unique comments across this run, including rows already present after restart; default 1000, Console prefill 20. Zero is invalid. Apify free plan: 100 results per run, 20 runs per month.

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

Apify datacenter only: named groups SHADER, BUYPROXIES94952, DATACENTER, or omit for automatic selection. Other groups including residential (groups or apifyProxyGroups, any casing) and subdivision routing are rejected. Country aliases countryCode/apifyProxyCountry can select datacenter countries. Paid runs may use custom URLs or direct mode. Free runs ignore custom URLs and use default Apify datacenter.

## Actor input object example

```json
{
  "postUrls": [
    "https://t.me/unigram/358"
  ],
  "channel": "",
  "fromPostId": 0,
  "toPostId": 0,
  "latestPosts": 10,
  "maxCommentsPerPost": 200,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Scrape telegram comments from public channel posts. Export reply text, authors, timestamps, reactions and photos using post URLs, post ranges or recent channel posts.

# 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 = {
    "postUrls": [
        "https://t.me/unigram/358"
    ],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xmolodtsov/telegram-comments-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 = {
    "postUrls": ["https://t.me/unigram/358"],
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("xmolodtsov/telegram-comments-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 '{
  "postUrls": [
    "https://t.me/unigram/358"
  ],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call xmolodtsov/telegram-comments-scraper --silent --output-dataset

```

## MCP server setup

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