# Telegram Like Scraper (`i-scraper/telegram-like-scraper`) Actor

⚡️ Telegram Like Scraper: Extract likes from posts from Telegram channels.

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

## Pricing

from $5.00 / 1,000 one post statistics

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

## Telegram Like Scraper

> 📊 Powerful Apify Actor for extracting **like statistics, reactions, and view counts** from Telegram channel messages.

**Telegram Like Scraper** automatically downloads engagement metrics (likes, emoji reactions, views) from channel messages you specify, tracking all reaction types including custom emojis and paid Star reactions.

***

### 1. Key Features & Use Cases

- 📊 **Complete Engagement Analytics** — track all reaction types (❤️ 👍 🔥 😍 🎉), view counts, and Star reactions to measure content performance and audience sentiment.
- 🎯 **Competitor Research** — compare reaction patterns across multiple channels to benchmark your content strategy against competitors.
- � **Content Optimization** — identify which posts generate the most engagement by analyzing reaction-to-view ratios and emoji sentiment.
- � **Market Research** — collect reaction data from thousands of messages for sentiment analysis, trend detection, and audience behavior studies.
- 💎 **Premium Features** — access custom emoji reactions and paid Star reactions leaderboard to understand super-fan engagement.
- ⚡ **Enterprise-Ready** — process multiple channels concurrently with automatic rate limiting, retry logic, and session management.

***

### 2. Input configuration

#### Example Configuration

```json
{
  "channels": [
    "@durov",
    "https://t.me/telegram"
  ],
  "historyFrom": "2025-01-01T00:00:00Z",
  "historyTo": "2025-01-31T23:59:59Z",
  "limit": 1000,
  "telegramSession": "${{ TELEGRAM_SESSION }}",
  "telegram2faPassword": "${{ TELEGRAM_2FA_PASSWORD }}"
}
```

Parameters explained:

- `channels` *(array, required)* — Telegram channel identifiers accepted in any of the following forms:
  - `@channel`
  - `https://t.me/channel` *(public)*
  - Channel username without @ symbol
- `historyFrom` *(string, required)* — ISO-8601 timestamp. Messages **older** than this value are skipped.
- `historyTo` *(string, optional)* — ISO-8601 timestamp. Messages **newer** than this value are skipped. Defaults to current date.
- `limit` *(integer, optional, default **1000**)* — maximum number of messages to fetch **per channel**.
- `telegramSession` *(string, optional)* — pass a session string directly instead of using the secret.
- `telegram2faPassword` *(string, optional)* — account password if two-factor authentication is enabled.

***

### 3. Running the Actor

1. Open **Telegram Like Scraper** on Apify.
2. Add one or more channels to scrape.
3. Set the date range (`historyFrom` and optionally `historyTo`).
4. Click **Run** and open the **Logs** tab.
5. If you didn't provide a session string, a QR code will appear. In the Telegram app open **Settings → Devices → Link Desktop Device** and scan the QR code.
6. If Telegram prompts for a password after scanning the QR (two-factor authentication), stop the run, open the input section and fill **Telegram 2FA password** (or set the secret `TELEGRAM_2FA_PASSWORD`) and start the Actor again.
7. (Optional) Copy the session string shown in the logs and store it as `TELEGRAM_SESSION` for future runs.

***

### 4. Output dataset

The actor produces message records with like and reaction statistics in the **default dataset**:

#### Message Record

```json
{
  "channel": "durov",
  "message_id": 123,
  "date": "2025-01-15T14:23:10+00:00",
  "text": "Check out this amazing feature!",
  "views": 15420,
  "reactions": {
    "total_reactions": 342,
    "can_see_list": false,
    "reactions_as_tags": false,
    "reactions": [
      {
        "type": "emoji",
        "emoji": "❤️",
        "count": 150
      },
      {
        "type": "emoji",
        "emoji": "👍",
        "count": 89
      },
      {
        "type": "emoji",
        "emoji": "🔥",
        "count": 67
      },
      {
        "type": "custom_emoji",
        "emoji": "5368324170671202286",
        "count": 23
      },
      {
        "type": "paid",
        "emoji": null,
        "count": 13
      }
    ],
    "top_reactors": [
      {
        "peer_id": null,
        "count": 5,
        "is_top": true,
        "anonymous": true
      }
    ]
  }
}
```

**Field descriptions:**

