Skip to Content

Platforms

Telegram

Read public Telegram channels with their posts and searches, channel posts and group messages with their comments, and invite links.

Read a channel, group, account or bot, a public channel's posts back to its first, a search inside a channel, one channel post or group message with its comments, and what an invite link opens.

Quick Reference

PropertyValue
Endpoints6
Channels and groups byhandle or url
Posts byurl or id (durov/574)
Invites byurl or code
Posts a page20
Comments a page100, then 50
CountsSubscribers, members, views, reactions

Channels and Groups

EndpointReturnsCredits
profileA channel, group, account or bot with its counts.1
profile/postsA channel's posts, newest first.1
profile/searchA search inside a channel, newest first.1
inviteWhat an invite link opens.1

Read a Profile

import { SocialAPI } from "@socialapihq/sdk";

const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });

const { data } = await client.telegram.profile({ handle: "durov" });
Response
{
  "data": {
    "id": "durov",
    "username": "durov",
    "displayName": "Pavel Durov",
    "bio": "Founder/CEO/Owner of Telegram.\n\nFounder of TON/Gram.\n\nHalf-part troll.",
    "avatarUrl": "https://cdn4.telesco.pe/file/hP1ROci3RQKSNiu0EqKtHT5U_iI_Jm-E7UrJ9lbUzyu6QI_qMAaKFwsVjzz49Sdy_ZR-18Ft4p7oI__K_XxnxDuQg_nn2dDVt4LT7kqv93S7jMBPAcoh_jubhlQGSekmhXOaYWT-Y6n3ZFghrHSd0ACzcmJb4lreWP4RvCfBKWRK2ivBsagTBrZe4lrXobwh4Ukti7XlIoRQduwiGjHrQoW0TRpcvKq3KINvKqmKvAmiAlWb-072JjjclzFbFL9otA3RHqetfL3fHXLTUWwp3yFy4zhTQezX_iYheYVQ3RqiV8JyGB9pPmjh7EmwJxyJ_BDy3pZCVZA4U21uBq8mbw.jpg",
    "url": "https://t.me/durov",
    "verified": true,
    "private": false,
    "followers": 9853398,
    "following": null,
    "likes": null,
    "posts": null,
    "externalUrl": null,
    "createdAt": null,
    "ext": {
      "kind": "channel",
      "online": null,
      "monthlyUsers": null,
      "channelId": "1006503122",
      "photos": 106,
      "videos": 47,
      "files": null,
      "links": 204,
      "previewable": true
    }
  }
}
  • A profile is a channel, a group, an account or a bot, as ext.kind says.
  • A channel's followers are its subscribers and a group's its members, both exact. A group also has ext.online, and a bot ext.monthlyUsers.
  • A channel's ext also has its photo, video, file and link counts and its numeric id (channelId).
  • A handle is taken with or without @, and a url as t.me/durov or t.me/s/durov.

Channel Posts

  • A channel's posts come newest first, 20 a page, back to its first post.
  • A search finds the posts of one channel with every word of query, or a #hashtag's, 20 a page.
  • A group's messages are read one at a time, with a message's link. A group, an account or a bot asked for its posts returns 400, at no cost.

Invites

An invite link (t.me/+…) opens a private channel or group: its title, description, picture and subscribers or members. An invite that opens nothing returns 404, at no cost.

Posts

EndpointReturnsCredits
postOne channel post or group message.1
post/commentsA post's comments, newest first.1

Post Fields

  • A post's id is its chat's name and its number there (durov/574), as its link ends.
  • The stats have its views and its reactions summed as likes. Each reaction is in ext.reactions, and stars paid as reactions in ext.stars.
  • Views and reactions past 1,000 are rounded, as Telegram shows them (596K). The figure as shown is in ext.viewsShown.
  • Its media is its photos, videos and sticker. A video's url is its file, signed for a few hours. A video too large for the web has its cover alone, and ext.mediaHidden.
  • Its ext also has its link preview, the post it was forwarded from, the message it answers, its signature and whether it was edited.
  • A group's message names its sender as author and has no views.

Comments

A channel post's comments are its linked group's replies to it, and a group message's are the thread it is in. The newest 100 come first, then 50 a page, each with its sender, media and reactions, and the comment it answers as parentId. A commenter without a public name has no author, only ext.authorName. A post without comments returns an empty list.