Skip to content

How to get a public Telegram channel's latest posts as JSON, without api_id or a bot

By Hayden Barnett · · 5 min read

A public Telegram channel’s recent posts are on its web preview, the page at t.me/s/<handle>. Telegram’s own APIs want an api_id tied to your phone number, or a bot the channel owner has added. For a channel you do not run, one GET returns the recent posts as JSON with neither:

export FETCHPROOF_API_KEY=fp_live_xxx

curl -s "https://api.fetchproof.com/v1/telegram/channel/posts?handle=telegram" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

telegram is the published example on the channel posts endpoint. handle is the name in the channel link: in https://t.me/telegram it is telegram. A leading @ is removed before the lookup, so @telegram is the same call. Pass the name, not the whole link. There is no Telegram credential in the request. The only key is the Fetchproof key in x-api-key.

Why the official routes do not fit

Telegram has two developer APIs, and neither is built for reading a stranger’s channel from a script.

The client API (MTProto, the one Telethon and Pyrogram use) needs an api_id and api_hash. As of 29 Nov 2026, Obtaining api_id says to sign up with an official app, log in at my.telegram.org and fill out a form, and that “each number can only have one api_id connected to it.” The same page says accounts that log in through unofficial clients “are automatically put under observation.” Your collector then runs as your personal account, with a session file to keep alive on a server.

The Bot API needs a bot in the chat. The Bots FAQ lists what every bot receives: “All messages from channels where they are a member.” A bot gets messages as they are delivered to it, and only in channels that let it in. The owner of a channel you are watching is not going to add your bot.

The web preview is the third route, and it is what DIY scrapers parse. It works until the markup moves, view counts come back as text such as 2.59M, and some handles redirect because the owner turned the preview off. The endpoint does that parsing and returns typed fields.

What comes back

Field names below match the published schema for channel posts. The text is shortened.

{
  "success": true,
  "credits_remaining": 99,
  "credits_charged": 1,
  "channel": {
    "handle": "telegram",
    "name": "Telegram News",
    "url": "https://t.me/telegram",
    "is_verified": true,
    "subscriber_count": 9100000,
    "subscriber_count_text": "9.1M"
  },
  "posts": [
    {
      "id": "460",
      "channel_handle": "telegram",
      "url": "https://t.me/telegram/460",
      "author_name": null,
      "author_url": null,
      "text": "For all the info from today's update ...",
      "published_at": "2026-08-26T19:12:34+00:00",
      "view_count": 2590000,
      "view_count_text": "2.59M",
      "reactions": [],
      "reaction_count": 0,
      "forwarded_from": null,
      "media": [{ "type": "photo", "url": "https://cdn4.telesco.pe/file/..." }],
      "link_preview": null
    }
  ],
  "cursor": "441",
  "has_more": true
}

posts is newest first. id is the message number in the post URL, sent as a string, so compare it as a number. published_at is an ISO 8601 timestamp with an offset. view_count_text is the label the preview prints, and view_count is that label as an integer: 2.59M becomes 2590000. Sort on the integer, but it carries the preview’s rounding. forwarded_from holds the source name when a post is a forward. media lists a photo when the post has one.

channel is the same object the channel details endpoint returns, so one call gives you the subscriber count and the posts together.

How far back it goes

This operation returns one page of recent public posts: the window the web preview shows. On t.me/s/telegram today that page holds 20 posts. It is not an export of the channel’s full history. cursor and has_more describe that page, and you can leave cursor off to get the latest posts.

That makes it a fit for watching a channel from now on, which is what most monitors, digests and agent feeds need. Poll on a schedule, keep the highest id you have seen per channel, and keep only posts above it. A channel that posts more than a page between two polls will skip posts, so poll a busy channel more often.

Python: keep only new posts

The standard library is enough. The state file maps each handle to the last id you kept. The samples on this page use the placeholder fp_live_xxx.

import json
import os
import pathlib
import urllib.parse
import urllib.request

STATE = pathlib.Path("telegram-seen.json")
handles = ["telegram", "durov"]
seen = json.loads(STATE.read_text()) if STATE.exists() else {}

