# Telegram API

> Returns public Telegram channel info and media counts, channel posts with reactions, post search within a channel, single posts, post comments, and sticker set and emoji pack details.

Category: Social & Video. Region: global. 7 endpoints at `https://api.hoshime.com/v1/telegram/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/telegram
## GET /v1/telegram/channel

Title, description, member count and photo of one channel, group, bot or user; channels also get their photo, video, file and link counts.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `channel` | string | yes | Username, @username, or t.me URL. (e.g. durov) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `audioCount` (integer (int64)), `description` (string), `fileCount` (integer (int64)), `linkCount` (integer (int64)), `memberCount` (integer (int64)), `photo` (string), `photoCount` (integer (int64)), `title` (string), `type` (string), `url` (string), `username` (string), `verified` (boolean), `videoCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/telegram/channel?channel=durov" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/messages

Latest public posts of one channel, about 20 per page, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `channel` | string | yes | Username, @username, or t.me URL. (e.g. durov) |
| `after` | integer | no | Only posts newer than this post id. Ignored when a cursor is given. |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `channel` (string), `forwardedFrom` (string), `hasVideo` (boolean), `id` (string), `photos` (Image[]), `photos[].height` (any), `photos[].url` (string), `photos[].width` (any), `publishedAt` (string), `reactions` (Reaction[]), `reactions[].count` (integer (int64)), `reactions[].customEmojiId` (string), `reactions[].emoji` (string), `reactions[].paid` (boolean), `text` (string), `url` (string), `views` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/telegram/messages?channel=durov" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/search

Public posts of one channel that match a search query, about 20 per page, newest first.

Scope: `social:read` · Units: 1 · Cached: 15 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `channel` | string | yes | Username, @username, or t.me URL. (e.g. durov) |
| `query` | string | yes | Words or #hashtag to find in the channel's posts. (e.g. telegram) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `channel` (string), `forwardedFrom` (string), `hasVideo` (boolean), `id` (string), `photos` (Image[]), `photos[].height` (any), `photos[].url` (string), `photos[].width` (any), `publishedAt` (string), `reactions` (Reaction[]), `reactions[].count` (integer (int64)), `reactions[].customEmojiId` (string), `reactions[].emoji` (string), `reactions[].paid` (boolean), `text` (string), `url` (string), `views` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/telegram/search?channel=durov&query=telegram" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/message

One public post of a channel, by id or by its t.me link.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `channel` | string | yes | Username, @username, or t.me URL. A post link (t.me/<name>/<id>) also gives the id. (e.g. https://t.me/durov/1) |
| `id` | integer | no | Post id. Optional when channel is a post link. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `channel` (string), `forwardedFrom` (string), `hasVideo` (boolean), `id` (string), `photos` (Image[]), `photos[].height` (any), `photos[].url` (string), `photos[].width` (any), `publishedAt` (string), `reactions` (Reaction[]), `reactions[].count` (integer (int64)), `reactions[].customEmojiId` (string), `reactions[].emoji` (string), `reactions[].paid` (boolean), `text` (string), `url` (string), `views` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/telegram/message?channel=https%3A%2F%2Ft.me%2Fdurov%2F1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/comments

Public comments under one channel post, newest first, about 50 per page. Telegram hides commenter names from visitors, so comments carry no author.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `channel` | string | yes | Username, @username, or t.me URL. A post link (t.me/<name>/<id>) also gives the id. (e.g. https://t.me/tginfo/4446) |
| `id` | integer | no | Post id. Optional when channel is a post link. |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `photos` (Image[]), `photos[].height` (any), `photos[].url` (string), `photos[].width` (any), `publishedAt` (string), `reactions` (Reaction[]), `reactions[].count` (integer (int64)), `reactions[].customEmojiId` (string), `reactions[].emoji` (string), `reactions[].paid` (boolean), `replyToId` (string), `text` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/telegram/comments?channel=https%3A%2F%2Ft.me%2Ftginfo%2F4446" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/stickerSet

Title and add link of one public sticker set, by its short name.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Sticker set short name, as in t.me/addstickers/<name>. (e.g. Animals) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `name` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/telegram/stickerSet?name=Animals" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/telegram/emojiPack

Title and add link of one public custom emoji pack, by its short name.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Emoji pack short name, as in t.me/addemoji/<name>. (e.g. RestrictedEmoji) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/telegram/emojiPack?name=RestrictedEmoji" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
