# Telegram Post Detail Scraper (`xtracto/telegram-post-detail-scraper`) Actor

Fetch a single Telegram public-channel message by t.me URL or '<channel>/<id>' shorthand. Returns text, media, views, reactions, forward, reply.

- **URL**: https://apify.com/xtracto/telegram-post-detail-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media, Other
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Post Detail Scraper

Fetch a single public Telegram channel message by URL — text, media, views, reactions, author, and reply context — without a Bot API token, login, or phone number.

### Why use this actor

- **No account / no login required** — just paste a `t.me/<channel>/<id>` URL or shorthand.
- **No Bot API token needed** — works with the same public preview Telegram serves to anonymous web visitors.
- **One URL in, one record out** — perfect for citation, fact-check, permalink archival, and moderation workflows.
- **Bulk-friendly** — feed an array of URLs and process many posts in a single run.
- **Rich detail** — message text, photo and video URLs, views, reactions, author, forwarded-from source, and reply-to context.
- **Stable JSON output** suitable for pipelines, spreadsheets, and databases — every row carries `_input`, `_source`, `_scrapedAt` envelope fields so you can join results back to your input list.

### How it works

1. You provide a list of Telegram post URLs (e.g. `https://t.me/durov/491`) or `<channel>/<id>` shorthand.
2. The actor fetches each post the same way Telegram's public web preview does, then assembles a flat JSON record.
3. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "posts": [
    "https://t.me/durov/491",
    "https://t.me/telegram/350"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
```

| Field | Type | Description |
|---|---|---|
| `posts` | array | List of Telegram post URLs or `<channel>/<id>` shorthand. Both `https://t.me/durov/491` and `durov/491` are accepted. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy works for most public Telegram posts. |

### Output

Input: `https://t.me/durov/491`

```json
{
  "id": 491,
  "channel": "durov",
  "url": "https://t.me/durov/491",
  "text": "🇪🇺\nThe EU wants to force mandatory ID checks on anyone using social media — and ban people under 18 from accessing it. To that end, the EU Commission spent over a year building an \"age verification app\", which its president pompously unveiled yesterday.\nToday, this app\ngot hacked\nin just 2 minutes\n. ... (truncated)",
  "datetime": "2026-04-17T02:31:54+00:00",
  "views": "2.93M",
  "author": "Pavel Durov",
  "forwardedFrom": null,
  "replyTo": null,
  "photos": [],
  "videos": [],
  "links": [
    "https://cybernews.com/security/eu-age-verification-app-hack/"
  ],
  "reactions": [],
  "_input": "https://t.me/durov/491",
  "_source": "S1-html",
  "_scrapedAt": "2026-05-18T10:39:59.180138+00:00"
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The URL or shorthand exactly as you supplied it. Use this to join results back to your input list. |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-html` means the post was extracted from Telegram's public web preview. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `id` | integer | Telegram message ID (numeric, scoped to the channel). |
| `channel` | string | Channel username (the `<channel>` segment from the URL). |
| `url` | string | Canonical `t.me/<channel>/<id>` URL of the post. |
| `text` | string | Full message text with newlines preserved. May contain emoji and unicode. `null` if the post is media-only. |
| `datetime` | string | ISO-8601 UTC timestamp the message was originally posted. |
| `views` | string | Public view count exactly as Telegram displays it (e.g. `"2.93M"`, `"154.2K"`, `"812"`). |
| `author` | string | Display name of the channel or post author. `null` if Telegram does not expose one. |
| `forwardedFrom` | object | If the post is a forward, the original channel/user info; otherwise `null`. |
| `replyTo` | object | If the post replies to another message in the same channel, a reference to it; otherwise `null`. |
| `photos` | array | Direct URLs of photos attached to the post. CDN-signed and expire — mirror them immediately if you need long-term storage. |
| `videos` | array | Direct URLs of videos attached to the post. CDN-signed and expire. |
| `links` | array | Outbound URLs found in the message body. |
| `reactions` | array | Emoji reactions and their counts, when shown publicly. |

#### Error envelope

Posts that cannot be parsed return a structured error instead of crashing the run:

```json
{
  "_input": "https://t.me/private-channel/1",
  "_channel": "private-channel",
  "_messageId": 1,
  "_error": "not_found",
  "_errorDetail": "Telegram NotFound",
  "_source": "S1-html",
  "_scrapedAt": "2026-05-18T10:40:02.512345+00:00"
}
```

Filter on `_error` to triage failed rows. Common values: `invalid_input`, `not_found`, `fetch_failed`, `parse_failed`.

### Pricing

This actor is billed per result: **$2.50 per 1,000 results**. Each successfully scraped post = 1 result. Errors (not-found, private channel, parse failures) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Telegram | [Telegram Channel Posts Scraper](https://apify.com/xtracto/telegram-channel-posts-scraper) | Pull a feed of recent posts from any public channel |
| Bluesky | [Bluesky Post Detail Scraper](https://apify.com/xtracto/bluesky-post-detail-scraper) | Single AT-Protocol post by URL |
| Reddit | [Reddit Post Detail Scraper](https://apify.com/xtracto/reddit-post-detail-scraper) | Single Reddit submission + comments |
| Mastodon | [Mastodon Status Detail Scraper](https://apify.com/xtracto/mastodon-status-detail-scraper) | Single Mastodon status by URL |
| Threads | [Threads Post Detail Scraper](https://apify.com/xtracto/threads-post-detail-scraper) | Single Threads post by URL |
| Instagram | [Instagram Post Detail Scraper](https://apify.com/xtracto/instagram-post-detail-scraper) | Single Instagram post (photo, reel, carousel) |
| X / Twitter | [X Post Detail Scraper](https://apify.com/xtracto/x-post-detail-scraper) | Single tweet by URL |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- Only **public** channels are accessible. Private/invite-only channels and personal chats are out of scope and return `_error: "not_found"`.
- Some channels are flagged with content restrictions in the public web view (`If you have Telegram...`); those return an `_error` envelope rather than partial data.
- Photo and video URLs are CDN-signed and expire — download or mirror them immediately if you need long-term storage.
- The public preview occasionally drops formatting (bold, italics, custom emoji) for very recent posts; structured fields (`id`, `views`, `datetime`, `text`) remain reliable.
- View counts are eventually-consistent and may lag the live channel by a few minutes.

# Actor input Schema

## `posts` (type: `array`):

List of public Telegram post URLs (https://t.me/<channel>/<id>) or '<channel>/<id>' shorthand. Both formats are accepted.

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

Apify Proxy settings. Datacenter proxy works for most public Telegram posts.

## Actor input object example

```json
{
  "posts": [
    "https://t.me/durov/491",
    "https://t.me/telegram/350"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `id` (type: `string`):

Unique identifier of the item at the source.

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

Channel as reported by the source.

## `url` (type: `string`):

Direct link to the scraped item.

## `text` (type: `string`):

Text content of the item.

## `datetime` (type: `string`):

Datetime as reported by the source.

## `views` (type: `string`):

Views.

## `author` (type: `string`):

Author name.

## `photos` (type: `string`):

Photos.

## `videos` (type: `string`):

Videos.

## `_input` (type: `string`):

The input value this row was produced from.

## `_scrapedAt` (type: `string`):

UTC timestamp of the scrape, ISO 8601.

## `forwardedFrom` (type: `string`):

Forwarded From as reported by the source.

## `replyTo` (type: `string`):

Reply To as reported by the source.

## `links` (type: `string`):

Links.

## `reactions` (type: `string`):

Reactions.

## `_source` (type: `string`):

Which extraction strategy produced the row.

## `_channel` (type: `string`):

Channel as reported by the source.

## `_messageId` (type: `string`):

Message Id as reported by the source.

## `_error` (type: `string`):

Set only on diagnostic rows - why that target produced no data.

## `_errorDetail` (type: `string`):

Extra context for the error.

# 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 = {
    "posts": [
        "https://t.me/durov/491",
        "https://t.me/telegram/350"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/telegram-post-detail-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 = { "posts": [
        "https://t.me/durov/491",
        "https://t.me/telegram/350",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/telegram-post-detail-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 '{
  "posts": [
    "https://t.me/durov/491",
    "https://t.me/telegram/350"
  ]
}' |
apify call xtracto/telegram-post-detail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/telegram-post-detail-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/SvHaUDqlNq6h4NmZz/builds/8oqkOZl41bLxAT0p1/openapi.json