for handle in handles:
    url = "https://api.fetchproof.com/v1/telegram/channel/posts?handle=" + urllib.parse.quote(handle)
    request = urllib.request.Request(
        url,
        headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
    )
    with urllib.request.urlopen(request, timeout=60) as response:
        body = json.load(response)

    last = int(seen.get(handle, 0))
    new = [post for post in body["posts"] if int(post["id"]) > last]
    for post in reversed(new):  # oldest first
        print(handle, post["published_at"], post["url"], post["text"][:80])
    if new:
        seen[handle] = max(int(post["id"]) for post in new)

STATE.write_text(json.dumps(seen))

Run it from cron every few minutes. The first run prints the whole page and records where it stopped. Later runs print only posts published since. urlopen raises when the status is not successful, so a bad key or an upstream error stops the run before the state file moves.

Node

Node 18 and later include fetch:

const handle = "telegram";
let lastSeen = 0; // load this from your store

const endpoint = `https://api.fetchproof.com/v1/telegram/channel/posts?handle=${encodeURIComponent(handle)}`;
const response = await fetch(endpoint, {
  headers: { "x-api-key": process.env.FETCHPROOF_API_KEY },
});
if (!response.ok) {
  throw new Error(`Telegram channel posts failed: HTTP ${response.status}`);
}
const body = await response.json();
const fresh = body.posts.filter((post) => Number(post.id) > lastSeen);
for (const post of fresh.reverse()) {
  console.log(post.published_at, post.view_count, post.url);
}
if (fresh.length) lastSeen = Math.max(...fresh.map((post) => Number(post.id)));

The same request works from an n8n HTTP Request node with the x-api-key header, the setup the n8n post walks through. Follow it with a filter on id against a stored value. From an MCP client the tool name is telegram_channel_posts, so an agent can read a channel when you ask it to. Server setup is in the MCP docs.

One post by URL

When you already have a link, such as https://t.me/telegram/441, the post endpoint returns that one post in the same shape. URL-encode the link in the url parameter:

curl -s "https://api.fetchproof.com/v1/telegram/post?url=https%3A%2F%2Ft.me%2Ftelegram%2F441" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

It reads the same public preview, so it suits recent posts that someone cites. Every Telegram route is on the Telegram API page.

What a call costs

Each channel posts call costs 1 credit by default, so a monitor costs one credit per channel per poll. Errors, blocked or timed-out requests, invalid requests and cache hits cost nothing. A not-found or empty result is charged only where that operation’s published cost says so.

The channel posts page publishes the 1-credit default and lists an empty result at 0 credits. cache_max_age (1d, 3d, 7d, 14d or 30d) serves a cached response that old or newer for 0 credits, and fetches live at the normal price when there is none. That suits a daily digest. A monitor that wants posts from the last few minutes should leave it off. Read credits_charged on each body if you want to log spend.

New accounts get 100 free credits, with no card. Pack sizes and prices are on the pricing page. Freelance is $27 for 25,000 credits. Business is $297 for 500,000 credits. Credits are prepaid and do not expire. How that compares with a monthly plan is in prepaid credits vs monthly subscriptions.

FAQ

Do I need a Telegram account, api_id or bot token?

No. The request carries only the Fetchproof key in x-api-key. Nothing logs in to Telegram as you, and there is no session file to keep alive.

Can it read private channels or groups I am not in?

No. It reads what the public web preview shows to a logged-out visitor. A private channel has no preview, and a channel whose owner turned the preview off does not come back with posts.

Can I download a channel’s whole history?

Not with this operation. It returns the recent window the preview shows, newest first. Start polling now and keep what you collect.

Why is id a string?

It is the number at the end of the post URL, sent as text. Convert it before you compare or sort. Deleted posts leave gaps in the numbers, so a missing id is not an error.

Are view counts exact?

No. view_count is the preview’s rounded label as an integer. 2.59M is 2590000, not a precise count.

Try it with 100 free credits

Sign up with an email address, no card. Credits never expire. Errors, invalid requests and cache hits cost 0 credits, and each endpoint page lists exactly what it charges.