Free key
Product

Documentation

One host, one key, 19 endpoints, every one a plain GET.

Headers

Authentication

Keys are issued and billed by RapidAPI. Every request carries two headers and nothing else — no phone number, no api_id, no session file.

x-rapidapi-key: YOUR_KEY
x-rapidapi-host: telegram155.p.rapidapi.com

Three full calls with the responses they return are on the quickstart page, and four things worth building on them are in the cookbook.

Reference

Endpoints

PathReturns
GET /v1/usernames/{username}Resolve a public @username to a numeric peer id
GET /v1/contacts/search?q=Search the public directory by keyword, four characters or more
GET /v1/messages/search?q=Directory search under its earlier path, kept working for callers written against it
GET /v1/channels/{peer_id}Full channel info: members, description, linked discussion group, boosts
GET /v1/channels?ids=Batch fetch channels by id
GET /v1/channels/recommendations?peer_id=Channels Telegram recommends alongside this one
GET /v1/channels/{peer_id}/participantsChannel participants, where Telegram exposes them
GET /v1/channels/{peer_id}/messages?ids=Specific channel messages by id
GET /v1/peers/{peer_id}/historyMessage history with views and forwards, paginated
GET /v1/peers/{peer_id}/messages/{msg_id}/repliesThe reply thread under a post
GET /v1/peers/{peer_id}/messages/{msg_id}/discussionThe post as it appears in the linked discussion group
GET /v1/peers/{peer_id}/storiesActive stories
GET /v1/peers/{peer_id}/stories/{ids}Specific stories by id
GET /v1/users/{peer_id}Full public user profile
GET /v1/users/{peer_id}/photosA user’s profile photos
GET /v1/phones/{phone}Resolve a phone number to a Telegram account
GET /v1/files/{file_id}Download a file or photo by id
GET /v1/openapi.jsonThe OpenAPI document the API serves about itself
GET /healthLiveness probe, free and meant to be polled

The machine-readable version of this table — parameters, response shapes and worked examples — is /openapi.json, OpenAPI 3.1.

The same specification also ships as a Postman collection: /tgatlas.postman_collection.json. In Postman pick Import, paste that link, and all 19 requests arrive grouped by subject with both RapidAPI headers already in place and the path parameters pre-filled from the examples, so the only empty field left is your key.

Cursors

Pagination

History and replies use Telegram’s own cursor scheme: offset_id, add_offset, max_id, min_id. Pass the id of the oldest message you received as offset_id to get the page before it. History responses also carry next_page, which does the same walk without any bookkeeping on your side.

Preflight

Two preconditions worth knowing

Member lists. Telegram hides the member list of a broadcast channel from everyone who is not an admin — that is the platform, not the API. full_chat.can_view_participants on /v1/channels/{peer_id} tells you in advance which way the participants call will go, and groups with an open list answer it in full.

Comment threads. A post has a thread when it has comments: every message in /v1/peers/{peer_id}/history carries replies.comments, and full_chat.linked_chat_id tells you whether the channel has a discussion group at all. Check either one and the replies and discussion calls land every time.

Envelope

Errors

Every non-2xx response arrives in one envelope, so a single error path covers the whole API:

{ "error": "service temporarily unavailable", "code": "SERVICE_UNAVAILABLE", "hint": "retry shortly" }

error is for your logs, code is for your code, and hint appears wherever there is a concrete next step. There are seven codes and the list does not grow quietly:

CodeWhat it meansWhat to do
INVALID_REQUESTA parameter is missing or malformedCheck the call against the spec — directory search needs a q of four characters or more
NOT_FOUNDNo such object, or it is not publicRe-resolve the handle; an id taken from the Bot API needs its -100 prefix stripped
RESOURCE_UNAVAILABLEThe peer has not been seeded yetFollow the hint: resolve it through /v1/usernames/{username} first, then repeat the call
RATE_LIMITEDYou are over your plan’s rateBack off and retry, then read the headers on the response: they name which of the three budgets you spent
SERVICE_UNAVAILABLEUpstream is briefly unreachableRetry shortly — the hint says so explicitly
TIMEOUTUpstream did not answer in timeRetry the same call
INTERNAL_ERROROur sideRetry; if it persists it is worth telling us, and it gets looked at

Three budgets are metered independently, and every response reports what is left of each one: monthly requests, discovery lookups and phone resolution. Only four paths spend a lookup: /v1/usernames/{username}, /v1/contacts/search, /v1/messages/search and /v1/channels/recommendations. Reading a channel and walking its history draws on requests alone. Resolving a run of handles back to back is the sequence that moves the lookup counter, and x-ratelimit-lookups-remaining shows the room you have before it does.

Every response reports what is left of all three budgets

2,500 calls a month, no card. No bot token and no phone number.

Get a free API key