# Telegram Keyword Search Scraper (`akula.marketing/telegram-keyword-search-scraper`) Actor

Extract posts from public Telegram channels. Search by keyword across public channels, or scrape full channel histories by username

- **URL**: https://apify.com/akula.marketing/telegram-keyword-search-scraper.md
- **Developed by:** [akula.marketing](https://apify.com/akula.marketing) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 88.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.35 / 1,000 telegram posts

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

## Telegram Keyword Search & Channel Scraper

Search Google-indexed public Telegram pages for topics, brands and phrases, or collect recent posts from channels you already know. Results go to the Apify dataset and can be exported as JSON, CSV or Excel.

Telegram preview requests use rotating Apify Proxy IPs on the platform. Local runs can use direct requests when no proxy is configured.

### Search by keyword

Enter one phrase per line and choose **Search by keyword**. The Actor searches Google for public `t.me/s/` URLs, collects unique channels, then searches each public channel preview once per keyword. The Actor extracts posts from those previews, including a photo or video link and reaction counts when Telegram exposes them. It returns the canonical post URL, the Google discovery URL, the search phrase, and whether the extracted post text actually contains that phrase.

Google's snippet is not treated as Telegram post text. By default, the Actor returns only posts whose Telegram message text contains at least one keyword, so a Google hit whose post does not match is filtered out. Turn off **Only return posts containing a keyword** to read the latest preview page of each discovered channel without the keyword filter. Search results depend on Google's index and are not an exhaustive Telegram archive.

#### Cost of keyword mode

Keyword mode runs Apify's maintained Google Search Scraper as a child Actor. **Its usage is billed separately to the Apify account running this Actor.** This Actor caps that child run using `Maximum Google search spend`; the default cap is $0.50, the minimum Apify accepts for this child run. This is a limit on charges, not a fixed fee. Google lists pricing per scraped results page, and each page contains about 10 results. Apify platform compute and any configured result-event price for this Actor can be additional. Set a run spending limit in Apify Console as another safeguard.

The child actor run and its actual usage are visible in the run logs/Apify Console. If Google usage limits are reached or its run fails, this Actor reports failure rather than treating it as an empty search.

### Scrape known channels

Choose **Scrape known channels**, add public usernames or `t.me` links, and set a per-channel post cap. The Actor pages backwards through accessible public previews. Private chats, member lists and posts unavailable in public previews are not supported. History may be incomplete.

### Date filters

Dates use UTC. `afterDate` is inclusive and `beforeDate` is exclusive. Relative values such as `7 days`, `2 weeks`, `1 month` and `1 year` are supported; months mean 30 days and years mean 365 days. When a date filter is active, records without a parsed Telegram publication date are skipped.

### Output

Each row represents one scraped post and includes its message ID, text, publication date, available views and channel details, canonical post URL, Google discovery URL, source keyword, match indicator and discovery mode. Public Telegram pages may round counters or omit fields. Missing values are left empty.

### Examples

- `ChatGPT` — discover public indexed posts and channels mentioning a product.
- `crypto signals` — find public Telegram search results for a niche phrase.
- `telegram` in channel mode — export recent accessible posts from a known public channel.

This Actor does not call Akula's Telegram API and does not use a Telegram account. The optional Telegram-search API source is planned for a later version.

# Actor input Schema

## `mode` (type: `string`):

Keyword mode uses Google search. Channel mode reads public t.me previews.

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

Required in keyword mode. Enter one topic, brand, or phrase per line. Each keyword starts a separate Google search.

## `maxResultsPerKeyword` (type: `integer`):

Each page has about 10 Google results. Google Search Scraper charges separately per result page.

## `googleSpendCapUsd` (type: `number`):

Maximum child actor charges per run. Platform compute costs may be additional.

## `countryCode` (type: `string`):

Country Google uses to localize search results.

## `languageCode` (type: `string`):

Language preference Google uses to localize search results.

## `onlyMatchingPosts` (type: `boolean`):

Recommended. Return only posts whose Telegram message text contains at least one keyword. Turn off to include other posts from discovered channels.

## `afterDate` (type: `string`):

Inclusive UTC date (YYYY-MM-DD) or relative duration such as 7 days. Requires a scraped post date.

## `beforeDate` (type: `string`):

Exclusive UTC date (YYYY-MM-DD). Requires a scraped post date.

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

Public Telegram usernames or t.me URLs, one per line.

## `channelMaxMessages` (type: `integer`):

Upper limit of public posts to collect from each supplied channel.

## `channelAfterDate` (type: `string`):

Inclusive UTC date or relative duration.

## Actor input object example

```json
{
  "mode": "keyword",
  "keywords": [
    "climbing"
  ],
  "maxResultsPerKeyword": 1,
  "googleSpendCapUsd": 0.5,
  "countryCode": "us",
  "languageCode": "en",
  "onlyMatchingPosts": true,
  "channelMaxMessages": 100
}
```

# Actor output Schema

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

Posts saved in the Actor dataset.

# 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 = {
    "keywords": [
        "climbing"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("akula.marketing/telegram-keyword-search-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 = { "keywords": ["climbing"] }

# Run the Actor and wait for it to finish
run = client.actor("akula.marketing/telegram-keyword-search-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 '{
  "keywords": [
    "climbing"
  ]
}' |
apify call akula.marketing/telegram-keyword-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,akula.marketing/telegram-keyword-search-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/ef4aHt4cE0FWMGT8B/builds/BiVKqH24B8tcxXafF/openapi.json
