Messages

Get message history

Returns paginated message history for a peer. Use the next_page/prev_page cursors from the response, or pass offset_id directly.

get/v1/peers/{peer_id}/history

Request

  • Base URL: https://telegram155.p.rapidapi.com
  • URL: https://telegram155.p.rapidapi.com/v1/peers/{peer_id}/history
  • Auth: none declared

Path parameters

peer_idinteger required

Numeric Telegram peer id (channel or user). Obtain from /v1/usernames/{username}, /v1/phones/{phone}, /v1/contacts/search, or any prior response's peer.user_id / peer.channel_id field.

Query parameters

limitinteger

Maximum items to return. Defaults to 20 when omitted; values above 100 are clamped to 100.

cursorstring

Opaque pagination cursor obtained from next_page or prev_page in a previous response. Overrides offset_id and limit when supplied. Fails with 400 if tampered with.

offset_idinteger

Return messages with id < offset_id. Ignored when cursor is supplied.

offset_dateinteger

Return messages strictly older than this Unix timestamp.

add_offsetinteger

Items to skip relative to offset_id. Negative values shift toward newer messages.

max_idinteger

Return messages with id < max_id.

min_idinteger

Return messages with id > min_id.

hashinteger

Cache-busting hash; leave 0 unless you are reusing a prior result.

Response

Paginated message history.

countinteger

Total number of messages matching the query (may exceed the returned page).

flagsinteger

Bitfield of optional Telegram fields.

inexactboolean

True if count is an estimate.

next_pagestring

Opaque cursor for the next (older) page. Pass back as ?cursor=. Absent when no further page exists.

offset_id_offsetinteger

Absolute position of messages[0] in the full result set.

prev_pagestring

Opaque cursor for the previous (newer) page. Pass back as ?cursor=. Absent when already on the first page.

ptsinteger

State-update counter; opaque to callers.

topicsobject[] nullable

Forum topics referenced by the messages, if the chat is a forum.

Changes

No recorded changes to this operation across all 1 revision of this API.