Skip to Content

Telegram API

6 endpoints for channels, posts and comments.

Every Telegram endpoint, by group. Each is a GET under /v1/telegram.

Quick Reference

PropertyValue
Base path/v1/telegram
Endpoints6
Credits1 a call
GuideTelegram

Accounts

Posts

Example Request

Every Telegram endpoint is called this way: its path, and what to read as query parameters.

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
    }
  }
}

Errors

A call that fails costs nothing. See Errors for every code.