# Telegram Channel Scraper: Messages, Views & Search (`nexo_data/telegram-public-channel-messages`) Actor

Scrape posts from public Telegram channels without a login, phone number or API ID. Get text, dates, views, reactions, links and media URLs, filter by keywords or date and paginate older messages. $0.15 per 1,000 messages.

- **URL**: https://apify.com/nexo_data/telegram-public-channel-messages.md
- **Developed by:** [Nexo Data](https://apify.com/nexo_data) (community)
- **Categories:** Social media, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.15 / 1,000 extracted matching messages

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 Channel Scraper: Messages, Views & Search

Scrape posts from public Telegram channels without a login, phone number or API ID. Get text, dates, views, reactions, links and media URLs, filter by keywords or date and paginate older messages. $0.15 per 1,000 messages.

**Store page:** https://apify.com/nexo_data/telegram-public-channel-messages

### What can you do with this Telegram channel messages scraper?

- Monitor crypto, news and brand channels
- Track views and engagement per post
- Build datasets for sentiment analysis and LLMs
- Search keywords across public channels without an API key

### How to scrape public Telegram channel messages

1. Open the Actor on Apify Store and click **Try for free**.
2. Paste your input (see the example below) in the Input tab.
3. Click **Start** and wait for the run to finish.
4. Download results as JSON, CSV, Excel or HTML, or fetch them via the Apify API.

### How to scrape public Telegram channel messages via API

```bash
curl -X POST "https://api.apify.com/v2/acts/nexo_data~telegram-public-channel-messages/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channels": ["telegram"], "maxMessagesPerChannel": 20, "maxPagesPerChannel": 2}'
```

You can also call it from Python/JS with the `apify-client`, schedule it, or connect it to Make, Zapier, n8n or an MCP-enabled AI agent.

### How to schedule it for monitoring

Create an Apify **Schedule** (e.g. daily) with the same input. Combine with webhooks or integrations to get alerts in Slack, email or Google Sheets.

### Input example

```json
{
  "channels": [
    "telegram"
  ],
  "maxMessagesPerChannel": 20,
  "maxPagesPerChannel": 2
}
```

### Output example

Each item in the dataset is one result. Typical fields are listed in the **Output** tab; export to JSON/CSV/Excel.

### Pricing (pay per event)

You only pay for what you get — no monthly rental. Apify platform usage is included in the event prices below.

| Event | What it is | Price |
|---|---|---|
| `run-start` | Run start — One event per valid run. | $0.0005 ($0.5 / 1,000) |
| `page` | Preview page inspected — One public channel preview page (up to 20 messages) downloaded and inspected, including pages without keyword matches. | $5e-05 ($0.05 / 1,000) |
| `message` | Extracted matching message — One matched message successfully saved to the dataset. | $0.0004 ($0.4 / 1,000) |

Tip: set **Maximum cost per run** in run options to cap spend. New Apify accounts get free monthly credits, so your first runs are effectively free.

### FAQ

**Is it legal to scrape Telegram channel messages?** This Actor collects only publicly available data. Make sure your use complies with the site's terms and data protection laws (e.g. GDPR).

**Do I need an API key or login?** No. Only an Apify account.

**What if a source fails?** Failed or empty sources are reported in the output for diagnosis; you are not charged the `message` event for them.

**Can I use it with AI agents / LLMs?** Yes — output is structured JSON, ready for RAG, LangChain, LlamaIndex or the Apify MCP server.

**Found a bug or need a feature?** Open an issue in the **Issues** tab — we usually respond within 24 hours.

# Actor input Schema

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

Examples: @telegram, durov or https://t.me/s/telegram. Public channel previews only; private invites, groups, user profiles and direct-message URLs are unsupported.

## `maxMessagesPerChannel` (type: `integer`):

Newest messages first. Keyword and date filters apply before this limit.

## `maxPagesPerChannel` (type: `integer`):

Limits page requests and costs even when a keyword returns no matches. OUTPUT reports when this limit prevents an exhaustive search.

## `keywords` (type: `array`):

Optional, case-insensitive substring filters within downloaded message text. This does not search all of Telegram.

## `keywordMode` (type: `string`):

Match any supplied keyword or require all of them.

## `since` (type: `string`):

Optional UTC date (YYYY-MM-DD) or ISO 8601 timestamp with a timezone. Example: 2026-09-01 or 2026-09-01T00:00:00Z.

## `beforeMessageId` (type: `integer`):

Optional pagination cursor, exclusive. For resuming one channel, use that channel's nextBeforeMessageId from OUTPUT.

## Actor input object example

```json
{
  "channels": [
    "https://t.me/telegram"
  ],
  "maxMessagesPerChannel": 100,
  "maxPagesPerChannel": 10,
  "keywordMode": "any"
}
```

# Actor output Schema

## `messages` (type: `string`):

Extracted public posts and explicit errors. Filter status=ok to count messages.

## `summary` (type: `string`):

Counts, errors and coverage 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": [
        "https://t.me/telegram"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexo_data/telegram-public-channel-messages").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": ["https://t.me/telegram"] }

# Run the Actor and wait for it to finish
run = client.actor("nexo_data/telegram-public-channel-messages").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": [
    "https://t.me/telegram"
  ]
}' |
apify call nexo_data/telegram-public-channel-messages --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexo_data/telegram-public-channel-messages"
        }
    }
}
```

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/WsqlkosENnhbCt0rh/builds/cALIZCAYKI6Fh0HM1/openapi.json
