telegram api method · layer 229 · #f2c4f24d

channels.searchPosts

usable by users

Globally search for posts from public channels » (including those we aren't a member of) containing either a specific hashtag, or a full text query.

definition

channels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;

parameters

nametypedescription
flags#Flags, see TL conditional fields
hashtagflags.0?stringThe hashtag to search, without the # character.
queryflags.1?stringThe full text query: each user has a limited amount of free full text search slots, after which payment is required, see here » for more info on the full flow.
offset_rateintInitially 0, then set to the next_rate parameter of messages.messagesSlice, or if that is absent, the date of the last returned message.
offset_peerInputPeerOffsets for pagination, for more info click here
offset_idintOffsets for pagination, for more info click here
limitintMaximum number of results to return, see pagination
allow_paid_starsflags.2?longFor full text post searches (query), allows payment of the specified amount of Stars for the search, see here » for more info on the full flow.

returns

messages.Messages

errors (5)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400OFFSET_PEER_ID_INVALIDThe provided offset peer is invalid.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403PREMIUM_ACCOUNT_REQUIREDA premium account is required to execute this action.
420FROZEN_METHOD_INVALIDThe current account is frozen, and thus cannot execute the specified action.

history

present in layers 180–229 · constructor id changed 1×

idlayers
#d19f987b180–210
#f2c4f24d211–229