search_messages
Search permitted Telegram chats by keyword and narrow results by date, chat, sender, content type, or links, using cursors for ordered paging.
Instructions
Search permitted chats with early results, sorted within each page by default.
ordering=page visits sources fairly without waiting for every source. Ordering
between pages is not guaranteed. Use ordering=global for a strictly ordered
traversal, which can require empty preparation pages. The response reports the
actual ordering guarantee. order chooses newest_first or oldest_first. Repeat
both parameters with a cursor. Restricted searches only fetch permitted chats.
Dates include a timezone; interval is [date_from, date_to). Folder IDs form a union;
explicit chat_ids intersect that union. Omitted selectors use all permitted dialogs.
has_link=true selects URL-bearing posts, independently of content_type; only then
may query be empty. has_link=false excludes links. Omit it for either kind.
Uses Telegram keyword search, not semantic search. Native sender search and local
date/content filtering are combined. Partial/empty pages may carry next_cursor.
Configured public-channel access applies only to explicit chat_ids, never implicit scope.
Temporary failures retain next_cursor; respect retry_after_seconds before continuing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| order | No | newest_first | |
| query | Yes | ||
| cursor | No | ||
| date_to | No | ||
| chat_ids | No | ||
| has_link | No | ||
| ordering | No | page | |
| date_from | No | ||
| sender_id | No | ||
| folder_ids | No | ||
| content_type | No |