- `channel` — channel username
- `message_id` — unique message identifier
- `date` — message publication date in ISO-8601 format
- `text` — message text content (can be null for media-only posts)
- `views` — number of views the message received
- `reactions.total_reactions` — sum of all reaction counts
- `reactions.reactions` — array of reaction objects with type, emoji/document_id, and count
- `reactions.top_reactors` — leaderboard of top reactors (for paid Star reactions)

Download results in **JSON**, **CSV**, **Parquet** and more via Apify API or UI.

***

### 5. FAQ

**Q: What types of reactions can this scraper track?**\
A: The scraper tracks three types of reactions:

- **Emoji reactions** (❤️, 👍, 🔥, 😍, 🎉, etc.)
- **Custom emoji reactions** (premium channel custom emojis, returned as document IDs)
- **Paid reactions** (Star-based reactions with top reactors leaderboard)

**Q: Can I see who left each reaction?**\
A: No. Due to Telegram's privacy protection, reaction authors are anonymous in channels. The scraper only collects aggregate statistics (counts and types), not individual user identities.

**Q: I see FloodWaitError in logs — did the run fail?**\
A: No. The actor automatically waits the required time and resumes. You will only see a warning.

**Q: Can I scrape reactions from private channels?**\
A: Yes, but your Telegram account must have access to the channel. Provide a valid session string for an account that is a member of the channel.

**Q: Does the `limit` apply per channel or globally?**\
A: The `limit` is **per channel** — each channel specified in the `channels` array can fetch up to `limit` messages.

**Q: What if a message has no reactions?**\
A: The message record will still be saved with `reactions: null` or an empty reactions object.

**Q: Is it safe to provide `telegramSession` and `telegram2faPassword`?**\
A: Both values are stored in Apify **Secrets**; they never appear in logs and cannot be read by other actors. A session string only grants access to act as your account, and the 2FA password is used once during the sign-in flow. Recommended practices:\
• keep both values exclusively in Secrets;\
• regenerate / update the session string whenever you change your Telegram password;\
• you can revoke access at any moment in Telegram settings by logging out the linked device.

**Q: What is the difference between view count and reaction count?**\
A: **Views** show how many times the message was viewed (reach metric). **Reactions** show how many users engaged with the message by leaving a like or emoji reaction (engagement metric). Views are typically much higher than reactions.

***

### 6. Related Telegram Scrapers

Looking for more Telegram data extraction tools? Check out our complete suite:

- 🔗 **[Telegram Channels Scraper](https://apify.com/i-scraper/telegram-channels-scraper)** — extract complete message history from public Telegram channels.
- 💬 **[Telegram Comments Scraper](https://apify.com/i-scraper/telegram-comments-scraper)** — download comments from channel posts with flexible filtering options.
- 👥 **[Telegram Groups Scraper](https://apify.com/i-scraper/telegram-groups-scraper)** — scrape message history from Telegram groups (including private invite links).

***

### 7. Support & contributions

Found a bug or have a feature request? Feel free to open an issue or submit a pull request. We're happy to discuss ideas like additional metrics, filters or export formats.

***

⭐️ Launch **Telegram Like Scraper** today and turn Telegram engagement metrics into valuable data for analytics, sentiment analysis and research!

# Actor input Schema

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

Telegram channel usernames or links to scrape likes and reactions from.

## `historyFrom` (type: `string`):

Start date for message scraping (inclusive).

## `historyTo` (type: `string`):

End date for message scraping (inclusive). Leave empty for current date.

## `limit` (type: `integer`):

Maximum number of messages to fetch per channel. Leave empty for no limit.

## `telegramSession` (type: `string`):

Optional session string to skip QR login.

## `telegram2faPassword` (type: `string`):

Password for accounts with 2FA enabled.

## Actor input object example

```json
{
  "channels": [
    "@durov"
  ],
  "historyFrom": "2025-01-01",
  "limit": 1000
}
```

# Actor output Schema

## `messagesWithReactions` (type: `string`):

Dataset containing Telegram channel messages with view counts, reaction breakdowns (emoji, custom emoji, paid), and top reactor information.

# 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": [
        "@durov"
    ],
    "historyFrom": "2025-01-01",
    "limit": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("i-scraper/telegram-like-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": ["@durov"],
    "historyFrom": "2025-01-01",
    "limit": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("i-scraper/telegram-like-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": [
    "@durov"
  ],
  "historyFrom": "2025-01-01",
  "limit": 1000
}' |
apify call i-scraper/telegram-like-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,i-scraper/telegram-like-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/NnSqUuI8SW7hoCMuz/builds/FwsbtJ1XIJkzuoFvD/openapi.json
