Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APITelegram

    telegram.channel_posts

    The posts of a public Telegram channel, newest first: text, links, photos and videos, views, reactions and time. Pages back through the channel's history.

    Id
    telegram.channel_posts
    Version
    1
    Billed per
    record — 1 unit for each record of a charged run
    Runs
    within one request

    Start it with POST /v1/scrapers/telegram.channel_posts/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.

    Inputs

    The fields of input. A field that is not listed here is refused.

    Inputs of telegram.channel_posts
    FieldTypeDescription
    channelrequiredstringThe public channel's name, e.g. durov or @durov, or its address (https://t.me/durov).Limit: at most 200 characters.
    max_postsintegerHow many posts to return, newest first: 1 to 200.Limit: 1 to 200. Default: 20.
    beforeintegerReturn only posts older than the post with this number. To continue an earlier run, pass the number of the oldest post it returned.Limit: 2 to 2000000000.
    querystringReturn only the channel's posts that contain these words.Limit: at least 1 characters, at most 200 characters.

    Record fields

    Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.

    Record fields of telegram.channel_posts
    FieldTypeNotes
    idintegerThe post's number in its channel.
    channelstringThe channel's name, without the @.
    urlstringThe post's address.
    textstring or nullThe post's text as written, line breaks kept. Null for a post without text.
    linksarray of stringThe addresses the text links to, in order, without repeats.
    created_atstring (date-time) or nullWhen the post was published, in UTC.
    editedbooleanTrue when the channel edited the post after publishing it.Default: false.
    view_countinteger or nullNumber of views. Telegram prints large counts rounded: 77.2K is returned as 77200.
    author_signaturestring or nullThe name the post is signed with, on channels that sign their posts.
    forwardedbooleanTrue when the post was forwarded from somewhere else.Default: false.
    forwarded_fromstring or nullThe name of the channel or person a forwarded post came from; null when Telegram's page does not name it.
    forwarded_from_authorstring or nullThe name the original post was signed with, when the page shows one.
    forwarded_from_urlstring or nullThe address of the original post or channel, when Telegram links it.
    reply_to_post_idinteger or nullThe number of the post in the same channel this one replies to, when it replies to one.
    mediaarray of objectThe post's photos, videos and files, in order. An album's items are all here.
    type (in media[])"photo" | "video" | "voice" | "audio" | "document"photo, video, voice (a voice message), audio (a music or podcast file) or document (any other file).
    url (in media[])string or nullThe photo, or the video or voice file. Null for a file Telegram's web preview does not serve: audio, documents and long videos.
    thumbnail_url (in media[])string or nullThe still image shown for a video.
    duration_s (in media[])integer or nullLength of a video or voice message in seconds, when the page states it.
    title (in media[])string or nullThe name of a file, or the title of an audio track.
    details (in media[])string or nullThe line under a file's name: its size, or an audio track's performer.
    link_previewobject or nullThe preview card of a link in the post, when it shows one.
    url (in link_preview)stringThe address the preview card leads to.
    site_name (in link_preview)string or nullThe site's name as the card shows it.
    title (in link_preview)string or nullThe card's title.
    description (in link_preview)string or nullThe card's text.
    image_url (in link_preview)string or nullThe card's image.
    reactionsarray of objectThe reactions under the post, in the order Telegram shows them.
    emoji (in reactions[])string or nullThe reaction's emoji; a star for paid reactions. Null for a custom emoji.
    custom_emoji_id (in reactions[])string or nullTelegram's id of a custom emoji, when the reaction is one.
    count (in reactions[])integerHow many times it was given. Telegram prints large counts rounded (1.2K is returned as 1200).
    buttonsarray of objectThe link buttons under the post, in order.
    text (in buttons[])stringThe button's label.
    url (in buttons[])string or nullWhere the button leads.
    service_messagebooleanTrue for a notice Telegram writes itself, such as 'Channel created' or a pinned-post notice.Default: false.
    fetched_atstring (date-time)When the page was read, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    curl -X POST "https://api.enrichednow.com/v1/scrapers/telegram.channel_posts/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"channel":"telegram","max_posts":3}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("telegram.channel_posts", {
        "channel": "telegram",
        "max_posts": 3,
    })
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("telegram.channel_posts", {
      channel: "telegram",
      max_posts: 3,
    });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "telegram.channel_posts", map[string]any{"channel": "telegram", "max_posts": 3})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("telegram.channel_posts", Map.of("channel", "telegram", "max_posts", 3));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run telegram.channel_posts --input channel=telegram --input max_posts=3

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "input": {
        "channel": "telegram",
        "max_posts": 3
      }
    }

    Example response

    The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.

    JSON
    {
      "id": "run_841742f37553189ff9c27ba1",
      "scraper_id": "telegram.channel_posts",
      "scraper_version": 1,
      "status": "ok",
      "reason": null,
      "input": {
        "channel": "telegram",
        "max_posts": 3
      },
      "record_count": 1,
      "units": 1,
      "units_per_request": null,
      "units_per_record": 1,
      "units_per_page": null,
      "diagnostics": {
        "requests": 1,
        "bytes": 259214,
        "wall_ms": 885,
        "facts": {}
      },
      "created_at": "2026-11-16T22:37:50.170950Z",
      "started_at": "2026-11-16T22:37:50.178331Z",
      "finished_at": "2026-11-16T22:37:51.066313Z"
    }

    Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.

    JSON
    {
      "records": [
        {
          "id": 460,
          "channel": "telegram",
          "url": "https://t.me/telegram/460",
          "text": "For all the info from today's update and a look back at 13 years of Telegram features — check out our blog:\nhttps://telegram.org/blog/welcome-messages-buttons-TG-13\n\nAugust Features\n1 • 2 • 3 • 4 • 5 • More",
          "links": [
            "https://telegram.org/blog/welcome-messages-buttons-TG-13",
            "https://t.me/telegram/455",
            "https://t.me/telegram/456"
          ],
          "created_at": "2026-08-26T19:12:34Z",
          "edited": false,
          "view_count": 2630000,
          "author_signature": null,
          "forwarded": false,
          "forwarded_from": null,
          "forwarded_from_author": null,
          "forwarded_from_url": null,
          "reply_to_post_id": null,
          "media": [],
          "link_preview": {
            "url": "https://telegram.org/blog/welcome-messages-buttons-TG-13",
            "site_name": "Telegram",
            "title": "Welcome Messages, Buttons in Messages and Signed Gifts",
            "description": "Introducing Welcome Messages to greet new members of groups or channels, Buttons in Messages to make any text interactive, Inline Documents in Messages and much more.",
            "image_url": "https://cdn4.telesco.pe/file/Dkzha6bOuWACw6lfAnFD_5Gw7RCWMBRsZmlf4M3Pa5s-B91xIf8HJ-77WAkB_cM_QbzU_HM6LbVdt5F8P6qlVLLsgvldrnisO7LU2ierVl71IyvV3YVIV7jw4t9peznsnbpUKr2yxp_qpGO8dNqBgW6w7DZHJ6EBJJZ0DsGxS3l5yPD3yCBhuMWyxDfwMjFzZzaQ8Zjhh8eQI-izHU1bpnxWILGPhYgc_kg2-pdm8GjKi7VX7_3kBbVOOmkcCwBS0UNZjXP2Iq-7ZqUdmm70H2LatZgDoYVqr2S9b7PEL5XhgbLTrSXnhBa1lpN-1H029p5s9h-FKNgAUyNTlAKn4g.jpg"
          },
          "reactions": [],
          "buttons": [],
          "service_message": false,
          "fetched_at": "2026-11-19T18:07:41.397508Z"
        }
      ],
      "next_cursor": null
    }

    What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].

    • Shortened: links: 6 items, the first 3 shown.

    A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Telegram scrapers are in their own section there.