# 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
- **Stats:** 28 total users, 1 monthly users, 100.0% runs succeeded, NaN 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/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 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("💾 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 '{
  "channels": [
    "@durov"
  ],
  "historyFrom": "2025-01-01",
  "limit": 1000
}' |
apify call i-scraper/telegram-like-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Telegram Like Scraper",
        "description": "⚡️ Telegram Like Scraper: Extract likes from posts from Telegram channels.",
        "version": "0.1",
        "x-build-id": "FwsbtJ1XIJkzuoFvD"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/i-scraper~telegram-like-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-i-scraper-telegram-like-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/i-scraper~telegram-like-scraper/runs": {
            "post": {
                "operationId": "runs-sync-i-scraper-telegram-like-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/i-scraper~telegram-like-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-i-scraper-telegram-like-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": [
                    "channels"
                ],
                "properties": {
                    "channels": {
                        "title": "Channels",
                        "type": "array",
                        "description": "Telegram channel usernames or links to scrape likes and reactions from.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "historyFrom": {
                        "title": "History from (ISO 8601)",
                        "type": "string",
                        "description": "Start date for message scraping (inclusive)."
                    },
                    "historyTo": {
                        "title": "History to (ISO 8601)",
                        "type": "string",
                        "description": "End date for message scraping (inclusive). Leave empty for current date."
                    },
                    "limit": {
                        "title": "Message limit per channel",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of messages to fetch per channel. Leave empty for no limit."
                    },
                    "telegramSession": {
                        "title": "Telegram session string",
                        "type": "string",
                        "description": "Optional session string to skip QR login."
                    },
                    "telegram2faPassword": {
                        "title": "Telegram 2FA password",
                        "type": "string",
                        "description": "Password for accounts with 2FA enabled."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
